summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx146
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx237
-rw-r--r--sw/source/core/access/acccell.cxx47
-rw-r--r--sw/source/core/access/acccell.hxx2
-rw-r--r--sw/source/core/access/acccontext.cxx228
-rw-r--r--sw/source/core/access/acccontext.hxx50
-rw-r--r--sw/source/core/access/accdoc.cxx45
-rw-r--r--sw/source/core/access/accdoc.hxx6
-rw-r--r--sw/source/core/access/accembedded.cxx5
-rw-r--r--sw/source/core/access/accembedded.hxx3
-rw-r--r--sw/source/core/access/accfootnote.cxx13
-rw-r--r--sw/source/core/access/accfootnote.hxx2
-rw-r--r--sw/source/core/access/accframe.cxx15
-rw-r--r--sw/source/core/access/accframe.hxx5
-rw-r--r--sw/source/core/access/accframebase.cxx29
-rw-r--r--sw/source/core/access/accframebase.hxx3
-rw-r--r--sw/source/core/access/accfrmobj.cxx12
-rw-r--r--sw/source/core/access/accfrmobj.hxx8
-rw-r--r--sw/source/core/access/accfrmobjmap.cxx11
-rw-r--r--sw/source/core/access/accfrmobjmap.hxx2
-rw-r--r--sw/source/core/access/accfrmobjslist.cxx14
-rw-r--r--sw/source/core/access/accfrmobjslist.hxx3
-rw-r--r--sw/source/core/access/accgraphic.cxx5
-rw-r--r--sw/source/core/access/accgraphic.hxx3
-rw-r--r--sw/source/core/access/accheaderfooter.cxx15
-rw-r--r--sw/source/core/access/accheaderfooter.hxx4
-rw-r--r--sw/source/core/access/acchyperlink.cxx16
-rw-r--r--sw/source/core/access/acchyperlink.hxx6
-rw-r--r--sw/source/core/access/acchypertextdata.cxx3
-rw-r--r--sw/source/core/access/acchypertextdata.hxx2
-rw-r--r--sw/source/core/access/accmap.cxx338
-rw-r--r--sw/source/core/access/accnotextframe.cxx39
-rw-r--r--sw/source/core/access/accnotextframe.hxx10
-rw-r--r--sw/source/core/access/accpage.cxx23
-rw-r--r--sw/source/core/access/accpage.hxx4
-rw-r--r--sw/source/core/access/accpara.cxx255
-rw-r--r--sw/source/core/access/accpara.hxx50
-rw-r--r--sw/source/core/access/accportions.cxx17
-rw-r--r--sw/source/core/access/accportions.hxx4
-rw-r--r--sw/source/core/access/accpreview.cxx15
-rw-r--r--sw/source/core/access/accpreview.hxx2
-rw-r--r--sw/source/core/access/accselectionhelper.cxx34
-rw-r--r--sw/source/core/access/accselectionhelper.hxx4
-rw-r--r--sw/source/core/access/acctable.cxx209
-rw-r--r--sw/source/core/access/acctable.hxx14
-rw-r--r--sw/source/core/access/acctextframe.cxx26
-rw-r--r--sw/source/core/access/acctextframe.hxx8
-rw-r--r--sw/source/core/access/parachangetrackinginfo.cxx17
-rw-r--r--sw/source/core/access/parachangetrackinginfo.hxx5
-rw-r--r--sw/source/core/access/textmarkuphelper.cxx18
-rw-r--r--sw/source/core/access/textmarkuphelper.hxx13
-rw-r--r--sw/source/core/attr/calbck.cxx59
-rw-r--r--sw/source/core/attr/cellatr.cxx11
-rw-r--r--sw/source/core/attr/fmtfollowtextflow.cxx3
-rw-r--r--sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx38
-rw-r--r--sw/source/core/attr/format.cxx45
-rw-r--r--sw/source/core/attr/hints.cxx44
-rw-r--r--sw/source/core/attr/swatrset.cxx35
-rw-r--r--sw/source/core/bastyp/SwSmartTagMgr.cxx22
-rw-r--r--sw/source/core/bastyp/bparr.cxx12
-rw-r--r--sw/source/core/bastyp/breakit.cxx18
-rw-r--r--sw/source/core/bastyp/calc.cxx181
-rw-r--r--sw/source/core/bastyp/checkit.cxx4
-rw-r--r--sw/source/core/bastyp/index.cxx174
-rw-r--r--sw/source/core/bastyp/init.cxx86
-rw-r--r--sw/source/core/bastyp/ring.cxx17
-rw-r--r--sw/source/core/bastyp/swcache.cxx154
-rw-r--r--sw/source/core/bastyp/swrect.cxx36
-rw-r--r--sw/source/core/bastyp/swregion.cxx11
-rw-r--r--sw/source/core/bastyp/swtypes.cxx2
-rw-r--r--sw/source/core/bastyp/tabcol.cxx7
-rw-r--r--sw/source/core/crsr/BlockCursor.cxx2
-rw-r--r--sw/source/core/crsr/BlockCursor.hxx3
-rw-r--r--sw/source/core/crsr/IBlockCursor.hxx2
-rw-r--r--sw/source/core/crsr/bookmrk.cxx51
-rw-r--r--sw/source/core/crsr/callnk.cxx100
-rw-r--r--sw/source/core/crsr/callnk.hxx3
-rw-r--r--sw/source/core/crsr/crbm.cxx7
-rw-r--r--sw/source/core/crsr/crossrefbookmark.cxx10
-rw-r--r--sw/source/core/crsr/crsrsh.cxx179
-rw-r--r--sw/source/core/crsr/crstrvl.cxx40
-rw-r--r--sw/source/core/crsr/crstrvl1.cxx2
-rw-r--r--sw/source/core/crsr/findattr.cxx55
-rw-r--r--sw/source/core/crsr/findcoll.cxx2
-rw-r--r--sw/source/core/crsr/findfmt.cxx2
-rw-r--r--sw/source/core/crsr/findtxt.cxx10
-rw-r--r--sw/source/core/crsr/pam.cxx129
-rw-r--r--sw/source/core/crsr/paminit.cxx3
-rw-r--r--sw/source/core/crsr/swcrsr.cxx92
-rw-r--r--sw/source/core/crsr/trvlcol.cxx2
-rw-r--r--sw/source/core/crsr/trvlfnfl.cxx2
-rw-r--r--sw/source/core/crsr/trvlreg.cxx2
-rw-r--r--sw/source/core/crsr/trvltbl.cxx15
-rw-r--r--sw/source/core/crsr/unocrsr.cxx12
-rw-r--r--sw/source/core/crsr/viscrs.cxx342
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx30
-rw-r--r--sw/source/core/doc/acmplwrd.cxx75
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx12
-rw-r--r--sw/source/core/doc/doc.cxx197
-rw-r--r--sw/source/core/doc/docbasic.cxx18
-rw-r--r--sw/source/core/doc/docbm.cxx45
-rw-r--r--sw/source/core/doc/docchart.cxx9
-rw-r--r--sw/source/core/doc/doccomp.cxx103
-rw-r--r--sw/source/core/doc/doccorr.cxx2
-rw-r--r--sw/source/core/doc/docdde.cxx4
-rw-r--r--sw/source/core/doc/docdesc.cxx67
-rw-r--r--sw/source/core/doc/docdraw.cxx175
-rw-r--r--sw/source/core/doc/docedt.cxx98
-rw-r--r--sw/source/core/doc/docfld.cxx187
-rw-r--r--sw/source/core/doc/docfly.cxx107
-rw-r--r--sw/source/core/doc/docfmt.cxx156
-rw-r--r--sw/source/core/doc/docftn.cxx14
-rw-r--r--sw/source/core/doc/docglbl.cxx36
-rw-r--r--sw/source/core/doc/docglos.cxx6
-rw-r--r--sw/source/core/doc/doclay.cxx190
-rw-r--r--sw/source/core/doc/docnew.cxx155
-rw-r--r--sw/source/core/doc/docnum.cxx462
-rw-r--r--sw/source/core/doc/docredln.cxx151
-rw-r--r--sw/source/core/doc/docruby.cxx26
-rw-r--r--sw/source/core/doc/docsort.cxx68
-rw-r--r--sw/source/core/doc/docstat.cxx4
-rw-r--r--sw/source/core/doc/doctxm.cxx165
-rw-r--r--sw/source/core/doc/docxforms.cxx3
-rw-r--r--sw/source/core/doc/extinput.cxx4
-rw-r--r--sw/source/core/doc/fmtcol.cxx56
-rw-r--r--sw/source/core/doc/ftnidx.cxx2
-rw-r--r--sw/source/core/doc/gctable.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx143
-rw-r--r--sw/source/core/doc/lineinfo.cxx6
-rw-r--r--sw/source/core/doc/list.cxx14
-rw-r--r--sw/source/core/doc/notxtfrm.cxx98
-rw-r--r--sw/source/core/doc/number.cxx378
-rw-r--r--sw/source/core/doc/poolfmt.cxx229
-rw-r--r--sw/source/core/doc/sortopt.cxx11
-rw-r--r--sw/source/core/doc/swserv.cxx17
-rw-r--r--sw/source/core/doc/swstylemanager.cxx13
-rw-r--r--sw/source/core/doc/swstylemanager.hxx7
-rw-r--r--sw/source/core/doc/tblafmt.cxx32
-rw-r--r--sw/source/core/doc/tblcpy.cxx38
-rw-r--r--sw/source/core/doc/tblrwcl.cxx151
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/cancellablejob.cxx3
-rw-r--r--sw/source/core/docnode/cancellablejob.hxx3
-rw-r--r--sw/source/core/docnode/finalthreadmanager.cxx62
-rw-r--r--sw/source/core/docnode/ndcopy.cxx108
-rw-r--r--sw/source/core/docnode/ndindex.cxx14
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx29
-rw-r--r--sw/source/core/docnode/ndnum.cxx88
-rw-r--r--sw/source/core/docnode/ndsect.cxx68
-rw-r--r--sw/source/core/docnode/ndtbl.cxx366
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx43
-rw-r--r--sw/source/core/docnode/node.cxx117
-rw-r--r--sw/source/core/docnode/node2lay.cxx34
-rw-r--r--sw/source/core/docnode/nodes.cxx177
-rw-r--r--sw/source/core/docnode/observablethread.cxx5
-rw-r--r--sw/source/core/docnode/pausethreadstarting.cxx5
-rw-r--r--sw/source/core/docnode/retrievedinputstreamdata.cxx6
-rw-r--r--sw/source/core/docnode/retrieveinputstream.cxx9
-rw-r--r--sw/source/core/docnode/retrieveinputstreamconsumer.cxx4
-rw-r--r--sw/source/core/docnode/section.cxx109
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx50
-rw-r--r--sw/source/core/docnode/swthreadjoiner.cxx5
-rw-r--r--sw/source/core/docnode/swthreadmanager.cxx5
-rw-r--r--sw/source/core/docnode/threadlistener.cxx4
-rw-r--r--sw/source/core/docnode/threadmanager.cxx10
-rw-r--r--sw/source/core/draw/dcontact.cxx327
-rw-r--r--sw/source/core/draw/dflyobj.cxx76
-rw-r--r--sw/source/core/draw/dobjfac.cxx5
-rw-r--r--sw/source/core/draw/dpage.cxx17
-rw-r--r--sw/source/core/draw/drawdoc.cxx17
-rw-r--r--sw/source/core/draw/dview.cxx90
-rw-r--r--sw/source/core/edit/acorrect.cxx11
-rw-r--r--sw/source/core/edit/autofmt.cxx124
-rw-r--r--sw/source/core/edit/edatmisc.cxx20
-rw-r--r--sw/source/core/edit/edattr.cxx32
-rw-r--r--sw/source/core/edit/eddel.cxx6
-rw-r--r--sw/source/core/edit/edfcol.cxx11
-rw-r--r--sw/source/core/edit/edfld.cxx25
-rw-r--r--sw/source/core/edit/edfldexp.cxx9
-rw-r--r--sw/source/core/edit/edfmt.cxx11
-rw-r--r--sw/source/core/edit/edglbldc.cxx4
-rw-r--r--sw/source/core/edit/edglss.cxx6
-rw-r--r--sw/source/core/edit/editsh.cxx81
-rw-r--r--sw/source/core/edit/edlingu.cxx125
-rw-r--r--sw/source/core/edit/ednumber.cxx60
-rw-r--r--sw/source/core/edit/edredln.cxx2
-rw-r--r--sw/source/core/edit/edsect.cxx10
-rw-r--r--sw/source/core/edit/edtab.cxx10
-rw-r--r--sw/source/core/edit/edtox.cxx38
-rw-r--r--sw/source/core/edit/edundo.cxx16
-rw-r--r--sw/source/core/edit/edws.cxx6
-rw-r--r--sw/source/core/fields/authfld.cxx151
-rw-r--r--sw/source/core/fields/cellfml.cxx47
-rw-r--r--sw/source/core/fields/chpfld.cxx59
-rw-r--r--sw/source/core/fields/dbfld.cxx143
-rw-r--r--sw/source/core/fields/ddefld.cxx25
-rw-r--r--sw/source/core/fields/ddetbl.cxx18
-rw-r--r--sw/source/core/fields/docufld.cxx264
-rw-r--r--sw/source/core/fields/expfld.cxx77
-rw-r--r--sw/source/core/fields/fldbas.cxx76
-rw-r--r--sw/source/core/fields/flddat.cxx63
-rw-r--r--sw/source/core/fields/flddropdown.cxx19
-rw-r--r--sw/source/core/fields/fldlst.cxx4
-rw-r--r--sw/source/core/fields/macrofld.cxx24
-rw-r--r--sw/source/core/fields/postithelper.cxx22
-rw-r--r--sw/source/core/fields/reffld.cxx35
-rw-r--r--sw/source/core/fields/scrptfld.cxx22
-rw-r--r--sw/source/core/fields/tblcalc.cxx23
-rw-r--r--[-rwxr-xr-x]sw/source/core/fields/textapi.cxx3
-rw-r--r--sw/source/core/fields/usrfld.cxx32
-rw-r--r--sw/source/core/frmedt/fecopy.cxx51
-rw-r--r--sw/source/core/frmedt/fedesc.cxx22
-rw-r--r--sw/source/core/frmedt/fefly1.cxx157
-rw-r--r--sw/source/core/frmedt/feflyole.cxx7
-rw-r--r--sw/source/core/frmedt/feshview.cxx268
-rw-r--r--sw/source/core/frmedt/fetab.cxx112
-rw-r--r--sw/source/core/frmedt/fews.cxx92
-rw-r--r--sw/source/core/frmedt/tblsel.cxx127
-rw-r--r--sw/source/core/graphic/grfatr.cxx69
-rw-r--r--sw/source/core/graphic/ndgrf.cxx82
-rw-r--r--sw/source/core/inc/GetMetricVal.hxx3
-rw-r--r--sw/source/core/inc/MarkManager.hxx3
-rw-r--r--sw/source/core/inc/SwGrammarMarkUp.hxx3
-rw-r--r--sw/source/core/inc/SwPortionHandler.hxx3
-rw-r--r--sw/source/core/inc/SwUndoFmt.hxx4
-rw-r--r--sw/source/core/inc/SwUndoPageDesc.hxx7
-rw-r--r--sw/source/core/inc/SwUndoTOXChange.hxx3
-rw-r--r--sw/source/core/inc/SwXMLBlockExport.hxx3
-rw-r--r--sw/source/core/inc/SwXMLBlockImport.hxx3
-rw-r--r--sw/source/core/inc/SwXMLBlockListContext.hxx3
-rw-r--r--sw/source/core/inc/SwXMLTextBlocks.hxx3
-rw-r--r--sw/source/core/inc/SwXTextDefaults.hxx5
-rw-r--r--sw/source/core/inc/UndoNumbering.hxx22
-rw-r--r--sw/source/core/inc/UndoTable.hxx4
-rw-r--r--sw/source/core/inc/acorrect.hxx3
-rw-r--r--sw/source/core/inc/anchoredobjectposition.hxx58
-rw-r--r--sw/source/core/inc/ascharanchoredobjectposition.hxx3
-rw-r--r--sw/source/core/inc/blink.hxx2
-rw-r--r--sw/source/core/inc/bodyfrm.hxx5
-rw-r--r--sw/source/core/inc/bookmrk.hxx6
-rw-r--r--sw/source/core/inc/cellfrm.hxx3
-rw-r--r--sw/source/core/inc/cntfrm.hxx3
-rw-r--r--sw/source/core/inc/colfrm.hxx3
-rw-r--r--sw/source/core/inc/crossrefbookmark.hxx3
-rw-r--r--sw/source/core/inc/dbg_lay.hxx5
-rw-r--r--sw/source/core/inc/dflyobj.hxx5
-rw-r--r--sw/source/core/inc/docfld.hxx2
-rw-r--r--sw/source/core/inc/docsort.hxx4
-rw-r--r--sw/source/core/inc/doctxm.hxx5
-rw-r--r--sw/source/core/inc/drawdev.hxx5
-rw-r--r--sw/source/core/inc/drawfont.hxx102
-rw-r--r--sw/source/core/inc/dview.hxx2
-rw-r--r--sw/source/core/inc/environmentofanchoredobject.hxx21
-rw-r--r--sw/source/core/inc/finalthreadmanager.hxx3
-rw-r--r--sw/source/core/inc/flowfrm.hxx42
-rw-r--r--sw/source/core/inc/flyfrm.hxx48
-rw-r--r--sw/source/core/inc/flyfrms.hxx39
-rw-r--r--sw/source/core/inc/fntcache.hxx5
-rw-r--r--sw/source/core/inc/frame.hxx20
-rw-r--r--sw/source/core/inc/frminf.hxx2
-rw-r--r--sw/source/core/inc/frmtool.hxx64
-rw-r--r--sw/source/core/inc/ftnboss.hxx3
-rw-r--r--sw/source/core/inc/ftnfrm.hxx17
-rw-r--r--sw/source/core/inc/hffrm.hxx3
-rw-r--r--sw/source/core/inc/ifinishedthreadlistener.hxx3
-rw-r--r--sw/source/core/inc/ithreadlistenerowner.hxx3
-rw-r--r--sw/source/core/inc/layact.hxx7
-rw-r--r--sw/source/core/inc/laycache.hxx5
-rw-r--r--sw/source/core/inc/layfrm.hxx15
-rw-r--r--sw/source/core/inc/layouter.hxx36
-rw-r--r--sw/source/core/inc/movedfwdfrmsbyobjpos.hxx9
-rw-r--r--sw/source/core/inc/mvsave.hxx2
-rw-r--r--sw/source/core/inc/node2lay.hxx5
-rw-r--r--sw/source/core/inc/noteurl.hxx2
-rw-r--r--sw/source/core/inc/notxtfrm.hxx7
-rw-r--r--sw/source/core/inc/objectformatter.hxx60
-rw-r--r--sw/source/core/inc/observablethread.hxx5
-rw-r--r--sw/source/core/inc/pagefrm.hrc47
-rw-r--r--sw/source/core/inc/pagefrm.hxx96
-rw-r--r--sw/source/core/inc/pamtyp.hxx3
-rw-r--r--sw/source/core/inc/prevwpage.hxx7
-rw-r--r--sw/source/core/inc/ptqueue.hxx3
-rw-r--r--sw/source/core/inc/retrievedinputstreamdata.hxx9
-rw-r--r--sw/source/core/inc/retrieveinputstream.hxx8
-rw-r--r--sw/source/core/inc/retrieveinputstreamconsumer.hxx13
-rw-r--r--sw/source/core/inc/rolbck.hxx25
-rw-r--r--sw/source/core/inc/rootfrm.hxx12
-rw-r--r--sw/source/core/inc/rowfrm.hxx3
-rw-r--r--sw/source/core/inc/scriptinfo.hxx78
-rw-r--r--sw/source/core/inc/sectfrm.hxx3
-rw-r--r--sw/source/core/inc/setmapvirtdev.hxx2
-rw-r--r--sw/source/core/inc/sortedobjs.hxx14
-rw-r--r--sw/source/core/inc/sortedobjsimpl.hxx3
-rw-r--r--sw/source/core/inc/swblocks.hxx100
-rw-r--r--sw/source/core/inc/swcache.hxx23
-rw-r--r--sw/source/core/inc/swfntcch.hxx5
-rw-r--r--sw/source/core/inc/swfont.hxx14
-rw-r--r--sw/source/core/inc/swselectionlist.hxx3
-rw-r--r--sw/source/core/inc/swthreadjoiner.hxx3
-rw-r--r--sw/source/core/inc/swthreadmanager.hxx11
-rw-r--r--sw/source/core/inc/tabfrm.hxx3
-rw-r--r--sw/source/core/inc/tblrwcl.hxx5
-rw-r--r--[-rwxr-xr-x]sw/source/core/inc/textapi.hxx3
-rw-r--r--sw/source/core/inc/threadlistener.hxx3
-rw-r--r--sw/source/core/inc/threadmanager.hxx3
-rw-r--r--sw/source/core/inc/tocntntanchoredobjectposition.hxx14
-rw-r--r--sw/source/core/inc/tolayoutanchoredobjectposition.hxx11
-rw-r--r--sw/source/core/inc/toxhlp.hxx3
-rw-r--r--sw/source/core/inc/txmsrt.hxx3
-rw-r--r--sw/source/core/inc/txtfrm.hxx60
-rw-r--r--sw/source/core/inc/txttypes.hxx3
-rw-r--r--sw/source/core/inc/undoflystrattr.hxx3
-rw-r--r--sw/source/core/inc/unofldmid.h3
-rw-r--r--[-rwxr-xr-x]sw/source/core/inc/unometa.hxx2
-rw-r--r--sw/source/core/inc/viewimp.hxx34
-rw-r--r--sw/source/core/inc/visiturl.hxx9
-rw-r--r--sw/source/core/inc/wrong.hxx9
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx160
-rw-r--r--sw/source/core/layout/anchoredobject.cxx143
-rw-r--r--sw/source/core/layout/atrfrm.cxx280
-rw-r--r--sw/source/core/layout/calcmove.cxx141
-rw-r--r--sw/source/core/layout/colfrm.cxx21
-rw-r--r--sw/source/core/layout/dbg_lay.cxx47
-rw-r--r--sw/source/core/layout/findfrm.cxx104
-rw-r--r--sw/source/core/layout/flowfrm.cxx120
-rw-r--r--sw/source/core/layout/fly.cxx153
-rw-r--r--sw/source/core/layout/flycnt.cxx233
-rw-r--r--sw/source/core/layout/flyincnt.cxx31
-rw-r--r--sw/source/core/layout/flylay.cxx232
-rw-r--r--sw/source/core/layout/flypos.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx139
-rw-r--r--sw/source/core/layout/ftnfrm.cxx287
-rw-r--r--sw/source/core/layout/hffrm.cxx25
-rw-r--r--sw/source/core/layout/layact.cxx118
-rw-r--r--sw/source/core/layout/laycache.cxx136
-rw-r--r--sw/source/core/layout/layhelp.hxx14
-rw-r--r--sw/source/core/layout/layouter.cxx36
-rw-r--r--sw/source/core/layout/movedfwdfrmsbyobjpos.cxx2
-rw-r--r--sw/source/core/layout/newfrm.cxx23
-rw-r--r--sw/source/core/layout/objectformatter.cxx69
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.cxx11
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.hxx3
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx181
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.hxx44
-rw-r--r--sw/source/core/layout/objstmpconsiderwrapinfl.cxx3
-rw-r--r--sw/source/core/layout/objstmpconsiderwrapinfl.hxx3
-rw-r--r--sw/source/core/layout/pagechg.cxx167
-rw-r--r--sw/source/core/layout/pagedesc.cxx42
-rw-r--r--sw/source/core/layout/pagefrm.src17
-rw-r--r--sw/source/core/layout/paintfrm.cxx513
-rw-r--r--sw/source/core/layout/sectfrm.cxx129
-rw-r--r--sw/source/core/layout/softpagebreak.cxx2
-rw-r--r--sw/source/core/layout/sortedobjs.cxx3
-rw-r--r--sw/source/core/layout/sortedobjsimpl.cxx10
-rw-r--r--sw/source/core/layout/ssfrm.cxx32
-rw-r--r--sw/source/core/layout/swselectionlist.cxx2
-rw-r--r--sw/source/core/layout/tabfrm.cxx283
-rw-r--r--sw/source/core/layout/trvlfrm.cxx114
-rw-r--r--sw/source/core/layout/unusedf.cxx23
-rw-r--r--sw/source/core/layout/virtoutp.cxx10
-rw-r--r--sw/source/core/layout/virtoutp.hxx3
-rw-r--r--sw/source/core/layout/wsfrm.cxx189
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx135
-rw-r--r--sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx12
-rw-r--r--sw/source/core/objectpositioning/environmentofanchoredobject.cxx23
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx144
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx6
-rw-r--r--sw/source/core/ole/ndole.cxx52
-rw-r--r--sw/source/core/para/paratr.cxx40
-rw-r--r--sw/source/core/sw3io/sw3convert.cxx28
-rw-r--r--sw/source/core/sw3io/swacorr.cxx9
-rw-r--r--sw/source/core/swg/SwXMLBlockExport.cxx3
-rw-r--r--sw/source/core/swg/SwXMLBlockImport.cxx11
-rw-r--r--sw/source/core/swg/SwXMLBlockListContext.cxx3
-rw-r--r--sw/source/core/swg/SwXMLSectionList.cxx7
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx44
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx62
-rw-r--r--sw/source/core/swg/swblocks.cxx169
-rw-r--r--sw/source/core/table/swnewtable.cxx283
-rw-r--r--sw/source/core/table/swtable.cxx121
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx60
-rw-r--r--sw/source/core/text/SwGrammarMarkUp.cxx2
-rw-r--r--sw/source/core/text/atrhndl.hxx9
-rw-r--r--sw/source/core/text/atrstck.cxx15
-rw-r--r--sw/source/core/text/blink.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx31
-rw-r--r--sw/source/core/text/frmform.cxx185
-rw-r--r--sw/source/core/text/frminf.cxx3
-rw-r--r--sw/source/core/text/frmpaint.cxx63
-rw-r--r--sw/source/core/text/guess.cxx28
-rw-r--r--sw/source/core/text/guess.hxx3
-rw-r--r--sw/source/core/text/inftxt.cxx105
-rw-r--r--sw/source/core/text/inftxt.hxx31
-rw-r--r--sw/source/core/text/itradj.cxx38
-rw-r--r--sw/source/core/text/itratr.cxx15
-rw-r--r--sw/source/core/text/itratr.hxx7
-rw-r--r--sw/source/core/text/itrcrsr.cxx38
-rw-r--r--sw/source/core/text/itrform2.cxx353
-rw-r--r--sw/source/core/text/itrform2.hxx7
-rw-r--r--sw/source/core/text/itrpaint.cxx24
-rw-r--r--sw/source/core/text/itrpaint.hxx3
-rw-r--r--sw/source/core/text/itrtxt.cxx30
-rw-r--r--sw/source/core/text/itrtxt.hxx12
-rw-r--r--sw/source/core/text/noteurl.cxx4
-rw-r--r--sw/source/core/text/pordrop.hxx3
-rw-r--r--sw/source/core/text/porexp.cxx2
-rw-r--r--sw/source/core/text/porexp.hxx3
-rw-r--r--sw/source/core/text/porfld.cxx49
-rw-r--r--sw/source/core/text/porfld.hxx11
-rw-r--r--sw/source/core/text/porfly.cxx22
-rw-r--r--sw/source/core/text/porfly.hxx3
-rw-r--r--sw/source/core/text/porftn.hxx5
-rw-r--r--sw/source/core/text/porglue.cxx11
-rw-r--r--sw/source/core/text/porglue.hxx4
-rw-r--r--sw/source/core/text/porhyph.hxx3
-rw-r--r--sw/source/core/text/porlay.cxx153
-rw-r--r--sw/source/core/text/porlay.hxx11
-rw-r--r--sw/source/core/text/porlin.cxx34
-rw-r--r--sw/source/core/text/porlin.hxx21
-rw-r--r--sw/source/core/text/pormulti.cxx95
-rw-r--r--sw/source/core/text/pormulti.hxx9
-rw-r--r--sw/source/core/text/porref.cxx3
-rw-r--r--sw/source/core/text/porref.hxx3
-rw-r--r--sw/source/core/text/porrst.cxx32
-rw-r--r--sw/source/core/text/porrst.hxx3
-rw-r--r--sw/source/core/text/portab.hxx3
-rw-r--r--sw/source/core/text/portox.cxx3
-rw-r--r--sw/source/core/text/portox.hxx4
-rw-r--r--sw/source/core/text/portxt.cxx33
-rw-r--r--sw/source/core/text/portxt.hxx7
-rw-r--r--sw/source/core/text/possiz.hxx2
-rw-r--r--sw/source/core/text/redlnitr.cxx21
-rw-r--r--sw/source/core/text/redlnitr.hxx6
-rw-r--r--sw/source/core/text/txtcache.cxx36
-rw-r--r--sw/source/core/text/txtcache.hxx3
-rw-r--r--sw/source/core/text/txtcfg.hxx54
-rw-r--r--sw/source/core/text/txtdrop.cxx29
-rw-r--r--sw/source/core/text/txtfld.cxx31
-rw-r--r--sw/source/core/text/txtfly.cxx79
-rw-r--r--sw/source/core/text/txtfly.hxx59
-rw-r--r--sw/source/core/text/txtfrm.cxx54
-rw-r--r--sw/source/core/text/txtftn.cxx63
-rw-r--r--sw/source/core/text/txthyph.cxx53
-rw-r--r--sw/source/core/text/txtinit.cxx8
-rw-r--r--sw/source/core/text/txtio.cxx238
-rw-r--r--sw/source/core/text/txtpaint.cxx6
-rw-r--r--sw/source/core/text/txtpaint.hxx5
-rw-r--r--sw/source/core/text/txttab.cxx26
-rw-r--r--sw/source/core/text/widorp.cxx16
-rw-r--r--sw/source/core/text/widorp.hxx3
-rw-r--r--sw/source/core/text/wrong.cxx8
-rw-r--r--sw/source/core/text/xmldump.cxx316
-rw-r--r--sw/source/core/tox/tox.cxx54
-rw-r--r--sw/source/core/tox/toxhlp.cxx33
-rw-r--r--sw/source/core/tox/txmsrt.cxx92
-rw-r--r--sw/source/core/txtnode/SwGrammarContact.cxx2
-rw-r--r--sw/source/core/txtnode/atrfld.cxx21
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx16
-rw-r--r--sw/source/core/txtnode/atrftn.cxx16
-rw-r--r--sw/source/core/txtnode/atrref.cxx4
-rw-r--r--sw/source/core/txtnode/atrtox.cxx3
-rw-r--r--sw/source/core/txtnode/chrfmt.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx83
-rw-r--r--sw/source/core/txtnode/fntcache.cxx160
-rw-r--r--sw/source/core/txtnode/fntcap.cxx37
-rw-r--r--sw/source/core/txtnode/modeltoviewhelper.cxx3
-rw-r--r--sw/source/core/txtnode/ndhints.cxx86
-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.cxx31
-rw-r--r--sw/source/core/txtnode/thints.cxx114
-rw-r--r--sw/source/core/txtnode/txatbase.cxx2
-rw-r--r--sw/source/core/txtnode/txatritr.cxx4
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx328
-rw-r--r--sw/source/core/undo/SwRewriter.cxx4
-rw-r--r--sw/source/core/undo/SwUndoField.cxx13
-rw-r--r--sw/source/core/undo/SwUndoFmt.cxx3
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx31
-rw-r--r--sw/source/core/undo/SwUndoTOXChange.cxx2
-rw-r--r--sw/source/core/undo/docundo.cxx4
-rw-r--r--sw/source/core/undo/rolbck.cxx50
-rw-r--r--sw/source/core/undo/unattr.cxx14
-rw-r--r--sw/source/core/undo/unbkmk.cxx3
-rw-r--r--sw/source/core/undo/undel.cxx17
-rw-r--r--sw/source/core/undo/undobj.cxx32
-rw-r--r--sw/source/core/undo/undobj1.cxx20
-rw-r--r--sw/source/core/undo/undoflystrattr.cxx5
-rw-r--r--sw/source/core/undo/undraw.cxx18
-rw-r--r--sw/source/core/undo/unfmco.cxx6
-rw-r--r--sw/source/core/undo/unins.cxx19
-rw-r--r--sw/source/core/undo/unmove.cxx2
-rw-r--r--sw/source/core/undo/unnum.cxx33
-rw-r--r--sw/source/core/undo/unoutl.cxx3
-rw-r--r--sw/source/core/undo/unovwr.cxx8
-rw-r--r--sw/source/core/undo/unredln.cxx5
-rw-r--r--sw/source/core/undo/unsect.cxx10
-rw-r--r--sw/source/core/undo/unsort.cxx3
-rw-r--r--sw/source/core/undo/unspnd.cxx4
-rw-r--r--sw/source/core/undo/untbl.cxx129
-rw-r--r--sw/source/core/undo/untblk.cxx4
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx15
-rw-r--r--sw/source/core/unocore/TextCursorHelper.cxx7
-rw-r--r--sw/source/core/unocore/XMLRangeHelper.cxx5
-rw-r--r--sw/source/core/unocore/XMLRangeHelper.hxx3
-rw-r--r--sw/source/core/unocore/swunohelper.cxx24
-rw-r--r--sw/source/core/unocore/unobkm.cxx135
-rw-r--r--sw/source/core/unocore/unochart.cxx264
-rw-r--r--sw/source/core/unocore/unocoll.cxx550
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx139
-rw-r--r--sw/source/core/unocore/unodraw.cxx560
-rw-r--r--sw/source/core/unocore/unoevent.cxx6
-rw-r--r--sw/source/core/unocore/unoevtlstnr.cxx17
-rw-r--r--sw/source/core/unocore/unofield.cxx319
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx34
-rw-r--r--sw/source/core/unocore/unoframe.cxx534
-rw-r--r--sw/source/core/unocore/unoftn.cxx136
-rw-r--r--sw/source/core/unocore/unoidx.cxx362
-rw-r--r--sw/source/core/unocore/unomap.cxx103
-rw-r--r--sw/source/core/unocore/unoobj.cxx359
-rw-r--r--sw/source/core/unocore/unoobj2.cxx178
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx198
-rw-r--r--sw/source/core/unocore/unoport.cxx167
-rw-r--r--sw/source/core/unocore/unoportenum.cxx91
-rw-r--r--sw/source/core/unocore/unoprnms.cxx9
-rw-r--r--sw/source/core/unocore/unoredline.cxx175
-rw-r--r--sw/source/core/unocore/unoredlines.cxx56
-rw-r--r--sw/source/core/unocore/unorefmk.cxx187
-rw-r--r--sw/source/core/unocore/unosect.cxx172
-rw-r--r--sw/source/core/unocore/unosett.cxx295
-rw-r--r--sw/source/core/unocore/unosrch.cxx100
-rw-r--r--sw/source/core/unocore/unostyle.cxx565
-rw-r--r--sw/source/core/unocore/unotbl.cxx805
-rw-r--r--sw/source/core/unocore/unotext.cxx262
-rw-r--r--sw/source/core/unocore/unotextmarkup.cxx20
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx251
-rw-r--r--sw/source/core/view/printdata.cxx9
-rw-r--r--sw/source/core/view/vdraw.cxx124
-rw-r--r--sw/source/core/view/viewimp.cxx186
-rw-r--r--sw/source/core/view/viewpg.cxx24
-rw-r--r--sw/source/core/view/viewsh.cxx589
-rw-r--r--sw/source/core/view/vnew.cxx124
-rw-r--r--sw/source/core/view/vprint.cxx139
543 files changed, 10308 insertions, 21885 deletions
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index cec279e73096..100cc9ffda9d 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,12 +38,8 @@
// --> OD 2007-10-31 #i83479#
#include <IDocumentListItems.hxx>
// <--
-// --> OD 2010-01-13 #b6912256#
-//#include <svtools/svstdarr.hxx>
#include <doc.hxx>
-// <--
-// --> OD 2008-02-19 #refactorlists#
SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode )
: SwNumberTreeNode(),
mpTxtNode( pTxtNode ),
@@ -56,7 +53,6 @@ SwNodeNum::SwNodeNum( SwNumRule* pNumRule )
mpNumRule( pNumRule )
{
}
-// <--
SwNodeNum::~SwNodeNum()
{
@@ -74,7 +70,7 @@ SwNumRule * SwNodeNum::GetNumRule() const
void SwNodeNum::ChangeNumRule( SwNumRule& rNumRule )
{
- ASSERT( GetNumRule() && GetTxtNode(),
+ OSL_ENSURE( GetNumRule() && GetTxtNode(),
"<SwNodeNum::ChangeNumRule(..)> - missing list style and/or text node. Serious defect -> please informm OD." );
if ( GetNumRule() && GetTxtNode() )
{
@@ -91,32 +87,27 @@ void SwNodeNum::ChangeNumRule( SwNumRule& rNumRule )
SwPosition SwNodeNum::GetPosition() const
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::GetPosition()> - no text node set at <SwNodeNum> instance" );
return SwPosition(*mpTxtNode);
}
SwNumberTreeNode * SwNodeNum::Create() const
{
- // --> OD 2008-02-19 #refactorlists#
-// SwNodeNum * pResult = new SwNodeNum();
-// pResult->SetNumRule(mpNumRule);
SwNodeNum * pResult = new SwNodeNum( GetNumRule() );
- // <--
return pResult;
}
-// --> OD 2008-02-19 #refactorlists#
void SwNodeNum::PreAdd()
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::PreAdd()> - no text node set at <SwNodeNum> instance" );
if ( !GetNumRule() && GetTxtNode() )
{
mpNumRule = GetTxtNode()->GetNumRule();
}
- ASSERT( GetNumRule(),
+ OSL_ENSURE( GetNumRule(),
"<SwNodeNum::PreAdd()> - no list style set at <SwNodeNum> instance" );
if ( GetNumRule() && GetTxtNode() )
{
@@ -135,9 +126,9 @@ void SwNodeNum::PreAdd()
void SwNodeNum::PostRemove()
{
- ASSERT( GetTxtNode(),
+ OSL_ENSURE( GetTxtNode(),
"<SwNodeNum::PostRemove()> - no text node set at <SwNodeNum> instance" );
- ASSERT( GetNumRule(),
+ OSL_ENSURE( GetNumRule(),
"<SwNodeNum::PostRemove()> - no list style set at <SwNodeNum> instance" );
if ( GetTxtNode() )
@@ -191,7 +182,7 @@ bool SwNodeNum::IsContinuous() const
}
else
{
- ASSERT( false, "<SwNodeNum::IsContinuous()> - OD debug" );
+ OSL_ENSURE( false, "<SwNodeNum::IsContinuous()> - OD debug" );
}
// <--
@@ -206,13 +197,6 @@ bool SwNodeNum::IsCounted() const
{
// --> OD 2006-01-25 #i59559#
// <SwTxtNode::IsCounted()> determines, if a text node is counted for numbering
-// const SwNumFmt * pNumFmt = GetNumFmt();
-// if (pNumFmt)
-// {
-// sal_Int16 nType = pNumFmt->GetNumberingType();
-// if ( nType != SVX_NUM_NUMBER_NONE)
-// aResult = mpTxtNode->IsCounted();
-// }
aResult = GetTxtNode()->IsCountedInList();
// <--
}
@@ -227,12 +211,12 @@ bool SwNodeNum::HasCountedChildren() const
{
bool bResult = false;
- tSwNumberTreeChildren::iterator aIt;
+ tSwNumberTreeChildren::const_iterator aIt;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
{
SwNodeNum* pChild( dynamic_cast<SwNodeNum*>(*aIt) );
- ASSERT( pChild,
+ OSL_ENSURE( pChild,
"<SwNodeNum::HasCountedChildren()> - unexcepted type of child -> please inform OD" );
if ( pChild &&
( pChild->IsCountedForNumbering() ||
@@ -280,9 +264,6 @@ bool SwNodeNum::LessThan(const SwNumberTreeNode & rNode) const
{
// --> OD 2007-10-31 #i83479# - refactoring
// simplify comparison by comparing the indexes of the text nodes
-// SwPosition aMyPos(*mpTxtNode);
-// SwPosition aHisPos(*rTmpNode.mpTxtNode);
-// bResult = (aMyPos < aHisPos) ? true : false;
bResult = ( mpTxtNode->GetIndex() < rTmpNode.mpTxtNode->GetIndex() ) ? true : false;
// <--
}
@@ -290,24 +271,6 @@ bool SwNodeNum::LessThan(const SwNumberTreeNode & rNode) const
return bResult;
}
-//void SwNodeNum::SetRestart(bool bRestart)
-//{
-// // --> OD 2005-10-19 #126009#
-// // - improvement: invalidation only, if <IsRestart()> state changes.
-// const bool bInvalidate( mbRestart != bRestart );
-// // <--
-// mbRestart = bRestart;
-
-// // --> OD 2005-10-19 #126009#
-// if ( bInvalidate )
-// {
-// InvalidateMe();
-// NotifyInvalidSiblings();
-// }
-// // <--
-//}
-
-// --> OD 2008-02-25 #refactorlists#
bool SwNodeNum::IsRestart() const
{
bool bIsRestart = false;
@@ -319,23 +282,6 @@ bool SwNodeNum::IsRestart() const
return bIsRestart;
}
-// <--
-
-//void SwNodeNum::SetStart(SwNumberTree::tSwNumTreeNumber nStart)
-//{
-// // --> OD 2005-10-19 #126009#
-// // - improvement: invalidation only, if <IsRestart()> state changes.
-// const bool bInvalidate( mnStart != nStart );
-// // <--
-// mnStart = nStart;
-
-// // --> OD 2005-10-19 #126009#
-// if ( bInvalidate )
-// {
-// InvalidateMe();
-// NotifyInvalidSiblings();
-// }
-//}
bool SwNodeNum::IsCountPhantoms() const
{
@@ -348,7 +294,7 @@ bool SwNodeNum::IsCountPhantoms() const
mpNumRule->IsCountPhantoms();
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNodeNum::IsCountPhantoms(): missing numbering rule - please inform OD" );
}
// <--
@@ -356,9 +302,7 @@ bool SwNodeNum::IsCountPhantoms() const
return bResult;
}
-// --> OD 2008-02-25 #refactorlists#
SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStartValue() const
-//SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStart() const
{
SwNumberTree::tSwNumTreeNumber aResult = 1;
@@ -387,63 +331,6 @@ SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStartValue() const
return aResult;
}
-//String SwNodeNum::ToString() const
-//{
-// String aResult("[ ", RTL_TEXTENCODING_ASCII_US);
-
-// if (GetTxtNode())
-// {
-// char aBuffer[256];
-
-// sprintf(aBuffer, "%p ", GetTxtNode());
-
-// aResult += String(aBuffer, RTL_TEXTENCODING_ASCII_US);
-// aResult += String::CreateFromInt32(GetPosition().nNode.GetIndex());
-// }
-// else
-// aResult += String("*", RTL_TEXTENCODING_ASCII_US);
-
-// aResult += String(" ", RTL_TEXTENCODING_ASCII_US);
-
-// unsigned int nLvl = GetLevel();
-// aResult += String::CreateFromInt32(nLvl);
-
-// aResult += String(": ", RTL_TEXTENCODING_ASCII_US);
-
-// tNumberVector aNumVector;
-
-// _GetNumberVector(aNumVector, false);
-
-// for (unsigned int n = 0; n < aNumVector.size(); n++)
-// {
-// if (n > 0)
-// aResult += String(", ", RTL_TEXTENCODING_ASCII_US);
-
-// aResult += String::CreateFromInt32(aNumVector[n]);
-// }
-
-// if (IsCounted())
-//// aResult += String(" counted", RTL_TEXTENCODING_ASCII_US);
-// aResult += String(" C", RTL_TEXTENCODING_ASCII_US);
-
-// if (IsRestart())
-// {
-//// aResult += String(" restart(", RTL_TEXTENCODING_ASCII_US);
-// aResult += String(" R(", RTL_TEXTENCODING_ASCII_US);
-// aResult += String::CreateFromInt32(GetStart());
-// aResult += String(")", RTL_TEXTENCODING_ASCII_US);
-// }
-
-// if (! IsValid())
-//// aResult += String(" invalid", RTL_TEXTENCODING_ASCII_US);
-// aResult += String(" I", RTL_TEXTENCODING_ASCII_US);
-
-// aResult += String(" ]", RTL_TEXTENCODING_ASCII_US);
-
-// return aResult;
-//}
-
-// --> OD 2006-03-07 #131436#
void SwNodeNum::HandleNumberTreeRootNodeDelete( SwNodeNum& rNodeNum )
{
SwNodeNum* pRootNode = rNodeNum.GetParent()
@@ -471,7 +358,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
SwNodeNum* pChildNode( dynamic_cast<SwNodeNum*>((*rNodeNum.mChildren.begin())) );
if ( !pChildNode )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete(..)> - unknown number tree node child" );
++nAllowedChildCount;
continue;
@@ -494,8 +381,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
if ( pTxtNode )
{
pTxtNode->RemoveFromList();
- // --> OD 2010-01-13 #b6912256#
- // clear all list attributes and the list style
+ // --> clear all list attributes and the list style
SvUShortsSort aResetAttrsArray;
aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
@@ -519,8 +405,6 @@ const SwNodeNum* SwNodeNum::GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) c
const SwNodeNum* pPrecedingNodeNum( 0 );
// --> OD 2007-10-31 #i83479#
-// SwNodeNum aNodeNumForTxtNode;
-// aNodeNumForTxtNode.SetTxtNode( const_cast<SwTxtNode*>(&rTxtNode) );
SwNodeNum aNodeNumForTxtNode( const_cast<SwTxtNode*>(&rTxtNode) );
// <--
@@ -532,3 +416,5 @@ const SwNodeNum* SwNodeNum::GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) c
return pPrecedingNodeNum;
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 05c30aa97f5b..c19d969d09b1 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,13 +31,12 @@
#include <algorithm>
#include <functional>
-#include <errhdl.hxx>
#include <SwNumberTree.hxx>
using std::vector;
using std::find;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
unsigned long SwNumberTreeNode::nInstances = 0;
#endif
@@ -44,15 +44,13 @@ SwNumberTreeNode::SwNumberTreeNode()
: mChildren(),
mpParent( 0 ),
mnNumber( 0 ),
- // --> OD 2008-11-26 #158694#
mbContinueingPreviousSubTree( false ),
- // <--
mbPhantom( false ),
mItLastValid()
{
mItLastValid = mChildren.end();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mnSerial = nInstances;
nInstances++;
#endif
@@ -71,19 +69,19 @@ SwNumberTreeNode::~SwNumberTreeNode()
}
else
{
- ASSERT(false, "lost children!");
+ OSL_ENSURE(false, "lost children!");
}
}
- ASSERT( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent.");
+ OSL_ENSURE( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent.");
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nInstances--;
#endif
mpParent = (SwNumberTreeNode *) 0xdeadbeef;
- ASSERT(mChildren.empty(), "children left!");
+ OSL_ENSURE(mChildren.empty(), "children left!");
}
SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
@@ -93,7 +91,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! mChildren.empty() &&
(*mChildren.begin())->IsPhantom())
{
- ASSERT(false, "phantom already present");
+ OSL_ENSURE(false, "phantom already present");
}
else
{
@@ -106,7 +104,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
if (! aInsert.second)
{
- ASSERT(false, "insert of phantom failed!");
+ OSL_ENSURE(false, "insert of phantom failed!");
delete pNew;
pNew = NULL;
@@ -152,16 +150,16 @@ void SwNumberTreeNode::ClearObsoletePhantoms()
void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) const
{
- tSwNumberTreeChildren::iterator aValidateIt =
+ tSwNumberTreeChildren::const_iterator aValidateIt =
GetIterator(pNode);
if (aValidateIt != mChildren.end())
{
- ASSERT((*aValidateIt)->mpParent == this, "wrong parent");
+ OSL_ENSURE((*aValidateIt)->mpParent == this, "wrong parent");
- tSwNumberTreeChildren::iterator aIt = mItLastValid;
+ tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
- // --> OD 2005-10-19 #126009#
+ // -->
// improvement:
// - Only one time checked for <mChildren.end()>.
// - Less checks for each loop run.
@@ -171,32 +169,13 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
// of the previous node determines the start value for the following
// children loop, if all children have to be validated and the first
// one doesn't restart the counting.
-// tSwNumTreeNumber nTmpNumber = 0;
-// if (aIt != mChildren.end())
-// nTmpNumber = (*aIt)->mnNumber;
-// while (aIt != aValidateIt)
-// {
-// if (aIt == mChildren.end())
-// aIt = mChildren.begin();
-// else
-// {
-// aIt++;
-// if ((*aIt)->IsCounted())
-// nTmpNumber++;
-// }
-// if ((*aIt)->IsRestart() || aIt == mChildren.begin())
-// nTmpNumber = (*aIt)->GetStart();
-// (*aIt)->mnNumber = nTmpNumber;
-// }
SwNumberTree::tSwNumTreeNumber nTmpNumber( 0 );
if (aIt != mChildren.end())
nTmpNumber = (*aIt)->mnNumber;
else
{
aIt = mChildren.begin();
- // --> OD 2008-11-26 #158694#
(*aIt)->mbContinueingPreviousSubTree = false;
- // <--
// determine default start value
// consider the case that the first child isn't counted.
@@ -210,15 +189,13 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
// determine special start value for the case that first child
// doesn't restart the numbering and the parent node isn't counted
// and isn't the first child.
- // --> OD 2005-10-27 #126009#
const bool bParentCounted( IsCounted() &&
( !IsPhantom() ||
HasPhantomCountedParent() ) );
- // <--
if ( !(*aIt)->IsRestart() &&
GetParent() && !bParentCounted )
{
- tSwNumberTreeChildren::iterator aParentChildIt =
+ tSwNumberTreeChildren::const_iterator aParentChildIt =
GetParent()->GetIterator( this );
while ( aParentChildIt != GetParent()->mChildren.begin() )
{
@@ -226,15 +203,11 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
SwNumberTreeNode* pPrevNode( *aParentChildIt );
if ( pPrevNode->GetChildCount() > 0 )
{
- // --> OD 2008-11-26 #158694#
(*aIt)->mbContinueingPreviousSubTree = true;
- // <--
nTmpNumber = (*(pPrevNode->mChildren.rbegin()))->GetNumber();
- // --> OD 2005-10-27 #126009#
if ( (*aIt)->IsCounted() &&
( !(*aIt)->IsPhantom() ||
(*aIt)->HasPhantomCountedParent() ) )
- // <--
{
++nTmpNumber;
}
@@ -258,11 +231,9 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
while (aIt != aValidateIt)
{
++aIt;
- // --> OD 2008-11-26 #158694#
(*aIt)->mbContinueingPreviousSubTree = false;
- // <--
- // --> OD 2005-10-19 #126009# - only for counted nodes the number
+ // --> only for counted nodes the number
// has to be adjusted, compared to the previous node.
// this condition is hold also for nodes, which restart the numbering.
if ( (*aIt)->IsCounted() )
@@ -284,7 +255,7 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
{
- tSwNumberTreeChildren::iterator aIt = mItLastValid;
+ tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
SwNumberTree::tSwNumTreeNumber nTmpNumber = 0;
@@ -297,7 +268,7 @@ void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
nTmpNumber = GetStartValue();
}
else
- aIt++;
+ ++aIt;
if (aIt != mChildren.end())
{
@@ -341,7 +312,6 @@ void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
// --> OD 2008-05-21 #i74748# - applied patch from garnier_romain
// number tree node has to be validated.
-// SetLastValid(aIt);
SetLastValid( aIt, true );
// <--
}
@@ -370,7 +340,7 @@ void SwNumberTreeNode::ValidateTree()
{
tSwNumberTreeChildren::iterator aIt;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
(*aIt)->ValidateTree();
}
}
@@ -403,8 +373,6 @@ SwNumberTreeNode * SwNumberTreeNode::GetFirstNonPhantomChild()
/** Moves all children of this node that are greater than a given node
to the destination node.
-
- OD 2005-10-14 #125991#
*/
void SwNumberTreeNode::MoveGreaterChildren( SwNumberTreeNode& _rCompareNode,
SwNumberTreeNode& _rDestNode )
@@ -428,7 +396,7 @@ void SwNumberTreeNode::MoveGreaterChildren( SwNumberTreeNode& _rCompareNode,
if (aItUpper != mChildren.end())
{
tSwNumberTreeChildren::iterator aIt;
- for (aIt = aItUpper; aIt != mChildren.end(); aIt++)
+ for (aIt = aItUpper; aIt != mChildren.end(); ++aIt)
(*aIt)->mpParent = &_rDestNode;
_rDestNode.mChildren.insert(aItUpper, mChildren.end());
@@ -488,22 +456,20 @@ void SwNumberTreeNode::MoveChildren(SwNumberTreeNode * pDest)
}
tSwNumberTreeChildren::iterator aIt;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
(*aIt)->mpParent = pDest;
pDest->mChildren.insert(mChildren.begin(), mChildren.end());
mChildren.clear();
- // --> OD 2006-03-08 #131436#
// <stl::set.clear()> destroys all existing iterators.
// Thus, <mItLastValid> is also destroyed and reset becomes necessary
mItLastValid = mChildren.end();
- // <--
}
- ASSERT (mChildren.empty(), "MoveChildren failed!");
+ OSL_ENSURE(mChildren.empty(), "MoveChildren failed!");
#ifdef __SW_NUMBER_TREE_SANITY_CHECK
- ASSERT(IsSane(false) && pDest->IsSane(false), "insanity!");
+ OSL_ENSURE(IsSane(false) && pDest->IsSane(false), "insanity!");
#endif
}
@@ -535,18 +501,16 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
*/
- // --> OD 2008-03-13 #refactorlists#
if ( nDepth < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::AddChild(..)> - parameter <nDepth> out of valid range. Serious defect -> please inform OD." );
return;
}
- // <--
if ( pChild->GetParent() != NULL || pChild->GetChildCount() > 0 )
{
- ASSERT(false, "only orphans allowed.");
+ OSL_ENSURE(false, "only orphans allowed.");
return;
}
@@ -555,7 +519,7 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
tSwNumberTreeChildren::iterator aInsertDeepIt =
mChildren.upper_bound(pChild);
- ASSERT(! (aInsertDeepIt != mChildren.end() &&
+ OSL_ENSURE(! (aInsertDeepIt != mChildren.end() &&
(*aInsertDeepIt)->IsPhantom()), " unexspected phantom");
@@ -570,16 +534,14 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
}
else
{
- aInsertDeepIt--;
+ --aInsertDeepIt;
(*aInsertDeepIt)->AddChild(pChild, nDepth - 1);
}
}
else
{
- // --> OD 2008-02-19 #refactorlists#
pChild->PreAdd();
- // <--
std::pair<tSwNumberTreeChildren::iterator, bool> aResult =
mChildren.insert(pChild);
@@ -592,9 +554,9 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
if (aInsertedIt != mChildren.begin())
{
tSwNumberTreeChildren::iterator aPredIt = aInsertedIt;
- aPredIt--;
+ --aPredIt;
- // --> OD 2005-10-14 #125991#
+ // -->
// Move greater children of previous node to new child.
// This has to be done recursively on the children levels.
// Initialize loop variables <pPrevChildNode> and <pDestNode>
@@ -649,14 +611,13 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
if( bNotification )
{
- // --> OD 2005-10-20 #126009# - invalidation of not counted parent
+ // invalidation of not counted parent
// and notification of its siblings.
if ( !IsCounted() )
{
InvalidateMe();
NotifyInvalidSiblings();
}
- // <--
NotifyInvalidChildren();
}
}
@@ -683,12 +644,12 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
if (pChild->IsPhantom())
{
- ASSERT(false, "not applicable to phantoms!");
+ OSL_ENSURE(false, "not applicable to phantoms!");
return;
}
- tSwNumberTreeChildren::iterator aRemoveIt = GetIterator(pChild);
+ tSwNumberTreeChildren::const_iterator aRemoveIt = GetIterator(pChild);
if (aRemoveIt != mChildren.end())
{
@@ -696,7 +657,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
pRemove->mpParent = NULL;
- tSwNumberTreeChildren::iterator aItPred = mChildren.end();
+ tSwNumberTreeChildren::const_iterator aItPred = mChildren.end();
if (aRemoveIt == mChildren.begin())
{
@@ -710,17 +671,14 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
else
{
aItPred = aRemoveIt;
-
- aItPred--;
+ --aItPred;
}
if (! pRemove->mChildren.empty())
{
pRemove->MoveChildren(*aItPred);
- // --> OD 2008-04-04 #refactorlists#
(*aItPred)->InvalidateTree();
(*aItPred)->NotifyInvalidChildren();
- // <--
}
// --> OD 2006-01-17 #i60652#
@@ -735,20 +693,14 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
mChildren.erase(aRemoveIt);
- // --> OD 2008-04-04 #refactorlists#
-// if (aItPred != mChildren.end())
-// NotifyInvalidChildren();
NotifyInvalidChildren();
- // <--
}
else
{
- ASSERT(false, "RemoveChild: failed!");
+ OSL_ENSURE(false, "RemoveChild: failed!");
}
- // --> OD 2008-02-19 #refactorlists#
pChild->PostRemove();
- // <--
}
void SwNumberTreeNode::RemoveMe()
@@ -787,12 +739,10 @@ SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::GetNumber(bool bValidate)
return mnNumber;
}
-// --> OD 2008-11-26 #158694#
bool SwNumberTreeNode::IsContinueingPreviousSubTree() const
{
return mbContinueingPreviousSubTree;
}
-// <--
vector<SwNumberTree::tSwNumTreeNumber> SwNumberTreeNode::GetNumberVector() const
@@ -851,12 +801,11 @@ bool SwNumberTreeNode::IsCounted() const
( IsCountPhantoms() && HasCountedChildren() );
}
-// --> OD 2005-10-27 #126009#
bool SwNumberTreeNode::HasPhantomCountedParent() const
{
bool bRet( false );
- ASSERT( IsPhantom(),
+ OSL_ENSURE( IsPhantom(),
"<SwNumberTreeNode::HasPhantomCountedParent()> - wrong usage of method - it's only for phantoms" );
if ( IsPhantom() && mpParent )
{
@@ -876,14 +825,13 @@ bool SwNumberTreeNode::HasPhantomCountedParent() const
return bRet;
}
-// <--
bool SwNumberTreeNode::IsFirst(const SwNumberTreeNode * pNode) const
{
- tSwNumberTreeChildren::iterator aIt = mChildren.begin();
+ tSwNumberTreeChildren::const_iterator aIt = mChildren.begin();
if ((*aIt)->IsPhantom())
- aIt++;
+ ++aIt;
return *aIt == pNode;
}
@@ -909,7 +857,6 @@ bool SwNumberTreeNode::IsFirst() const
pNode = pNode->GetParent();
}
- // --> OD 2007-10-02 #b6600435#
// If node isn't the first child, it is the second child and the
// first child is a phanton. In this case check, if the first phantom
// child have only phanton childs
@@ -919,7 +866,6 @@ bool SwNumberTreeNode::IsFirst() const
{
bResult = false;
}
- // <--
}
else
bResult = false;
@@ -928,24 +874,23 @@ bool SwNumberTreeNode::IsFirst() const
return bResult;
}
-// --> OD 2008-03-13 #refactorlists#
void SwNumberTreeNode::SetLevelInListTree( const int nLevel )
{
if ( nLevel < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::SetLevelInListTree(..)> - parameter <nLevel> out of valid range. Serious defect -> please inform OD." );
return;
}
- ASSERT( GetParent(),
+ OSL_ENSURE( GetParent(),
"<SwNumberTreeNode::SetLevelInListTree(..)> - can only be called for number tree nodes in a list tree" );
if ( GetParent() )
{
if ( nLevel != GetLevelInListTree() )
{
SwNumberTreeNode* pRootTreeNode = GetRoot();
- ASSERT( pRootTreeNode,
+ OSL_ENSURE( pRootTreeNode,
"<SwNumberTreeNode::SetLevelInListTree(..)> - no root tree node found. Serious defect -> please inform OD." );
RemoveMe();
@@ -953,7 +898,6 @@ void SwNumberTreeNode::SetLevelInListTree( const int nLevel )
}
}
}
-// <--
int SwNumberTreeNode::GetLevelInListTree() const
{
@@ -987,14 +931,14 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (find(rParents.begin(), rParents.end(), this) != rParents.end())
{
- ASSERT(false, " I'm my own ancestor!");
+ OSL_ENSURE(false, " I'm my own ancestor!");
bResult = false;
}
if (! rParents.empty() && rParents.back() != mpParent)
{
- ASSERT(false, " I'm a bastard!");
+ OSL_ENSURE(false, " I'm a bastard!");
bResult = false;
}
@@ -1002,7 +946,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
rParents.push_back(this);
bool bFirst = true;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
{
if (*aIt)
{
@@ -1015,7 +959,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if (! bFirst)
{
- ASSERT(false, " found phantom not at first position.");
+ OSL_ENSURE(false, " found phantom not at first position.");
bResult = false;
}
@@ -1023,7 +967,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
if ((*aIt)->mpParent != (SwNumberTreeNode *) this)
{
- ASSERT(false, "found a bastard");
+ OSL_ENSURE(false, "found a bastard");
bResult = false;
}
@@ -1032,7 +976,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
{
if (!(*aIt)->IsPhantom() && (*aIt)->LessThan(*this))
{
- ASSERT(false, " found child less than me");
+ OSL_ENSURE(false, " found child less than me");
bResult = false;
}
@@ -1040,7 +984,7 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
}
else
{
- ASSERT(false, "found child that is NULL");
+ OSL_ENSURE(false, "found child that is NULL");
bResult = false;
}
@@ -1054,45 +998,19 @@ bool SwNumberTreeNode::IsSane(bool bRecursive,
}
#endif // __SW_NUMBER_TREE_SANITY_CHECK
-SwNumberTreeNode::tSwNumberTreeChildren::iterator
+SwNumberTreeNode::tSwNumberTreeChildren::const_iterator
SwNumberTreeNode::GetIterator(const SwNumberTreeNode * pChild) const
{
- tSwNumberTreeChildren::iterator aItResult =
+ tSwNumberTreeChildren::const_iterator aItResult =
mChildren.find(const_cast<SwNumberTreeNode *>(pChild));
- ASSERT( aItResult != mChildren.end(),
+ OSL_ENSURE( aItResult != mChildren.end(),
"something went wrong getting the iterator for a child");
return aItResult;
}
-//String SwNumberTreeNode::print(const String & rIndent,
-// const String & rMyIndent,
-// int nDepth) const
-//{
-// String aStr = rIndent;
-// aStr += ToString();
-// aStr += String("\n", RTL_TEXTENCODING_ASCII_US);
-
-// if (nDepth != 0)
-// {
-// if (nDepth < 0)
-// nDepth = -1;
-
-// tSwNumberTreeChildren::const_iterator aIt;
-// for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
-// {
-// String aTmpStr(rIndent);
-
-// aTmpStr += rMyIndent;
-// aStr += (*aIt)->print(aTmpStr, rMyIndent, nDepth - 1);
-// }
-// }
-
-// return aStr;
-//}
-
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
unsigned long SwNumberTreeNode::GetInstances()
{
return nInstances;
@@ -1120,7 +1038,7 @@ bool SwNumberTreeNodeLessThan(const SwNumberTreeNode * pA,
SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant() const
{
SwNumberTreeNode * pResult = NULL;
- tSwNumberTreeChildren::reverse_iterator aIt = mChildren.rbegin();
+ tSwNumberTreeChildren::const_reverse_iterator aIt = mChildren.rbegin();
if (aIt != mChildren.rend())
{
@@ -1144,7 +1062,7 @@ SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const
if (mpParent)
{
- tSwNumberTreeChildren::iterator aIt =
+ tSwNumberTreeChildren::const_iterator aIt =
mpParent->GetIterator(this);
if ( aIt == mpParent->mChildren.begin() )
@@ -1156,7 +1074,7 @@ SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const
}
else
{
- aIt--;
+ --aIt;
if ( !bSibling )
pResult = (*aIt)->GetLastDescendant();
@@ -1172,10 +1090,10 @@ SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const
}
void SwNumberTreeNode::SetLastValid
- ( SwNumberTreeNode::tSwNumberTreeChildren::iterator aItValid,
+ ( SwNumberTreeNode::tSwNumberTreeChildren::const_iterator aItValid,
bool bValidating ) const
{
- ASSERT( (aItValid == mChildren.end() || GetIterator(*aItValid) != mChildren.end()),
+ OSL_ENSURE( (aItValid == mChildren.end() || GetIterator(*aItValid) != mChildren.end()),
"last-valid iterator");
if (
@@ -1186,11 +1104,10 @@ void SwNumberTreeNode::SetLastValid
)
{
mItLastValid = aItValid;
- // --> OD 2005-10-19 #126009# - invalidation of children of next not
- // counted is needed
+ // invalidation of children of next not counted is needed
if ( GetParent() )
{
- tSwNumberTreeChildren::iterator aParentChildIt =
+ tSwNumberTreeChildren::const_iterator aParentChildIt =
GetParent()->GetIterator( this );
++aParentChildIt;
if ( aParentChildIt != GetParent()->mChildren.end() )
@@ -1202,16 +1119,15 @@ void SwNumberTreeNode::SetLastValid
}
}
}
- // <--
}
{
if (IsContinuous())
{
- tSwNumberTreeChildren::iterator aIt = mItLastValid;
+ tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
if (aIt != mChildren.end())
- aIt++;
+ ++aIt;
else
aIt = mChildren.begin();
@@ -1219,7 +1135,7 @@ void SwNumberTreeNode::SetLastValid
{
(*aIt)->InvalidateTree();
- aIt++;
+ ++aIt;
}
SetLastValid(bValidating);
@@ -1231,7 +1147,7 @@ void SwNumberTreeNode::SetLastValid(bool bValidating) const
{
if (mpParent)
{
- tSwNumberTreeChildren::iterator aIt = mpParent->GetIterator(this);
+ tSwNumberTreeChildren::const_iterator aIt = mpParent->GetIterator(this);
mpParent->SetLastValid(aIt, bValidating);
}
@@ -1242,9 +1158,9 @@ void SwNumberTreeNode::InvalidateTree() const
// do not call SetInvalid, would cause loop !!!
mItLastValid = mChildren.end();
- tSwNumberTreeChildren::iterator aIt;
+ tSwNumberTreeChildren::const_iterator aIt;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
(*aIt)->InvalidateTree();
}
@@ -1252,10 +1168,10 @@ void SwNumberTreeNode::Invalidate(SwNumberTreeNode * pChild)
{
if (pChild->IsValid())
{
- tSwNumberTreeChildren::iterator aIt = GetIterator(pChild);
+ tSwNumberTreeChildren::const_iterator aIt = GetIterator(pChild);
if (aIt != mChildren.begin())
- aIt--;
+ --aIt;
else
aIt = mChildren.end();
@@ -1285,7 +1201,7 @@ void SwNumberTreeNode::Notify()
tSwNumberTreeChildren::iterator aIt;
- for (aIt = mChildren.begin(); aIt != mChildren.end(); aIt++)
+ for (aIt = mChildren.begin(); aIt != mChildren.end(); ++aIt)
(*aIt)->Notify();
}
}
@@ -1294,24 +1210,23 @@ void SwNumberTreeNode::NotifyInvalidChildren()
{
if (IsNotifiable())
{
- tSwNumberTreeChildren::iterator aIt = mItLastValid;
+ tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
if (aIt == mChildren.end())
aIt = mChildren.begin();
else
- aIt++;
+ ++aIt;
while (aIt != mChildren.end())
{
(*aIt)->Notify();
- aIt++;
+ ++aIt;
}
- // --> OD 2005-10-19 #126009# - notification of next not counted node
- // is also needed.
+ // notification of next not counted node is also needed.
if ( GetParent() )
{
- tSwNumberTreeChildren::iterator aParentChildIt =
+ tSwNumberTreeChildren::const_iterator aParentChildIt =
GetParent()->GetIterator( this );
++aParentChildIt;
if ( aParentChildIt != GetParent()->mChildren.end() )
@@ -1370,12 +1285,11 @@ const SwNumberTreeNode* SwNumberTreeNode::GetPrecedingNodeOf(
}
// <--
-// --> OD 2008-04-17 #refactorlists#
void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
{
if ( nListLevel < 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumberTreeNode::NotifyNodesOnListLevel(..)> - invalid list level provided" );
return;
}
@@ -1387,7 +1301,7 @@ void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
void SwNumberTreeNode::NotifyChildrenOnDepth( const int nDepth )
{
- ASSERT( nDepth >= 0,
+ OSL_ENSURE( nDepth >= 0,
"<SwNumberTreeNode::NotifyChildrenOnDepth(..)> - misusage" );
SwNumberTreeNode::tSwNumberTreeChildren::iterator aChildIter =
@@ -1406,4 +1320,5 @@ void SwNumberTreeNode::NotifyChildrenOnDepth( const int nDepth )
++aChildIter;
}
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index f4cf864b7217..dbd1b5196593 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
@@ -99,8 +100,8 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
if( IsSelected() )
{
rStateSet.AddState( AccessibleStateType::SELECTED );
- ASSERT( bIsSelected, "bSelected out of sync" );
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ OSL_ENSURE( bIsSelected, "bSelected out of sync" );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
}
@@ -110,7 +111,7 @@ SwAccessibleCell::SwAccessibleCell( SwAccessibleMap *pInitMap,
: SwAccessibleContext( pInitMap, AccessibleRole::TABLE_CELL, pCellFrm )
, bIsSelected( sal_False )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sBoxName( pCellFrm->GetTabBox()->GetName() );
SetName( sBoxName );
@@ -122,7 +123,7 @@ sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
sal_Bool bNew = IsSelected();
sal_Bool bOld;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bOld = bIsSelected;
bIsSelected = bNew;
}
@@ -130,7 +131,7 @@ sal_Bool SwAccessibleCell::_InvalidateMyCursorPos()
{
// remember that object as the one that has the caret. This is
// neccessary to notify that object if the cursor leaves it.
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -155,14 +156,14 @@ sal_Bool SwAccessibleCell::_InvalidateChildrenCursorPos( const SwFrm *pFrm )
{
if( rLower.IsAccessible( GetMap()->GetShell()->IsPreView() ) )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl(
+ ::rtl::Reference< SwAccessibleContext > xAccImpl(
GetMap()->GetContextImpl( pLower, sal_False ) );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
- ASSERT( xAccImpl->GetFrm()->IsCellFrm(),
- "table child is not a cell frame" )
+ OSL_ENSURE( xAccImpl->GetFrm()->IsCellFrm(),
+ "table child is not a cell frame" );
bChanged |= static_cast< SwAccessibleCell *>(
- xAccImpl.getBodyPtr() )->_InvalidateMyCursorPos();
+ xAccImpl.get() )->_InvalidateMyCursorPos();
}
else
bChanged = sal_True; // If the context is not know we
@@ -185,7 +186,7 @@ void SwAccessibleCell::_InvalidateCursorPos()
{
const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
- ASSERT( pParent->IsTabFrm(), "parent is not a tab frame" );
+ OSL_ENSURE( pParent->IsTabFrm(), "parent is not a tab frame" );
const SwTabFrm *pTabFrm = static_cast< const SwTabFrm * >( pParent );
if( pTabFrm->IsFollow() )
pTabFrm = pTabFrm->FindMaster();
@@ -195,9 +196,9 @@ void SwAccessibleCell::_InvalidateCursorPos()
sal_Bool bChanged = _InvalidateChildrenCursorPos( pTabFrm );
if( bChanged )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl(
+ ::rtl::Reference< SwAccessibleContext > xAccImpl(
GetMap()->GetContextImpl( pTabFrm, sal_False ) );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
@@ -211,7 +212,7 @@ void SwAccessibleCell::_InvalidateCursorPos()
sal_Bool SwAccessibleCell::HasCursor()
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
return bIsSelected;
}
@@ -254,9 +255,9 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames()
void SwAccessibleCell::Dispose( sal_Bool bRecursive )
{
const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
- ::vos::ORef< SwAccessibleContext > xAccImpl(
+ ::rtl::Reference< SwAccessibleContext > xAccImpl(
GetMap()->GetContextImpl( pParent, sal_False ) );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
xAccImpl->DisposeChild( SwAccessibleChild(GetFrm()), bRecursive );
SwAccessibleContext::Dispose( bRecursive );
}
@@ -264,9 +265,9 @@ void SwAccessibleCell::Dispose( sal_Bool bRecursive )
void SwAccessibleCell::InvalidatePosOrSize( const SwRect& rOldBox )
{
const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
- ::vos::ORef< SwAccessibleContext > xAccImpl(
+ ::rtl::Reference< SwAccessibleContext > xAccImpl(
GetMap()->GetContextImpl( pParent, sal_False ) );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
xAccImpl->InvalidateChildPosOrSize( SwAccessibleChild(GetFrm()), rOldBox );
SwAccessibleContext::InvalidatePosOrSize( rOldBox );
}
@@ -308,7 +309,7 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleCell::getTypes()
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -334,7 +335,7 @@ SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
uno::Any SwAccessibleCell::getCurrentValue( )
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleValue );
uno::Any aAny;
@@ -345,7 +346,7 @@ uno::Any SwAccessibleCell::getCurrentValue( )
sal_Bool SwAccessibleCell::setCurrentValue( const uno::Any& aNumber )
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleValue );
double fValue = 0;
@@ -373,3 +374,5 @@ uno::Any SwAccessibleCell::getMinimumValue( )
aAny <<= -DBL_MAX;
return aAny;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acccell.hxx b/sw/source/core/access/acccell.hxx
index db3d7d5fd5cb..0983f8ccc4d1 100644
--- a/sw/source/core/access/acccell.hxx
+++ b/sw/source/core/access/acccell.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,3 +136,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 1b5e66071b84..60b0921324fe 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,14 +39,13 @@
#endif // #if (OSL_DEBUG_LEVEL > 1) && defined TEST_MIB
#include <tools/debug.hxx>
#include <vcl/window.hxx>
-#include <errhdl.hxx>
#include <swtypes.hxx>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
@@ -105,7 +105,7 @@ void SwAccessibleContext::InitStates()
void SwAccessibleContext::SetParent( SwAccessibleContext *pParent )
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
uno::Reference < XAccessible > xParent( pParent );
xWeakParent = xParent;
@@ -113,7 +113,7 @@ void SwAccessibleContext::SetParent( SwAccessibleContext *pParent )
uno::Reference< XAccessible > SwAccessibleContext::GetWeakParent() const
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
uno::Reference< XAccessible > xParent( xWeakParent );
return xParent;
@@ -126,11 +126,11 @@ Window *SwAccessibleContext::GetWindow()
if( GetMap() )
{
const ViewShell *pVSh = GetMap()->GetShell();
- ASSERT( pVSh, "no view shell" );
+ OSL_ENSURE( pVSh, "no view shell" );
if( pVSh )
pWin = pVSh->GetWin();
- ASSERT( pWin, "no window" );
+ OSL_ENSURE( pWin, "no window" );
}
return pWin;
@@ -141,7 +141,7 @@ SwCrsrShell* SwAccessibleContext::GetCrsrShell()
{
SwCrsrShell* pCrsrShell;
ViewShell* pViewShell = GetMap() ? GetMap()->GetShell() : 0;
- ASSERT( pViewShell, "no view shell" );
+ OSL_ENSURE( pViewShell, "no view shell" );
if( pViewShell && pViewShell->ISA( SwCrsrShell ) )
pCrsrShell = static_cast<SwCrsrShell*>( pViewShell );
else
@@ -155,7 +155,7 @@ const SwCrsrShell* SwAccessibleContext::GetCrsrShell() const
// just like non-const GetCrsrShell
const SwCrsrShell* pCrsrShell;
const ViewShell* pViewShell = GetMap() ? GetMap()->GetShell() : 0;
- ASSERT( pViewShell, "no view shell" );
+ OSL_ENSURE( pViewShell, "no view shell" );
if( pViewShell && pViewShell->ISA( SwCrsrShell ) )
pCrsrShell = static_cast<const SwCrsrShell*>( pViewShell );
else
@@ -225,13 +225,13 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
{
if ( rLower.GetSwFrm() )
{
- ASSERT( !rLower.AlwaysIncludeAsChild(),
+ OSL_ENSURE( !rLower.AlwaysIncludeAsChild(),
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
const SwFrm* pLower( rLower.GetSwFrm() );
- ::vos::ORef< SwAccessibleContext > xAccImpl =
+ ::rtl::Reference< SwAccessibleContext > xAccImpl =
GetMap()->GetContextImpl( pLower, SCROLLED_OUT == eAction ||
SCROLLED_IN == eAction );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
switch( eAction )
{
@@ -258,14 +258,14 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
}
else if ( rLower.GetDrawObject() )
{
- ASSERT( !rLower.AlwaysIncludeAsChild(),
+ OSL_ENSURE( !rLower.AlwaysIncludeAsChild(),
"<SwAccessibleContext::ChildrenScrolled(..)> - always included child not considered!" );
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl =
GetMap()->GetContextImpl( rLower.GetDrawObject(),
this,
SCROLLED_OUT == eAction ||
SCROLLED_IN == eAction );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
switch( eAction )
{
@@ -277,7 +277,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
break;
case SCROLLED_IN:
ScrolledInShape( rLower.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ xAccImpl.get() );
break;
case SCROLLED_OUT:
{
@@ -285,7 +285,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
DisposeShape( rLower.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ xAccImpl.get() );
}
break;
case NONE:
@@ -296,7 +296,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
else if ( rLower.GetWindow() )
{
// nothing to do - as such children are always included as children.
- ASSERT( rLower.AlwaysIncludeAsChild(),
+ OSL_ENSURE( rLower.AlwaysIncludeAsChild(),
"<SwAccessibleContext::ChildrenScrolled(..)> - not always included child not considered!" );
}
}
@@ -322,7 +322,7 @@ void SwAccessibleContext::Scrolled( const SwRect& rOldVisArea )
sal_Bool bIsOldShowingState;
sal_Bool bIsNewShowingState = IsShowing( *(GetMap()) );
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bIsOldShowingState = bIsShowingState;
bIsShowingState = bIsNewShowingState;
}
@@ -346,24 +346,24 @@ void SwAccessibleContext::ScrolledIn()
// This accessible should be freshly created, because it
// was not visisble before. Therefor, its vis area must already
// reflect the scrolling.
- ASSERT( GetVisArea() == GetMap()->GetVisArea(),
+ OSL_ENSURE( GetVisArea() == GetMap()->GetVisArea(),
"Vis area of child is wrong. Did it exist already?" );
// Send child event at parent. That's all we have to do here.
const SwFrm* pParent = GetParent();
- ::vos::ORef< SwAccessibleContext > xParentImpl(
+ ::rtl::Reference< SwAccessibleContext > xParentImpl(
GetMap()->GetContextImpl( pParent, sal_False ) );
uno::Reference < XAccessibleContext > xThis( this );
- if( xParentImpl.isValid() )
+ if( xParentImpl.is() )
{
- SetParent( xParentImpl.getBodyPtr() );
+ SetParent( xParentImpl.get() );
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::CHILD;
aEvent.NewValue <<= xThis;
xParentImpl->FireAccessibleEvent( aEvent );
- DBG_MSG_PARAM( "AccessibleChild (added)", xChildImpl.getBodyPtr() );
+ DBG_MSG_PARAM( "AccessibleChild (added)", xChildImpl.get() );
if( HasCursor() )
{
@@ -398,7 +398,7 @@ void SwAccessibleContext::ScrolledOut( const SwRect& rOldVisArea )
Dispose( sal_True );
}
-// --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
+// #i27301# - use new type definition for <_nStates>
void SwAccessibleContext::InvalidateChildrenStates( const SwFrm* _pFrm,
tAccessibleStates _nStates )
{
@@ -411,10 +411,10 @@ void SwAccessibleContext::InvalidateChildrenStates( const SwFrm* _pFrm,
const SwFrm* pLower = rLower.GetSwFrm();
if( pLower )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xAccImpl;
if( rLower.IsAccessible( GetShell()->IsPreView() ) )
xAccImpl = GetMap()->GetContextImpl( pLower, sal_False );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
xAccImpl->InvalidateStates( _nStates );
else
InvalidateChildrenStates( pLower, _nStates );
@@ -444,21 +444,21 @@ void SwAccessibleContext::DisposeChildren( const SwFrm *pFrm,
const SwFrm* pLower = rLower.GetSwFrm();
if( pLower )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xAccImpl;
if( rLower.IsAccessible( GetShell()->IsPreView() ) )
xAccImpl = GetMap()->GetContextImpl( pLower, sal_False );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
xAccImpl->Dispose( bRecursive );
else if( bRecursive )
DisposeChildren( pLower, bRecursive );
}
else if ( rLower.GetDrawObject() )
{
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl(
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl(
GetMap()->GetContextImpl( rLower.GetDrawObject(),
this, sal_False ) );
- if( xAccImpl.isValid() )
- DisposeShape( rLower.GetDrawObject(), xAccImpl.getBodyPtr() );
+ if( xAccImpl.is() )
+ DisposeShape( rLower.GetDrawObject(), xAccImpl.get() );
}
else if ( rLower.GetWindow() )
{
@@ -482,7 +482,7 @@ void SwAccessibleContext::_InvalidateFocus()
void SwAccessibleContext::FireAccessibleEvent( AccessibleEventObject& rEvent )
{
- ASSERT( GetFrm(), "fire event for diposed frame?" );
+ OSL_ENSURE( GetFrm(), "fire event for diposed frame?" );
if( !GetFrm() )
return;
@@ -523,7 +523,7 @@ void SwAccessibleContext::FireStateChangedEvent( sal_Int16 nState,
void SwAccessibleContext::GetStates(
::utl::AccessibleStateSetHelper& rStateSet )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// SHOWING
if( bIsShowingState )
@@ -551,7 +551,7 @@ sal_Bool SwAccessibleContext::IsEditableState()
{
sal_Bool bRet;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bRet = bIsEditableState;
}
@@ -575,7 +575,7 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
SwAccessibleContext::~SwAccessibleContext()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
DBG_MSG_CD( "destructed" )
RemoveFrmFromAccessibleMap();
@@ -592,7 +592,7 @@ uno::Reference< XAccessibleContext > SAL_CALL
sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleChildCount( void )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -603,7 +603,7 @@ uno::Reference< XAccessible> SAL_CALL
SwAccessibleContext::getAccessibleChild( sal_Int32 nIndex )
throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -620,21 +620,21 @@ uno::Reference< XAccessible> SAL_CALL
uno::Reference< XAccessible > xChild;
if( aChild.GetSwFrm() )
{
- ::vos::ORef < SwAccessibleContext > xChildImpl(
+ ::rtl::Reference < SwAccessibleContext > xChildImpl(
GetMap()->GetContextImpl( aChild.GetSwFrm(), !bDisposing ) );
- if( xChildImpl.isValid() )
+ if( xChildImpl.is() )
{
xChildImpl->SetParent( this );
- xChild = xChildImpl.getBodyPtr();
+ xChild = xChildImpl.get();
}
}
else if ( aChild.GetDrawObject() )
{
- ::vos::ORef < ::accessibility::AccessibleShape > xChildImpl(
+ ::rtl::Reference < ::accessibility::AccessibleShape > xChildImpl(
GetMap()->GetContextImpl( aChild.GetDrawObject(),
this, !bDisposing ) );
- if( xChildImpl.isValid() )
- xChild = xChildImpl.getBodyPtr();
+ if( xChildImpl.is() )
+ xChild = xChildImpl.get();
}
else if ( aChild.GetWindow() )
{
@@ -647,22 +647,22 @@ uno::Reference< XAccessible> SAL_CALL
uno::Reference< XAccessible> SAL_CALL SwAccessibleContext::getAccessibleParent (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
const SwFrm *pUpper = GetParent();
- ASSERT( pUpper != 0 || bDisposing, "no upper found" );
+ OSL_ENSURE( pUpper != 0 || bDisposing, "no upper found" );
uno::Reference< XAccessible > xAcc;
if( pUpper )
xAcc = GetMap()->GetContext( pUpper, !bDisposing );
- ASSERT( xAcc.is() || bDisposing, "no parent found" );
+ OSL_ENSURE( xAcc.is() || bDisposing, "no parent found" );
// Remember the parent as weak ref.
{
- vos::OGuard aWeakParentGuard( aMutex );
+ osl::MutexGuard aWeakParentGuard( aMutex );
xWeakParent = xAcc;
}
@@ -672,20 +672,20 @@ uno::Reference< XAccessible> SAL_CALL SwAccessibleContext::getAccessibleParent (
sal_Int32 SAL_CALL SwAccessibleContext::getAccessibleIndexInParent (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
const SwFrm *pUpper = GetParent();
- ASSERT( pUpper != 0 || bDisposing, "no upper found" );
+ OSL_ENSURE( pUpper != 0 || bDisposing, "no upper found" );
sal_Int32 nIndex = -1;
if( pUpper )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl(
+ ::rtl::Reference < SwAccessibleContext > xAccImpl(
GetMap()->GetContextImpl( pUpper, !bDisposing ) );
- ASSERT( xAccImpl.isValid() || bDisposing, "no parent found" );
- if( xAccImpl.isValid() )
+ OSL_ENSURE( xAccImpl.is() || bDisposing, "no parent found" );
+ if( xAccImpl.is() )
nIndex = xAccImpl->GetChildIndex( *(GetMap()), SwAccessibleChild(GetFrm()) );
}
@@ -701,7 +701,7 @@ sal_Int16 SAL_CALL SwAccessibleContext::getAccessibleRole (void)
OUString SAL_CALL SwAccessibleContext::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- ASSERT( !this, "description needs to be overloaded" );
+ OSL_ENSURE( !this, "description needs to be overloaded" );
THROW_RUNTIME_EXCEPTION( XAccessibleContext, "internal error (method must be overloaded)" );
}
@@ -724,7 +724,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
SwAccessibleContext::getAccessibleStateSet (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -740,7 +740,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
lang::Locale SAL_CALL SwAccessibleContext::getLocale (void)
throw (IllegalAccessibleComponentStateException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
lang::Locale aLoc( Application::GetSettings().GetLocale() );
return aLoc;
@@ -754,7 +754,7 @@ void SAL_CALL SwAccessibleContext::addEventListener(
if (xListener.is())
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!nClientId)
nClientId = comphelper::AccessibleEventNotifier::registerClient( );
comphelper::AccessibleEventNotifier::addEventListener( nClientId, xListener );
@@ -769,7 +769,7 @@ void SAL_CALL SwAccessibleContext::removeEventListener(
if (xListener.is())
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( nClientId, xListener );
if ( !nListenerCount )
{
@@ -810,7 +810,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint
const awt::Point& aPoint )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleComponent )
@@ -867,12 +867,12 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint
awt::Rectangle SAL_CALL SwAccessibleContext::getBoundsImpl(sal_Bool bRelative)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleComponent )
const SwFrm *pParent = GetParent();
- ASSERT( pParent, "no Parent found" );
+ OSL_ENSURE( pParent, "no Parent found" );
Window *pWin = GetWindow();
CHECK_FOR_WINDOW( XAccessibleComponent, pWin && pParent )
@@ -882,10 +882,10 @@ awt::Rectangle SAL_CALL SwAccessibleContext::getBoundsImpl(sal_Bool bRelative)
if( GetFrm()->IsPageFrm() &&
static_cast < const SwPageFrm * >( GetFrm() )->IsEmptyPage() )
{
- ASSERT( GetShell()->IsPreView(), "empty page accessible?" );
+ OSL_ENSURE( GetShell()->IsPreView(), "empty page accessible?" );
if( GetShell()->IsPreView() )
{
- // OD 15.01.2003 #103492# - adjust method call <GetMap()->GetPreViewPageSize()>
+ // adjust method call <GetMap()->GetPreViewPageSize()>
sal_uInt16 nPageNum =
static_cast < const SwPageFrm * >( GetFrm() )->GetPhyPageNum();
aLogBounds.SSize( GetMap()->GetPreViewPageSize( nPageNum ) );
@@ -953,7 +953,7 @@ awt::Size SAL_CALL SwAccessibleContext::getSize()
void SAL_CALL SwAccessibleContext::grabFocus()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext );
@@ -1015,7 +1015,7 @@ sal_Int32 SAL_CALL SwAccessibleContext::getBackground()
OUString SAL_CALL SwAccessibleContext::getImplementationName()
throw( uno::RuntimeException )
{
- ASSERT( !this, "implementation name needs to be overloaded" );
+ OSL_ENSURE( !this, "implementation name needs to be overloaded" );
THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "implementation name needs to be overloaded" )
}
@@ -1024,27 +1024,27 @@ sal_Bool SAL_CALL
SwAccessibleContext::supportsService (const ::rtl::OUString& )
throw (uno::RuntimeException)
{
- ASSERT( !this, "supports service needs to be overloaded" );
+ OSL_ENSURE( !this, "supports service needs to be overloaded" );
THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "supports service needs to be overloaded" )
}
uno::Sequence< OUString > SAL_CALL SwAccessibleContext::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- ASSERT( !this, "supported services names needs to be overloaded" );
+ OSL_ENSURE( !this, "supported services names needs to be overloaded" );
THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "supported services needs to be overloaded" )
}
void SwAccessibleContext::DisposeShape( const SdrObject *pObj,
::accessibility::AccessibleShape *pAccImpl )
{
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl( pAccImpl );
- if( !xAccImpl.isValid() )
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl( pAccImpl );
+ if( !xAccImpl.is() )
xAccImpl = GetMap()->GetContextImpl( pObj, this, sal_True );
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::CHILD;
- uno::Reference< XAccessible > xAcc( xAccImpl.getBodyPtr() );
+ uno::Reference< XAccessible > xAcc( xAccImpl.get() );
aEvent.OldValue <<= xAcc;
FireAccessibleEvent( aEvent );
@@ -1078,10 +1078,10 @@ void SwAccessibleContext::ScrolledInShape( const SdrObject* ,
void SwAccessibleContext::Dispose( sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- ASSERT( GetFrm() && GetMap(), "already disposed" );
- ASSERT( GetMap()->GetVisArea() == GetVisArea(),
+ OSL_ENSURE( GetFrm() && GetMap(), "already disposed" );
+ OSL_ENSURE( GetMap()->GetVisArea() == GetVisArea(),
"invalid vis area for dispose" );
bDisposing = sal_True;
@@ -1109,7 +1109,7 @@ void SwAccessibleContext::Dispose( sal_Bool bRecursive )
// set defunc state (its not required to broadcast a state changed
// event if the object is diposed afterwards)
{
- vos::OGuard aDefuncStateGuard( aMutex );
+ osl::MutexGuard aDefuncStateGuard( aMutex );
bIsDefuncState = sal_True;
}
@@ -1131,7 +1131,7 @@ void SwAccessibleContext::Dispose( sal_Bool bRecursive )
void SwAccessibleContext::DisposeChild( const SwAccessibleChild& rChildFrmOrObj,
sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( IsShowing( *(GetMap()), rChildFrmOrObj ) ||
rChildFrmOrObj.AlwaysIncludeAsChild() ||
@@ -1142,18 +1142,18 @@ void SwAccessibleContext::DisposeChild( const SwAccessibleChild& rChildFrmOrObj,
// get notified of the movement.
if( rChildFrmOrObj.GetSwFrm() )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl =
+ ::rtl::Reference< SwAccessibleContext > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetSwFrm(),
sal_True );
xAccImpl->Dispose( bRecursive );
}
else if ( rChildFrmOrObj.GetDrawObject() )
{
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetDrawObject(),
this, sal_True );
DisposeShape( rChildFrmOrObj.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ xAccImpl.get() );
}
else if ( rChildFrmOrObj.GetWindow() )
{
@@ -1171,14 +1171,14 @@ void SwAccessibleContext::DisposeChild( const SwAccessibleChild& rChildFrmOrObj,
void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- ASSERT( GetFrm() && !GetFrm()->Frm().IsEmpty(), "context should have a size" );
+ OSL_ENSURE( GetFrm() && !GetFrm()->Frm().IsEmpty(), "context should have a size" );
sal_Bool bIsOldShowingState;
sal_Bool bIsNewShowingState = IsShowing( *(GetMap()) );
{
- vos::OGuard aShowingStateGuard( aMutex );
+ osl::MutexGuard aShowingStateGuard( aMutex );
bIsOldShowingState = bIsShowingState;
bIsShowingState = bIsNewShowingState;
}
@@ -1210,9 +1210,9 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
const SwAccessibleChild& rChildFrmOrObj,
const SwRect& rOldFrm )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- ASSERT( !rChildFrmOrObj.GetSwFrm() ||
+ OSL_ENSURE( !rChildFrmOrObj.GetSwFrm() ||
!rChildFrmOrObj.GetSwFrm()->Frm().IsEmpty(),
"child context should have a size" );
@@ -1235,25 +1235,25 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
if( rChildFrmOrObj.GetSwFrm() )
{
// The frame becomes visible. A child event must be send.
- ::vos::ORef< SwAccessibleContext > xAccImpl =
+ ::rtl::Reference< SwAccessibleContext > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetSwFrm(),
sal_True );
xAccImpl->ScrolledIn();
}
else if ( rChildFrmOrObj.GetDrawObject() )
{
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetDrawObject(),
this, sal_True );
- // --> OD 2004-11-29 #i37790#
- if ( xAccImpl.isValid() )
+ // #i37790#
+ if ( xAccImpl.is() )
{
ScrolledInShape( rChildFrmOrObj.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ xAccImpl.get() );
}
else
{
- ASSERT( false ,
+ OSL_ENSURE( false ,
"<SwAccessibleContext::InvalidateChildPosOrSize(..)> - no accessible shape found." );
}
// <--
@@ -1278,7 +1278,7 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
{
if( rChildFrmOrObj.GetSwFrm() )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl =
+ ::rtl::Reference< SwAccessibleContext > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetSwFrm(),
sal_True );
xAccImpl->SetParent( this );
@@ -1286,15 +1286,15 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
}
else if ( rChildFrmOrObj.GetDrawObject() )
{
- ::vos::ORef< ::accessibility::AccessibleShape > xAccImpl =
+ ::rtl::Reference< ::accessibility::AccessibleShape > xAccImpl =
GetMap()->GetContextImpl( rChildFrmOrObj.GetDrawObject(),
this, sal_True );
DisposeShape( rChildFrmOrObj.GetDrawObject(),
- xAccImpl.getBodyPtr() );
+ xAccImpl.get() );
}
else if ( rChildFrmOrObj.GetWindow() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAccessibleContext::InvalidateChildPosOrSize(..)> - not expected to handle dispose of child of type <Window>." );
}
}
@@ -1303,26 +1303,26 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
void SwAccessibleContext::InvalidateContent()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
_InvalidateContent( sal_False );
}
void SwAccessibleContext::InvalidateCursorPos()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
_InvalidateCursorPos();
}
void SwAccessibleContext::InvalidateFocus()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
_InvalidateFocus();
}
-// --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
+// #i27301# - use new type definition for <_nStates>
void SwAccessibleContext::InvalidateStates( tAccessibleStates _nStates )
{
if( GetMap() )
@@ -1335,7 +1335,7 @@ void SwAccessibleContext::InvalidateStates( tAccessibleStates _nStates )
sal_Bool bIsOldEditableState;
sal_Bool bIsNewEditableState = IsEditable( pVSh );
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bIsOldEditableState = bIsEditableState;
bIsEditableState = bIsNewEditableState;
}
@@ -1349,7 +1349,7 @@ void SwAccessibleContext::InvalidateStates( tAccessibleStates _nStates )
sal_Bool bIsOldOpaqueState;
sal_Bool bIsNewOpaqueState = IsOpaque( pVSh );
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bIsOldOpaqueState = bIsOpaqueState;
bIsOpaqueState = bIsNewOpaqueState;
}
@@ -1373,12 +1373,7 @@ void SwAccessibleContext::InvalidateRelation( sal_uInt16 nType )
FireAccessibleEvent( aEvent );
}
-/** text selection has changed
-
- OD 2005-12-14 #i27301#
-
- @author OD
-*/
+/** #i27301# - text selection has changed */
void SwAccessibleContext::InvalidateTextSelection()
{
AccessibleEventObject aEvent;
@@ -1387,12 +1382,7 @@ void SwAccessibleContext::InvalidateTextSelection()
FireAccessibleEvent( aEvent );
}
-/** attributes has changed
-
- OD 2009-01-06 #i88069#
-
- @author OD
-*/
+/** #i88069# - attributes has changed */
void SwAccessibleContext::InvalidateAttr()
{
AccessibleEventObject aEvent;
@@ -1459,7 +1449,7 @@ OUString SwAccessibleContext::GetResource( sal_uInt16 nResId,
{
String sStr;
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sStr = SW_RES( nResId );
}
@@ -1501,12 +1491,7 @@ bool SwAccessibleContext::HasAdditionalAccessibleChildren()
return bRet;
}
-/** get additional accessible child by index
-
- OD 2010-01-27 #i88070#
-
- @author OD
-*/
+/** #i88070# - get additional accessible child by index */
Window* SwAccessibleContext::GetAdditionalAccessibleChild( const sal_Int32 nIndex )
{
Window* pAdditionalAccessibleChild( 0 );
@@ -1524,12 +1509,7 @@ Window* SwAccessibleContext::GetAdditionalAccessibleChild( const sal_Int32 nInde
return pAdditionalAccessibleChild;
}
-/** get all additional accessible children
-
- OD 2010-01-27 #i88070#
-
- @author OD
-*/
+/** #i88070# - get all additional accessible children */
void SwAccessibleContext::GetAdditionalAccessibleChildren( std::vector< Window* >* pChildren )
{
if ( GetFrm()->IsTxtFrm() )
@@ -1602,3 +1582,5 @@ void lcl_SwAccessibleContext_DbgMsg( SwAccessibleContext *pThisAcc,
aStrm.Flush();
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx
index 8bad4ab9074b..d9fd0e113d55 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ class SwAccessibleContext :
protected:
mutable ::osl::Mutex aListenerMutex;
- mutable ::vos::OMutex aMutex;
+ mutable ::osl::Mutex aMutex;
private:
@@ -95,11 +96,9 @@ private:
// Are we currently disposing that object (protected by solar mutex)?
sal_Bool bDisposing : 1;
- // --> OD 2008-03-10 #i85634#
- // boolean, indicating if the accessible context is in general registered at
- // the accessible map.
+ // #i85634# - boolean, indicating if the accessible context is
+ // in general registered at the accessible map.
bool bRegisteredAtAccessibleMap;
- // <--
void InitStates();
@@ -154,7 +153,7 @@ protected:
// Invalidate the states of all children of the specified SwFrm. The
// SwFrm might belong the the current object or to any child or grandchild!
- // --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
+ // #i27301# - use new type definition for <_nStates>
void InvalidateChildrenStates( const SwFrm* _pFrm,
tAccessibleStates _nStates );
// <--
@@ -197,13 +196,12 @@ protected:
getBoundsImpl(sal_Bool bRelative)
throw (::com::sun::star::uno::RuntimeException);
- // --> OD 2008-03-10 #i85634#
+ // #i85634#
inline void NotRegisteredAtAccessibleMap()
{
bRegisteredAtAccessibleMap = false;
}
void RemoveFrmFromAccessibleMap();
- // <--
virtual ~SwAccessibleContext();
@@ -364,48 +362,23 @@ public:
void InvalidateFocus();
// Check states
- // --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
+ // #i27301# - use new type definition for <_nStates>
void InvalidateStates( tAccessibleStates _nStates );
- // <--
// the XAccessibleRelationSet may have changed
void InvalidateRelation( sal_uInt16 nType );
- /** text selection has changed
-
- OD 2005-12-14 #i27301#
-
- @author OD
- */
- void InvalidateTextSelection();
-
- /** attributes has changed
-
- OD 2009-01-06 #i88069#
-
- @author OD
- */
- void InvalidateAttr();
+ void InvalidateTextSelection(); // #i27301# - text selection has changed
+ void InvalidateAttr(); // #i88069# - attributes has changed
bool HasAdditionalAccessibleChildren();
- /** get additional child by index
-
- OD 2010-01-27 #i88070#
-
- @author OD
- */
+ // #i88070# - get additional child by index
Window* GetAdditionalAccessibleChild( const sal_Int32 nIndex );
- /** get all additional accessible children
-
- OD 2010-01-27 #i88070#
-
- @author OD
- */
+ // #i88070# - get all additional accessible children
void GetAdditionalAccessibleChildren( std::vector< Window* >* pChildren );
-
const ::rtl::OUString& GetName() const { return sName; }
virtual sal_Bool HasCursor(); // required by map to remember that object
@@ -457,3 +430,4 @@ const sal_Char sMissingWindow[] = "window is missing";
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 4d9fb4d60e2e..7e13c561bc8b 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,15 +39,13 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <tools/link.hxx>
#include <sfx2/viewsh.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <viewsh.hxx>
#include <doc.hxx>
#include <accmap.hxx>
#include <accdoc.hxx>
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
#include <pagefrm.hxx>
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentView";
@@ -80,27 +79,25 @@ SwAccessibleDocumentBase::~SwAccessibleDocumentBase()
void SwAccessibleDocumentBase::SetVisArea()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwRect aOldVisArea( GetVisArea() );
const SwRect& rNewVisArea = GetMap()->GetVisArea();
if( aOldVisArea != rNewVisArea )
{
SwAccessibleFrame::SetVisArea( GetMap()->GetVisArea() );
- // --> OD 2007-12-07 #i58139#
- // showing state of document view needs also be updated.
+ // #i58139# - showing state of document view needs also be updated.
// Thus, call method <Scrolled(..)> instead of <ChildrenScrolled(..)>
// ChildrenScrolled( GetFrm(), aOldVisArea );
Scrolled( aOldVisArea );
- // <--
}
}
void SwAccessibleDocumentBase::AddChild( Window *pWin, sal_Bool bFireEvent )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- ASSERT( !mpChildWin, "only one child window is supported" );
+ OSL_ENSURE( !mpChildWin, "only one child window is supported" );
if( !mpChildWin )
{
mpChildWin = pWin;
@@ -117,9 +114,9 @@ void SwAccessibleDocumentBase::AddChild( Window *pWin, sal_Bool bFireEvent )
void SwAccessibleDocumentBase::RemoveChild( Window *pWin )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
- ASSERT( !mpChildWin || pWin == mpChildWin, "invalid child window to remove" );
+ OSL_ENSURE( !mpChildWin || pWin == mpChildWin, "invalid child window to remove" );
if( mpChildWin && pWin == mpChildWin )
{
AccessibleEventObject aEvent;
@@ -134,7 +131,7 @@ void SwAccessibleDocumentBase::RemoveChild( Window *pWin )
sal_Int32 SAL_CALL SwAccessibleDocumentBase::getAccessibleChildCount( void )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// CHECK_FOR_DEFUNC is called by parent
@@ -150,7 +147,7 @@ uno::Reference< XAccessible> SAL_CALL
throw (uno::RuntimeException,
lang::IndexOutOfBoundsException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( mpChildWin )
{
@@ -174,7 +171,7 @@ uno::Reference< XAccessible> SAL_CALL SwAccessibleDocumentBase::getAccessiblePar
sal_Int32 SAL_CALL SwAccessibleDocumentBase::getAccessibleIndexInParent (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference < XAccessibleContext > xAcc( mxParent->getAccessibleContext() );
uno::Reference < XAccessible > xThis( this );
@@ -197,7 +194,7 @@ OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleDescription (void)
awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Window *pWin = GetWindow();
@@ -214,7 +211,7 @@ awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds()
awt::Point SAL_CALL SwAccessibleDocumentBase::getLocation()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Window *pWin = GetWindow();
@@ -230,7 +227,7 @@ awt::Point SAL_CALL SwAccessibleDocumentBase::getLocation()
::com::sun::star::awt::Point SAL_CALL SwAccessibleDocumentBase::getLocationOnScreen()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Window *pWin = GetWindow();
@@ -246,7 +243,7 @@ awt::Point SAL_CALL SwAccessibleDocumentBase::getLocation()
::com::sun::star::awt::Size SAL_CALL SwAccessibleDocumentBase::getSize()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Window *pWin = GetWindow();
@@ -262,7 +259,7 @@ sal_Bool SAL_CALL SwAccessibleDocumentBase::containsPoint(
const awt::Point& aPoint )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Window *pWin = GetWindow();
@@ -279,7 +276,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleDocumentBase::getAccessibleAt
const awt::Point& aPoint )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( mpChildWin )
{
@@ -339,7 +336,7 @@ SwAccessibleDocument::~SwAccessibleDocument()
void SwAccessibleDocument::Dispose( sal_Bool bRecursive )
{
- ASSERT( GetFrm() && GetMap(), "already disposed" );
+ OSL_ENSURE( GetFrm() && GetMap(), "already disposed" );
Window *pWin = GetMap() ? GetMap()->GetShell()->GetWin() : 0;
if( pWin )
@@ -450,7 +447,7 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -505,7 +502,7 @@ uno::Reference<XAccessible> SwAccessibleDocument::getSelectedAccessibleChild(
return maSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
}
-// --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+// index has to be treated as global child index.
void SwAccessibleDocument::deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException,
@@ -513,3 +510,5 @@ void SwAccessibleDocument::deselectAccessibleChild(
{
maSelectionHelper.deselectAccessibleChild( nChildIndex );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx
index 3e2153876219..2a4e125b7fb4 100644
--- a/sw/source/core/access/accdoc.hxx
+++ b/sw/source/core/access/accdoc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,9 +27,7 @@
************************************************************************/
#ifndef _ACCDOC_HXX
#define _ACCDOC_HXX
-#ifndef _ACCCONTEXT_HXX
#include "acccontext.hxx"
-#endif
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <accselectionhelper.hxx>
@@ -197,7 +196,7 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
- // --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+ // index has to be treated as global child index.
virtual void SAL_CALL deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
@@ -211,3 +210,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index 33a32dc5c9ca..5ccbc03f3339 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -95,3 +96,5 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementation
}
return aId;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accembedded.hxx b/sw/source/core/access/accembedded.hxx
index cd7205293ed0..94f8e2d43c20 100644
--- a/sw/source/core/access/accembedded.hxx
+++ b/sw/source/core/access/accembedded.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 1fb553d58120..2efd6cf6d78f 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
@@ -41,9 +42,7 @@
#include <viewsh.hxx>
#include <accmap.hxx>
#include "accfootnote.hxx"
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -65,7 +64,7 @@ SwAccessibleFootnote::SwAccessibleFootnote(
bIsEndnote ? AccessibleRole::END_NOTE : AccessibleRole::FOOTNOTE,
pFtnFrm )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt16 nResId = bIsEndnote ? STR_ACCESS_ENDNOTE_NAME
: STR_ACCESS_FOOTNOTE_NAME;
@@ -80,7 +79,7 @@ SwAccessibleFootnote::~SwAccessibleFootnote()
OUString SAL_CALL SwAccessibleFootnote::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -139,7 +138,7 @@ Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
Sequence< sal_Int8 > SAL_CALL SwAccessibleFootnote::getImplementationId()
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -155,3 +154,5 @@ sal_Bool SwAccessibleFootnote::IsEndnote( const SwFtnFrm *pFtnFrm )
const SwTxtFtn *pTxtFtn = pFtnFrm ->GetAttr();
return pTxtFtn && pTxtFtn->GetFtn().IsEndNote() ;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfootnote.hxx b/sw/source/core/access/accfootnote.hxx
index 1c7330bc694d..521247685a16 100644
--- a/sw/source/core/access/accfootnote.hxx
+++ b/sw/source/core/access/accfootnote.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,3 +87,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx
index 043e40bb943b..c19c7cf8ef1d 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,7 +37,6 @@
#include <rootfrm.hxx>
#include <txtfrm.hxx>
#include <sectfrm.hxx>
-#include <pagefrm.hxx>
#include <section.hxx>
#include <viewsh.hxx>
#include <viewopt.hxx>
@@ -254,7 +254,7 @@ SwAccessibleChild SwAccessibleFrame::GetChildAtPixel( const SwRect& rVisArea,
aRet = GetChildAtPixel( rVisArea, *(rLower.GetSwFrm()), rPixPos,
bInPagePreview, rAccMap );
}
- aRIter++;
+ ++aRIter;
}
}
else
@@ -360,7 +360,7 @@ sal_Bool SwAccessibleFrame::IsEditable( ViewShell *pVSh ) const
if( !pFrm )
return sal_False;
- ASSERT( pVSh, "no view shell" );
+ OSL_ENSURE( pVSh, "no view shell" );
if( pVSh && (pVSh->GetViewOptions()->IsReadonly() ||
pVSh->IsPreView()) )
return sal_False;
@@ -377,7 +377,7 @@ sal_Bool SwAccessibleFrame::IsOpaque( ViewShell *pVSh ) const
if( !aFrm.GetSwFrm() )
return sal_False;
- ASSERT( pVSh, "no view shell" );
+ OSL_ENSURE( pVSh, "no view shell" );
if( !pVSh )
return sal_False;
@@ -396,10 +396,8 @@ sal_Bool SwAccessibleFrame::IsOpaque( ViewShell *pVSh ) const
rBack.GetGraphicPos() != GPOS_NONE )
return sal_True;
- /// OD 20.08.2002 #99657#
- /// If a fly frame has a transparent background color, we have
- /// to consider the background.
- /// But a background color "no fill"/"auto fill" has *not* to be considered.
+ // If a fly frame has a transparent background color, we have to consider the background.
+ // But a background color "no fill"/"auto fill" has *not* to be considered.
if( pFrm->IsFlyFrm() &&
(rBack.GetColor().GetTransparency() != 0) &&
(rBack.GetColor() != COL_TRANSPARENT)
@@ -495,3 +493,4 @@ sal_Bool SwAccessibleFrame::IsShowing( const SwAccessibleMap& rAccMap,
return IsShowing( rFrmOrObj.GetBox( rAccMap ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accframe.hxx b/sw/source/core/access/accframe.hxx
index 48da1bdbb9cb..7aa7e42f9e0c 100644
--- a/sw/source/core/access/accframe.hxx
+++ b/sw/source/core/access/accframe.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,8 +52,7 @@ class SwAccessibleFrame
const sal_Bool mbIsInPagePreview;
protected:
- // --> OD 2007-06-29 #i77106#
- // method needs to be called by new class <SwAccessibleTableColHeaders>
+ // #i77106# - method needs to be called by new class <SwAccessibleTableColHeaders>
static sal_Int32 GetChildCount( SwAccessibleMap& rAccMap,
const SwRect& rVisArea,
const SwFrm *pFrm,
@@ -173,3 +173,4 @@ inline const SwFrm *SwAccessibleFrame::GetParent() const
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index 221c7e1650a2..5ab12b068678 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <frmfmt.hxx>
@@ -89,8 +90,8 @@ void SwAccessibleFrameBase::GetStates(
if( IsSelected() )
{
rStateSet.AddState( AccessibleStateType::SELECTED );
- ASSERT( bIsSelected, "bSelected out of sync" );
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ OSL_ENSURE( bIsSelected, "bSelected out of sync" );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
Window *pWin = GetWindow();
@@ -136,7 +137,7 @@ SwAccessibleFrameBase::SwAccessibleFrameBase(
SwAccessibleContext( pInitMap, nInitRole, pFlyFrm ),
bIsSelected( sal_False )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
const_cast< SwFrmFmt * >( pFrmFmt )->Add( this );
@@ -152,7 +153,7 @@ void SwAccessibleFrameBase::_InvalidateCursorPos()
sal_Bool bOldSelected;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bOldSelected = bIsSelected;
bIsSelected = bNewSelected;
}
@@ -161,7 +162,7 @@ void SwAccessibleFrameBase::_InvalidateCursorPos()
{
// remember that object as the one that has the caret. This is
// neccessary to notify that object if the cursor leaves it.
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -195,10 +196,10 @@ void SwAccessibleFrameBase::_InvalidateFocus()
sal_Bool bSelected;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bSelected = bIsSelected;
}
- ASSERT( bSelected, "focus object should be selected" );
+ OSL_ENSURE( bSelected, "focus object should be selected" );
FireStateChangedEvent( AccessibleStateType::FOCUSED,
pWin->HasFocus() && bSelected );
@@ -207,7 +208,7 @@ void SwAccessibleFrameBase::_InvalidateFocus()
sal_Bool SwAccessibleFrameBase::HasCursor()
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
return bIsSelected;
}
@@ -226,16 +227,16 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
if( pFlyFrm )
{
const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
- ASSERT( pFrmFmt == GetRegisteredIn(), "invalid frame" );
+ OSL_ENSURE( pFrmFmt == GetRegisteredIn(), "invalid frame" );
OUString sOldName( GetName() );
- ASSERT( !pOld ||
+ OSL_ENSURE( !pOld ||
static_cast < SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ),
"invalid old name" );
const String& rNewName = pFrmFmt->GetName();
SetName( rNewName );
- ASSERT( !pNew ||
+ OSL_ENSURE( !pNew ||
static_cast < SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
"invalid new name" );
@@ -268,10 +269,12 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( GetRegisteredIn() )
pRegisteredIn->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index faa4bb492697..4f0b17d0898e 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 47b4007c1496..1e72847fbe3f 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,7 +98,7 @@ SwAccessibleChild::SwAccessibleChild( const SwFrm* pFrm,
{
Init( pWindow );
}
- ASSERT( (!pFrm || pFrm == mpFrm) &&
+ OSL_ENSURE( (!pFrm || pFrm == mpFrm) &&
(!pDrawObj || pDrawObj == mpDrawObj) &&
(!pWindow || pWindow == mpWindow),
"invalid frame/object/window combination" );
@@ -346,7 +347,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
{
// For FLY_AS_CHAR the parent is the anchor
pParent = pFly->GetAnchorFrm();
- ASSERT( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ),
+ OSL_ENSURE( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ),
"parent is not accessible" );
}
else
@@ -373,16 +374,16 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
{
const SwDrawContact *pContact =
static_cast< const SwDrawContact* >( GetUserCall( mpDrawObj ) );
- ASSERT( pContact, "sdr contact is missing" );
+ OSL_ENSURE( pContact, "sdr contact is missing" );
if( pContact )
{
const SwFrmFmt *pFrmFmt = pContact->GetFmt();
- ASSERT( pFrmFmt, "frame format is missing" );
+ OSL_ENSURE( pFrmFmt, "frame format is missing" );
if( pFrmFmt && FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() )
{
// For FLY_AS_CHAR the parent is the anchor
pParent = pContact->GetAnchorFrm();
- ASSERT( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ),
+ OSL_ENSURE( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ),
"parent is not accessible" );
}
@@ -426,3 +427,4 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
} } // eof of namespace sw::access
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobj.hxx b/sw/source/core/access/accfrmobj.hxx
index 76113c62eae3..8b196711277e 100644
--- a/sw/source/core/access/accfrmobj.hxx
+++ b/sw/source/core/access/accfrmobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,10 +74,7 @@ class SwAccessibleChild
SwRect GetBounds( const SwAccessibleMap& rAccMap ) const;
/** indicating, if accessible child is included even, if the corresponding
- object is not visible.
-
- @author OD
- */
+ object is not visible. */
bool AlwaysIncludeAsChild() const;
private:
@@ -93,3 +91,5 @@ class SwAccessibleChild
} } // eof of namespace sw::access
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobjmap.cxx b/sw/source/core/access/accfrmobjmap.cxx
index 11834ee89963..e7fd8644da77 100644
--- a/sw/source/core/access/accfrmobjmap.cxx
+++ b/sw/source/core/access/accfrmobjmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ SwAccessibleChildMap::SwAccessibleChildMap( const SwRect& rVisArea,
if ( rFrm.IsPageFrm() )
{
- ASSERT( bVisibleChildrenOnly, "page frame within tab frame???" );
+ OSL_ENSURE( bVisibleChildrenOnly, "page frame within tab frame???" );
const SwPageFrm *pPgFrm =
static_cast< const SwPageFrm * >( &rFrm );
const SwSortedObjs *pObjs = pPgFrm->GetSortedObjs();
@@ -105,11 +106,11 @@ SwAccessibleChildMap::SwAccessibleChildMap( const SwRect& rVisArea,
}
{
- ::vos::ORef < SwAccessibleContext > xAccImpl =
+ ::rtl::Reference < SwAccessibleContext > xAccImpl =
rAccMap.GetContextImpl( &rFrm, sal_False );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
- SwAccessibleContext* pAccImpl = xAccImpl.getBodyPtr();
+ SwAccessibleContext* pAccImpl = xAccImpl.get();
if ( pAccImpl &&
pAccImpl->HasAdditionalAccessibleChildren() )
{
@@ -166,3 +167,5 @@ SwAccessibleChildMap::SwAccessibleChildMap( const SwRect& rVisArea,
( rFrm.IsTxtFrm() &&
rFrm.GetDrawObjs() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobjmap.hxx b/sw/source/core/access/accfrmobjmap.hxx
index 91365ed9c258..441202e6acb9 100644
--- a/sw/source/core/access/accfrmobjmap.hxx
+++ b/sw/source/core/access/accfrmobjmap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobjslist.cxx b/sw/source/core/access/accfrmobjslist.cxx
index 2f3e8399187a..846e06a0435c 100644
--- a/sw/source/core/access/accfrmobjslist.cxx
+++ b/sw/source/core/access/accfrmobjslist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,11 +73,11 @@ SwAccessibleChildSList_const_iterator::SwAccessibleChildSList_const_iterator(
}
if ( !aCurr.IsValid() )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl =
+ ::rtl::Reference < SwAccessibleContext > xAccImpl =
rAccMap.GetContextImpl( &rFrm, sal_False );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
- SwAccessibleContext* pAccImpl = xAccImpl.getBodyPtr();
+ SwAccessibleContext* pAccImpl = xAccImpl.get();
aCurr = SwAccessibleChild( pAccImpl->GetAdditionalAccessibleChild( 0 ) );
++nNextObj;
}
@@ -138,11 +139,11 @@ SwAccessibleChildSList_const_iterator& SwAccessibleChildSList_const_iterator::ne
}
if ( !aCurr.IsValid() )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl =
+ ::rtl::Reference < SwAccessibleContext > xAccImpl =
rList.GetAccMap().GetContextImpl( &rFrm, sal_False );
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
- SwAccessibleContext* pAccImpl = xAccImpl.getBodyPtr();
+ SwAccessibleContext* pAccImpl = xAccImpl.get();
aCurr = SwAccessibleChild( pAccImpl->GetAdditionalAccessibleChild( nNextObj - nObjsCount ) );
++nNextObj;
}
@@ -171,3 +172,4 @@ SwAccessibleChildSList_const_iterator& SwAccessibleChildSList_const_iterator::op
return rList.IsVisibleChildrenOnly() ? next_visible() : next();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobjslist.hxx b/sw/source/core/access/accfrmobjslist.hxx
index f81cfc85a9d7..78052177fbac 100644
--- a/sw/source/core/access/accfrmobjslist.hxx
+++ b/sw/source/core/access/accfrmobjslist.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -143,3 +144,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index 40888f4b3738..4c389e2f85c1 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -85,7 +86,7 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -95,3 +96,5 @@ Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
}
return aId;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accgraphic.hxx b/sw/source/core/access/accgraphic.hxx
index aa64ee0df7e1..18c0f67b68dc 100644
--- a/sw/source/core/access/accgraphic.hxx
+++ b/sw/source/core/access/accgraphic.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index dada1083c810..6472f75e9fe5 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
@@ -37,9 +38,7 @@
#include <vcl/svapp.hxx>
#include <hffrm.hxx>
#include "accheaderfooter.hxx"
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -57,7 +56,7 @@ SwAccessibleHeaderFooter::SwAccessibleHeaderFooter(
const SwHeaderFrm* pHdFrm ) :
SwAccessibleContext( pInitMap, AccessibleRole::HEADER, pHdFrm )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sArg( OUString::valueOf( (sal_Int32)pHdFrm->GetPhyPageNum() ) );
SetName( GetResource( STR_ACCESS_HEADER_NAME, &sArg ) );
@@ -68,7 +67,7 @@ SwAccessibleHeaderFooter::SwAccessibleHeaderFooter(
const SwFooterFrm* pFtFrm ) :
SwAccessibleContext( pInitMap, AccessibleRole::FOOTER, pFtFrm )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sArg( OUString::valueOf( (sal_Int32)pFtFrm->GetPhyPageNum() ) );
SetName( GetResource( STR_ACCESS_FOOTER_NAME, &sArg ) );
@@ -81,7 +80,7 @@ SwAccessibleHeaderFooter::~SwAccessibleHeaderFooter()
OUString SAL_CALL SwAccessibleHeaderFooter::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -133,7 +132,7 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -143,3 +142,5 @@ Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
}
return aId;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accheaderfooter.hxx b/sw/source/core/access/accheaderfooter.hxx
index 8a0bbb84b6e5..210657e7602a 100644
--- a/sw/source/core/access/accheaderfooter.hxx
+++ b/sw/source/core/access/accheaderfooter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,9 +27,7 @@
************************************************************************/
#ifndef _ACCHEADERFOOTER_HXX
#define _ACCHEADERFOOTER_HXX
-#ifndef _ACCCONTEXT_HXX
#include "acccontext.hxx"
-#endif
class SwHeaderFrm;
class SwFooterFrm;
@@ -83,3 +82,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index 6d252488c792..6b239b04e0e2 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <comphelper/accessiblekeybindinghelper.hxx>
#include <swurl.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <ndtxt.hxx>
#include <txtinet.hxx>
@@ -52,7 +53,7 @@ SwAccessibleHyperlink::SwAccessibleHyperlink( sal_uInt16 nHPos,
const SwTxtAttr *SwAccessibleHyperlink::GetTxtAttr() const
{
const SwTxtAttr *pTxtAttr = 0;
- if( xPara.isValid() && xPara->GetMap() )
+ if( xPara.is() && xPara->GetMap() )
{
const SwTxtNode *pTxtNd = xPara->GetTxtNode();
const SwpHints *pHints = pTxtNd->GetpSwpHints();
@@ -78,7 +79,7 @@ sal_Int32 SAL_CALL SwAccessibleHyperlink::getAccessibleActionCount()
sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
@@ -93,7 +94,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
{
LoadURL( rINetFmt.GetValue(), pVSh, URLLOAD_NOFILTER,
&rINetFmt.GetTargetFrame() );
- ASSERT( pTxtAttr == rINetFmt.GetTxtINetFmt(),
+ OSL_ENSURE( pTxtAttr == rINetFmt.GetTxtINetFmt(),
"lost my txt attr" );
const SwTxtINetFmt* pTxtAttr2 = rINetFmt.GetTxtINetFmt();
if( pTxtAttr2 )
@@ -178,13 +179,14 @@ sal_Int32 SAL_CALL SwAccessibleHyperlink::getEndIndex()
sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- return xPara.isValid();
+ SolarMutexGuard aGuard;
+ return xPara.is();
}
void SwAccessibleHyperlink::Invalidate()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
xPara = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acchyperlink.hxx b/sw/source/core/access/acchyperlink.hxx
index ed81feb9deb3..ecbaff3ec383 100644
--- a/sw/source/core/access/acchyperlink.hxx
+++ b/sw/source/core/access/acchyperlink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,7 @@
#ifndef _ACCHYPERLINK_HXX
#define _ACCHYPERLINK_HXX
#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <cppuhelper/implbase1.hxx>
#include <fmtinfmt.hxx>
@@ -41,7 +42,7 @@ class SwAccessibleHyperlink :
friend class SwAccessibleParagraph;
friend class SwAccessibleHyperTextData;
sal_uInt16 nHintPos;
- ::vos::ORef< SwAccessibleParagraph > xPara;
+ ::rtl::Reference< SwAccessibleParagraph > xPara;
sal_Int32 nStartIdx;
sal_Int32 nEndIdx;
@@ -89,3 +90,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acchypertextdata.cxx b/sw/source/core/access/acchypertextdata.cxx
index 5a6193489255..2e233522aa64 100644
--- a/sw/source/core/access/acchypertextdata.cxx
+++ b/sw/source/core/access/acchypertextdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ SwAccessibleHyperTextData::~SwAccessibleHyperTextData()
++aIter;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acchypertextdata.hxx b/sw/source/core/access/acchypertextdata.hxx
index fde1809fef1b..d3d49e4e211b 100644
--- a/sw/source/core/access/acchypertextdata.hxx
+++ b/sw/source/core/access/acchypertextdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index df33bbeaf2fa..3ca75ead3523 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <vos/ref.hxx>
+#include <rtl/ref.hxx>
#include <cppuhelper/weakref.hxx>
#include <vcl/window.hxx>
#include <svx/svdmodel.hxx>
@@ -68,12 +69,9 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <cppuhelper/implbase1.hxx>
-// OD 15.01.2003 #103492#
#include <pagepreviewlayout.hxx>
-// --> OD 2005-12-13 #i27301#
#include <pam.hxx>
#include <ndtxt.hxx>
-// <--
#include <dflyobj.hxx>
#include <prevwpage.hxx>
@@ -97,12 +95,12 @@ class SwAccessibleContextMap_Impl: public _SwAccessibleContextMap_Impl
{
public:
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool mbLocked;
#endif
SwAccessibleContextMap_Impl()
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
: mbLocked( sal_False )
#endif
{}
@@ -157,10 +155,6 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
{
// do not broadcast notifications for writer fly frames, because there
// are no shapes that need to know about them.
- // OD 01.07.2003 #110554# - correct condition in order not to broadcast
- // notifications for writer fly frames.
- // OD 01.07.2003 #110554# - do not broadcast notifications for plane
- // <SdrObject>objects
const SdrHint *pSdrHint = PTR_CAST( SdrHint, &rHint );
if ( !pSdrHint ||
( pSdrHint->GetObject() &&
@@ -171,7 +165,7 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
return;
}
- ASSERT( mpDrawModel, "draw model listener is disposed" );
+ OSL_ENSURE( mpDrawModel, "draw model listener is disposed" );
if( !mpDrawModel )
return;
@@ -215,7 +209,7 @@ struct SwShapeFunc
}
};
typedef ::std::map < const SdrObject *, uno::WeakReference < XAccessible >, SwShapeFunc > _SwAccessibleShapeMap_Impl;
-typedef ::std::pair < const SdrObject *, ::vos::ORef < ::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl;
+typedef ::std::pair < const SdrObject *, ::rtl::Reference < ::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl;
class SwAccessibleShapeMap_Impl: public _SwAccessibleShapeMap_Impl
@@ -224,22 +218,20 @@ class SwAccessibleShapeMap_Impl: public _SwAccessibleShapeMap_Impl
public:
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool mbLocked;
#endif
SwAccessibleShapeMap_Impl( SwAccessibleMap *pMap )
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
: mbLocked( sal_False )
#endif
{
maInfo.SetSdrView( pMap->GetShell()->GetDrawView() );
maInfo.SetWindow( pMap->GetShell()->GetWin() );
maInfo.SetViewForwarder( pMap );
- // --> OD 2005-08-08 #i52858# - method name changed
uno::Reference < document::XEventBroadcaster > xModelBroadcaster =
new SwDrawModellListener_Impl(
pMap->GetShell()->getIDocumentDrawModelAccess()->GetOrCreateDrawModel() );
- // <--
maInfo.SetControllerBroadcaster( xModelBroadcaster );
}
@@ -304,7 +296,7 @@ SwAccessibleObjShape_Impl
}
++aIter;
}
- ASSERT( pSelShape == pShape, "copying shapes went wrong!" );
+ OSL_ENSURE( pSelShape == pShape, "copying shapes went wrong!" );
}
if( pSelStart )
@@ -333,9 +325,7 @@ private:
// the same as xAcc for any other
// event type
EventType meType; // The event type
- // --> OD 2005-12-12 #i27301# - use new type definition for <mnStates>
tAccessibleStates mnStates; // check states or update caret pos
- // <--
SwAccessibleEvent_Impl& operator==( const SwAccessibleEvent_Impl& );
@@ -355,7 +345,7 @@ public:
meType( eT ),
mnStates( 0 )
{
- ASSERT( SwAccessibleEvent_Impl::DISPOSE == meType,
+ OSL_ENSURE( SwAccessibleEvent_Impl::DISPOSE == meType,
"wrong event constructor, DISPOSE only" );
}
@@ -363,7 +353,7 @@ public:
: meType( eT ),
mnStates( 0 )
{
- ASSERT( SwAccessibleEvent_Impl::SHAPE_SELECTION == meType,
+ OSL_ENSURE( SwAccessibleEvent_Impl::SHAPE_SELECTION == meType,
"wrong event constructor, SHAPE_SELECTION only" );
}
@@ -377,12 +367,11 @@ public:
meType( eT ),
mnStates( 0 )
{
- ASSERT( SwAccessibleEvent_Impl::CHILD_POS_CHANGED == meType ||
+ OSL_ENSURE( SwAccessibleEvent_Impl::CHILD_POS_CHANGED == meType ||
SwAccessibleEvent_Impl::POS_CHANGED == meType,
"wrong event constructor, (CHILD_)POS_CHANGED only" );
}
- // --> OD 2005-12-12 #i27301# - use new type definition for parameter <_nStates>
SwAccessibleEvent_Impl( EventType eT,
SwAccessibleContext *pA,
const SwAccessibleChild& rFrmOrObj,
@@ -392,7 +381,7 @@ public:
meType( eT ),
mnStates( _nStates )
{
- ASSERT( SwAccessibleEvent_Impl::CARET_OR_STATES == meType,
+ OSL_ENSURE( SwAccessibleEvent_Impl::CARET_OR_STATES == meType,
"wrong event constructor, CARET_OR_STATES only" );
}
@@ -406,10 +395,10 @@ public:
return meType;
}
- inline ::vos::ORef < SwAccessibleContext > GetContext() const
+ inline ::rtl::Reference < SwAccessibleContext > GetContext() const
{
uno::Reference < XAccessible > xTmp( mxAcc );
- ::vos::ORef < SwAccessibleContext > xAccImpl(
+ ::rtl::Reference < SwAccessibleContext > xAccImpl(
static_cast<SwAccessibleContext*>( xTmp.get() ) );
return xAccImpl;
@@ -431,12 +420,10 @@ public:
}
// <SetStates(..)> only used in method <SwAccessibleMap::AppendEvent(..)>
- // --> OD 2005-12-12 #i27301# - use new type definition for parameter <_nStates>
inline void SetStates( tAccessibleStates _nStates )
{
mnStates |= _nStates;
}
- // <--
inline sal_Bool IsUpdateCursorPos() const
{
@@ -450,32 +437,26 @@ public:
{
return (mnStates & ACC_STATE_RELATION_MASK) != 0;
}
- // --> OD 2005-12-12 #i27301# - new event TEXT_SELECTION_CHANGED
inline sal_Bool IsInvalidateTextSelection() const
{
return ( mnStates & ACC_STATE_TEXT_SELECTION_CHANGED ) != 0;
}
- // <--
- // --> OD 2009-01-07 #i88069# - new event TEXT_ATTRIBUTE_CHANGED
+
inline sal_Bool IsInvalidateTextAttrs() const
{
return ( mnStates & ACC_STATE_TEXT_ATTRIBUTE_CHANGED ) != 0;
}
- // <--
- // --> OD 2005-12-12 #i27301# - use new type definition <tAccessibleStates>
- // for return value
+
inline tAccessibleStates GetStates() const
{
return mnStates & ACC_STATE_MASK;
}
- // <--
- // --> OD 2005-12-12 #i27301# - use new type definition <tAccessibleStates>
- // for return value
+
inline tAccessibleStates GetAllStates() const
{
return mnStates;
}
- // <--
+
};
//------------------------------------------------------------------------------
@@ -550,9 +531,7 @@ class SwAccessibleEventMap_Impl: public _SwAccessibleEventMap_Impl
};
//------------------------------------------------------------------------------
-// --> OD 2005-12-13 #i27301# - map containing the accessible paragraph, which
-// have a selection. Needed to keep this information to submit corresponding
-// TEXT_SELECTION_CHANGED events.
+
struct SwAccessibleParaSelection
{
xub_StrLen nStartOfSelection;
@@ -580,7 +559,6 @@ typedef ::std::map< uno::WeakReference < XAccessible >,
class SwAccessibleSelectedParas_Impl: public _SwAccessibleSelectedParas_Impl
{};
-// <--
// helper class that stores preview data
class SwAccPreviewData
@@ -596,10 +574,6 @@ class SwAccPreviewData
/** adjust logic page retangle to its visible part
- OD 17.01.2003 #103492#
-
- @author OD
-
@param _iorLogicPgSwRect
input/output parameter - reference to the logic page rectangle, which
has to be adjusted.
@@ -620,16 +594,12 @@ public:
SwAccPreviewData();
~SwAccPreviewData();
- // OD 14.01.2003 #103492# - complete re-factoring of method due to new
- // page/print preview functionality.
void Update( const SwAccessibleMap& rAccMap,
const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
const SwPageFrm* _pSelectedPageFrm,
const Size& _rPrevwWinSize );
- // OD 14.01.2003 #103492# - complete re-factoring of method due to new
- // page/print preview functionality.
void InvalidateSelection( const SwPageFrm* _pSelectedPageFrm );
const SwRect& GetVisArea() const;
@@ -640,7 +610,6 @@ public:
* proper position. rPoint identifies the page for which the
* MapMode should be adjusted. If bFromPreview is true, rPoint is
* a preview coordinate; else it's a document coordinate. */
- // OD 17.01.2003 #103492# - delete unused 3rd parameter.
void AdjustMapMode( MapMode& rMapMode,
const Point& rPoint ) const;
@@ -658,8 +627,6 @@ SwAccPreviewData::~SwAccPreviewData()
{
}
-// OD 13.01.2003 #103492# - complete re-factoring of method due to new page/print
-// preview functionality.
void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap,
const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
@@ -709,12 +676,10 @@ void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap,
}
}
-// OD 16.01.2003 #103492# - complete re-factoring of method due to new page/print
-// preview functionality.
void SwAccPreviewData::InvalidateSelection( const SwPageFrm* _pSelectedPageFrm )
{
mpSelPage = _pSelectedPageFrm;
- ASSERT( mpSelPage, "selected page not found" );
+ OSL_ENSURE( mpSelPage, "selected page not found" );
}
struct ContainsPredicate
@@ -761,12 +726,7 @@ void SwAccPreviewData::DisposePage(const SwPageFrm *pPageFrm )
mpSelPage = 0;
}
-/** adjust logic page retangle to its visible part
-
- OD 17.01.2003 #103492#
-
- @author OD
-*/
+// adjust logic page retangle to its visible part
void SwAccPreviewData::AdjustLogicPgRectToVisibleArea(
SwRect& _iorLogicPgSwRect,
const SwRect& _rPrevwPgSwRect,
@@ -830,20 +790,18 @@ static sal_Bool AreInSameTable( const uno::Reference< XAccessible >& rAcc,
void SwAccessibleMap::FireEvent( const SwAccessibleEvent_Impl& rEvent )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl( rEvent.GetContext() );
+ ::rtl::Reference < SwAccessibleContext > xAccImpl( rEvent.GetContext() );
if( SwAccessibleEvent_Impl::SHAPE_SELECTION == rEvent.GetType() )
{
DoInvalidateShapeSelection();
}
- else if( xAccImpl.isValid() && xAccImpl->GetFrm() )
+ else if( xAccImpl.is() && xAccImpl->GetFrm() )
{
- // --> OD 2009-01-07 #i88069#
if ( rEvent.GetType() != SwAccessibleEvent_Impl::DISPOSE &&
rEvent.IsInvalidateTextAttrs() )
{
xAccImpl->InvalidateAttr();
}
- // <--
switch( rEvent.GetType() )
{
case SwAccessibleEvent_Impl::INVALID_CONTENT:
@@ -857,14 +815,12 @@ void SwAccessibleMap::FireEvent( const SwAccessibleEvent_Impl& rEvent )
rEvent.GetOldBox() );
break;
case SwAccessibleEvent_Impl::DISPOSE:
- ASSERT( xAccImpl.isValid(),
+ OSL_ENSURE( xAccImpl.is(),
"dispose event has been stored" );
break;
- // --> OD 2009-01-06 #i88069#
case SwAccessibleEvent_Impl::INVALID_ATTR:
// nothing to do here - handled above
break;
- // <--
default:
break;
}
@@ -876,7 +832,6 @@ void SwAccessibleMap::FireEvent( const SwAccessibleEvent_Impl& rEvent )
xAccImpl->InvalidateStates( rEvent.GetStates() );
if( rEvent.IsInvalidateRelation() )
{
- // --> OD 2005-12-01 #i27138#
// both events CONTENT_FLOWS_FROM_RELATION_CHANGED and
// CONTENT_FLOWS_TO_RELATION_CHANGED are possible
if ( rEvent.GetAllStates() & ACC_STATE_RELATION_FROM )
@@ -889,21 +844,19 @@ void SwAccessibleMap::FireEvent( const SwAccessibleEvent_Impl& rEvent )
xAccImpl->InvalidateRelation(
AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED );
}
- // <--
}
- // --> OD 2005-12-12 #i27301# - submit event TEXT_SELECTION_CHANGED
+
if ( rEvent.IsInvalidateTextSelection() )
{
xAccImpl->InvalidateTextSelection();
}
- // <--
}
}
}
void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
{
- vos::OGuard aGuard( maEventMutex );
+ osl::MutexGuard aGuard( maEventMutex );
if( !mpEvents )
mpEvents = new SwAccessibleEventList_Impl;
@@ -914,7 +867,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
{
// While events are fired new ones are generated. They have to be fired
// now. This does not work for DISPOSE events!
- ASSERT( rEvent.GetType() != SwAccessibleEvent_Impl::DISPOSE,
+ OSL_ENSURE( rEvent.GetType() != SwAccessibleEvent_Impl::DISPOSE,
"dispose event while firing events" );
FireEvent( rEvent );
}
@@ -926,7 +879,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
if( aIter != mpEventMap->end() )
{
SwAccessibleEvent_Impl aEvent( *(*aIter).second );
- ASSERT( aEvent.GetType() != SwAccessibleEvent_Impl::DISPOSE,
+ OSL_ENSURE( aEvent.GetType() != SwAccessibleEvent_Impl::DISPOSE,
"dispose events should not be stored" );
sal_Bool bAppendEvent = sal_True;
switch( rEvent.GetType() )
@@ -935,7 +888,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
// A CARET_OR_STATES event is added to any other
// event only. It is broadcasted after any other event, so the
// event should be put to the back.
- ASSERT( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+ OSL_ENSURE( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
"invalid event combination" );
aEvent.SetStates( rEvent.GetAllStates() );
break;
@@ -945,7 +898,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
// POS_CHANGED event.
// Therefor, the event's type has to be adapted and the event
// has to be put at the end.
- ASSERT( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+ OSL_ENSURE( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
"invalid event combination" );
if( aEvent.GetType() == SwAccessibleEvent_Impl::CARET_OR_STATES )
aEvent.SetType( SwAccessibleEvent_Impl::INVALID_CONTENT );
@@ -955,7 +908,7 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
// flags) as well as INVALID_CONTENT. The old box position
// has to be stored however if the old event is not a
// POS_CHANGED itself.
- ASSERT( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+ OSL_ENSURE( aEvent.GetType() != SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
"invalid event combination" );
if( aEvent.GetType() != SwAccessibleEvent_Impl::POS_CHANGED )
aEvent.SetOldBox( rEvent.GetOldBox() );
@@ -966,11 +919,11 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
// events. The only action that needs to be done again is
// to put the old event to the back. The new one cannot be used,
// because we are interested in the old frame bounds.
- ASSERT( aEvent.GetType() == SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
+ OSL_ENSURE( aEvent.GetType() == SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
"invalid event combination" );
break;
case SwAccessibleEvent_Impl::SHAPE_SELECTION:
- ASSERT( aEvent.GetType() == SwAccessibleEvent_Impl::SHAPE_SELECTION,
+ OSL_ENSURE( aEvent.GetType() == SwAccessibleEvent_Impl::SHAPE_SELECTION,
"invalid event combination" );
break;
case SwAccessibleEvent_Impl::DISPOSE:
@@ -980,12 +933,10 @@ void SwAccessibleMap::AppendEvent( const SwAccessibleEvent_Impl& rEvent )
// remove all events for the frame in question.
bAppendEvent = sal_False;
break;
- // --> OD 2009-01-06 #i88069#
case SwAccessibleEvent_Impl::INVALID_ATTR:
- ASSERT( aEvent.GetType() == SwAccessibleEvent_Impl::INVALID_ATTR,
+ OSL_ENSURE( aEvent.GetType() == SwAccessibleEvent_Impl::INVALID_ATTR,
"invalid event combination" );
break;
- // <--
}
if( bAppendEvent )
{
@@ -1012,8 +963,8 @@ void SwAccessibleMap::InvalidateCursorPosition(
{
SwAccessibleContext *pAccImpl =
static_cast< SwAccessibleContext *>( rAcc.get() );
- ASSERT( pAccImpl, "no caret context" );
- ASSERT( pAccImpl->GetFrm(), "caret context is disposed" );
+ OSL_ENSURE( pAccImpl, "no caret context" );
+ OSL_ENSURE( pAccImpl->GetFrm(), "caret context is disposed" );
if( GetShell()->ActionPend() )
{
SwAccessibleEvent_Impl aEvent( SwAccessibleEvent_Impl::CARET_OR_STATES,
@@ -1061,7 +1012,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
sal_uInt16 nSelShapes = pFESh ? pFESh->IsObjSelected() : 0;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpShapeMap )
pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
}
@@ -1074,7 +1025,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
SwAccessibleObjShape_Impl *pShape = pShapes;
while( nShapes )
{
- if( pShape->second.isValid() )
+ if( pShape->second.is() )
{
sal_Bool bChanged;
if( pShape >= pSelShape )
@@ -1110,9 +1061,9 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
::std::list< const SwFrm * >::const_iterator aEndIter = aParents.end();
while( aIter != aEndIter )
{
- ::vos::ORef< SwAccessibleContext > xParentAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xParentAccImpl;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
SwAccessibleContextMap_Impl::const_iterator aMapIter =
@@ -1125,7 +1076,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection()
}
}
}
- if( xParentAccImpl.isValid() )
+ if( xParentAccImpl.is() )
{
AccessibleEventObject aEvent;
aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
@@ -1156,7 +1107,7 @@ void SwAccessibleMap::DoInvalidateShapeFocus()
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpShapeMap )
pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape );
}
@@ -1168,7 +1119,7 @@ void SwAccessibleMap::DoInvalidateShapeFocus()
SwAccessibleObjShape_Impl *pShape = pShapes;
while( nShapes )
{
- if( pShape->second.isValid() )
+ if( pShape->second.is() )
{
if( bFocused && pShape >= pSelShape )
pShape->second->SetState( AccessibleStateType::FOCUSED );
@@ -1191,9 +1142,7 @@ SwAccessibleMap::SwAccessibleMap( ViewShell *pSh ) :
mpShapes( 0 ),
mpEvents( 0 ),
mpEventMap( 0 ),
- // --> OD 2005-12-13 #i27301#
mpSelectedParas( 0 ),
- // <--
mpVSh( pSh ),
mpPreview( 0 ),
mnPara( 1 ),
@@ -1208,7 +1157,7 @@ SwAccessibleMap::~SwAccessibleMap()
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
const SwRootFrm *pRootFrm = GetShell()->GetLayout();
@@ -1225,9 +1174,9 @@ SwAccessibleMap::~SwAccessibleMap()
pAcc->Dispose( sal_True );
{
- vos::OGuard aGuard( maMutex );
-#ifdef DBG_UTIL
- ASSERT( !mpFrmMap || mpFrmMap->empty(),
+ osl::MutexGuard aGuard( maMutex );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !mpFrmMap || mpFrmMap->empty(),
"Frame map should be empty after disposing the root frame" );
if( mpFrmMap )
{
@@ -1244,7 +1193,7 @@ SwAccessibleMap::~SwAccessibleMap()
++aIter;
}
}
- ASSERT( !mpShapeMap || mpShapeMap->empty(),
+ OSL_ENSURE( !mpShapeMap || mpShapeMap->empty(),
"Object map should be empty after disposing the root frame" );
if( mpShapeMap )
{
@@ -1268,19 +1217,17 @@ SwAccessibleMap::~SwAccessibleMap()
mpShapeMap = 0;
delete mpShapes;
mpShapes = 0;
- // --> OD 2005-12-13 #i27301#
delete mpSelectedParas;
mpSelectedParas = 0;
- // <--
}
delete mpPreview;
mpPreview = NULL;
{
- vos::OGuard aGuard( maEventMutex );
-#ifdef DBG_UTIL
- ASSERT( !(mpEvents || mpEventMap), "pending events" );
+ osl::MutexGuard aGuard( maEventMutex );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !(mpEvents || mpEventMap), "pending events" );
if( mpEvents )
{
SwAccessibleEventList_Impl::iterator aIter = mpEvents->begin();
@@ -1313,18 +1260,18 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView(
sal_Bool bSetVisArea = sal_False;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( !mpFrmMap )
{
mpFrmMap = new SwAccessibleContextMap_Impl;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mpFrmMap->mbLocked = sal_False;
#endif
}
-#ifdef DBG_UTIL
- ASSERT( !mpFrmMap->mbLocked, "Map is locked" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !mpFrmMap->mbLocked, "Map is locked" );
mpFrmMap->mbLocked = sal_True;
#endif
@@ -1355,7 +1302,7 @@ uno::Reference< XAccessible > SwAccessibleMap::_GetDocumentView(
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mpFrmMap->mbLocked = sal_False;
#endif
}
@@ -1375,8 +1322,6 @@ uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView( )
return _GetDocumentView( sal_False );
}
-// OD 14.01.2003 #103492# - complete re-factoring of method due to new page/print
-// preview functionality.
uno::Reference<XAccessible> SwAccessibleMap::GetDocumentPreview(
const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
@@ -1400,7 +1345,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
sal_Bool bOldShapeSelected = sal_False;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( !mpFrmMap && bCreate )
mpFrmMap = new SwAccessibleContextMap_Impl;
@@ -1473,7 +1418,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
}
xAcc = pAcc;
- ASSERT( xAcc.is(), "unknown frame type" );
+ OSL_ENSURE( xAcc.is(), "unknown frame type" );
if( xAcc.is() )
{
if( aIter != mpFrmMap->end() )
@@ -1523,13 +1468,13 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
return xAcc;
}
-::vos::ORef < SwAccessibleContext > SwAccessibleMap::GetContextImpl(
+::rtl::Reference < SwAccessibleContext > SwAccessibleMap::GetContextImpl(
const SwFrm *pFrm,
sal_Bool bCreate )
{
uno::Reference < XAccessible > xAcc( GetContext( pFrm, bCreate ) );
- ::vos::ORef < SwAccessibleContext > xAccImpl(
+ ::rtl::Reference < SwAccessibleContext > xAccImpl(
static_cast< SwAccessibleContext * >( xAcc.get() ) );
return xAccImpl;
@@ -1544,7 +1489,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
uno::Reference < XAccessible > xOldCursorAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( !mpShapeMap && bCreate )
mpShapeMap = new SwAccessibleShapeMap_Impl( this );
@@ -1574,7 +1519,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
}
xAcc = pAcc;
- ASSERT( xAcc.is(), "unknown shape type" );
+ OSL_ENSURE( xAcc.is(), "unknown shape type" );
if( xAcc.is() )
{
pAcc->Init();
@@ -1601,14 +1546,14 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
return xAcc;
}
-::vos::ORef < ::accessibility::AccessibleShape > SwAccessibleMap::GetContextImpl(
+::rtl::Reference < ::accessibility::AccessibleShape > SwAccessibleMap::GetContextImpl(
const SdrObject *pObj,
SwAccessibleContext *pParentImpl,
sal_Bool bCreate )
{
uno::Reference < XAccessible > xAcc( GetContext( pObj, pParentImpl, bCreate ) );
- ::vos::ORef < ::accessibility::AccessibleShape > xAccImpl(
+ ::rtl::Reference < ::accessibility::AccessibleShape > xAccImpl(
static_cast< ::accessibility::AccessibleShape* >( xAcc.get() ) );
return xAccImpl;
@@ -1617,7 +1562,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
void SwAccessibleMap::RemoveContext( const SwFrm *pFrm )
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -1635,7 +1580,7 @@ void SwAccessibleMap::RemoveContext( const SwFrm *pFrm )
{
SwAccessibleContext *pOldAccImpl =
static_cast< SwAccessibleContext *>( xOldAcc.get() );
- ASSERT( pOldAccImpl->GetFrm(), "old caret context is disposed" );
+ OSL_ENSURE( pOldAccImpl->GetFrm(), "old caret context is disposed" );
if( pOldAccImpl->GetFrm() == pFrm )
{
xOldAcc.clear(); // get an empty ref
@@ -1654,7 +1599,7 @@ void SwAccessibleMap::RemoveContext( const SwFrm *pFrm )
void SwAccessibleMap::RemoveContext( const SdrObject *pObj )
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpShapeMap )
{
@@ -1689,17 +1634,17 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
// because that's the one that is evaluated in the layout. The frame
// might not be accessible anyway. That's the case for cell frames that
// contain further cells.
- ASSERT( !aFrmOrObj.GetSwFrm() || aFrmOrObj.GetSwFrm()->IsAccessibleFrm(),
+ OSL_ENSURE( !aFrmOrObj.GetSwFrm() || aFrmOrObj.GetSwFrm()->IsAccessibleFrm(),
"non accessible frame should be disposed" );
if( aFrmOrObj.IsAccessible( GetShell()->IsPreView() ) )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl;
- ::vos::ORef< SwAccessibleContext > xParentAccImpl;
- ::vos::ORef< ::accessibility::AccessibleShape > xShapeAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xParentAccImpl;
+ ::rtl::Reference< ::accessibility::AccessibleShape > xShapeAccImpl;
// get accessible context for frame
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
// First of all look for an accessible context for a frame
if( aFrmOrObj.GetSwFrm() && mpFrmMap )
@@ -1713,7 +1658,7 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
static_cast< SwAccessibleContext *>( xAcc.get() );
}
}
- if( !xAccImpl.isValid() && mpFrmMap )
+ if( !xAccImpl.is() && mpFrmMap )
{
// If there is none, look if the parent is accessible.
const SwFrm *pParent =
@@ -1732,7 +1677,7 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
}
}
}
- if( !xParentAccImpl.isValid() && !aFrmOrObj.GetSwFrm() &&
+ if( !xParentAccImpl.is() && !aFrmOrObj.GetSwFrm() &&
mpShapeMap )
{
SwAccessibleShapeMap_Impl::iterator aIter =
@@ -1745,7 +1690,7 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
}
}
if( pObj && GetShell()->ActionPend() &&
- (xParentAccImpl.isValid() || xShapeAccImpl.isValid()) )
+ (xParentAccImpl.is() || xShapeAccImpl.is()) )
{
// Keep a reference to the XShape to avoid that it
// is deleted with a SwFrmFmt::Modify.
@@ -1763,7 +1708,7 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
// remove events stored for the frame
{
- vos::OGuard aGuard( maEventMutex );
+ osl::MutexGuard aGuard( maEventMutex );
if( mpEvents )
{
SwAccessibleEventMap_Impl::iterator aIter =
@@ -1781,11 +1726,11 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
// the frame. If the frame is no context for it but disposing should
// take place recursive, the frame's children have to be disposed
// anyway, so we have to create the context then.
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
xAccImpl->Dispose( bRecursive );
}
- else if( xParentAccImpl.isValid() )
+ else if( xParentAccImpl.is() )
{
// If the frame is a cell frame, the table must be notified.
// If we are in an action, a table model change event will
@@ -1794,7 +1739,7 @@ void SwAccessibleMap::Dispose( const SwFrm *pFrm,
xParentAccImpl->DisposeChild( aFrmOrObj, bRecursive );
}
- else if( xShapeAccImpl.isValid() )
+ else if( xShapeAccImpl.is() )
{
RemoveContext( aFrmOrObj.GetDrawObject() );
xShapeAccImpl->dispose();
@@ -1813,10 +1758,10 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
SwAccessibleChild aFrmOrObj( pFrm, pObj, pWindow );
if( aFrmOrObj.IsAccessible( GetShell()->IsPreView() ) )
{
- ::vos::ORef< SwAccessibleContext > xAccImpl;
- ::vos::ORef< SwAccessibleContext > xParentAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xAccImpl;
+ ::rtl::Reference< SwAccessibleContext > xParentAccImpl;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -1833,7 +1778,7 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
static_cast< SwAccessibleContext *>( xAcc.get() );
}
}
- if( !xAccImpl.isValid() )
+ if( !xAccImpl.is() )
{
// Otherwise we look if the parent is accessible.
// If not, there is nothing to do.
@@ -1856,12 +1801,12 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
}
}
- if( xAccImpl.isValid() )
+ if( xAccImpl.is() )
{
if( GetShell()->ActionPend() )
{
SwAccessibleEvent_Impl aEvent(
- SwAccessibleEvent_Impl::POS_CHANGED, xAccImpl.getBodyPtr(),
+ SwAccessibleEvent_Impl::POS_CHANGED, xAccImpl.get(),
aFrmOrObj, rOldBox );
AppendEvent( aEvent );
}
@@ -1871,13 +1816,13 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrm *pFrm,
xAccImpl->InvalidatePosOrSize( rOldBox );
}
}
- else if( xParentAccImpl.isValid() )
+ else if( xParentAccImpl.is() )
{
if( GetShell()->ActionPend() )
{
SwAccessibleEvent_Impl aEvent(
SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
- xParentAccImpl.getBodyPtr(), aFrmOrObj, rOldBox );
+ xParentAccImpl.get(), aFrmOrObj, rOldBox );
AppendEvent( aEvent );
}
else
@@ -1897,7 +1842,7 @@ void SwAccessibleMap::InvalidateContent( const SwFrm *pFrm )
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -1928,7 +1873,6 @@ void SwAccessibleMap::InvalidateContent( const SwFrm *pFrm )
}
}
-// --> OD 2009-01-06 #i88069#
void SwAccessibleMap::InvalidateAttr( const SwTxtFrm& rTxtFrm )
{
SwAccessibleChild aFrmOrObj( &rTxtFrm );
@@ -1936,7 +1880,7 @@ void SwAccessibleMap::InvalidateAttr( const SwTxtFrm& rTxtFrm )
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -1966,7 +1910,6 @@ void SwAccessibleMap::InvalidateAttr( const SwTxtFrm& rTxtFrm )
}
}
}
-// <--
void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
{
@@ -1983,16 +1926,15 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
}
else if( pVSh->ISA( SwFEShell ) )
{
- sal_uInt16 nObjCount;
const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
const SwFrm *pFlyFrm = pFESh->GetCurrFlyFrm();
if( pFlyFrm )
{
- ASSERT( !pFrm || pFrm->FindFlyFrm() == pFlyFrm,
+ OSL_ENSURE( !pFrm || pFrm->FindFlyFrm() == pFlyFrm,
"cursor is not contained in fly frame" );
aFrmOrObj = pFlyFrm;
}
- else if( (nObjCount = pFESh->IsObjSelected()) > 0 )
+ else if( pFESh->IsObjSelected() > 0 )
{
bShapeSelected = sal_True;
aFrmOrObj = static_cast<const SwFrm *>( 0 );
@@ -2000,7 +1942,7 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
}
}
- ASSERT( bShapeSelected || aFrmOrObj.IsAccessible(GetShell()->IsPreView()),
+ OSL_ENSURE( bShapeSelected || aFrmOrObj.IsAccessible(GetShell()->IsPreView()),
"frame is not accessible" );
uno::Reference < XAccessible > xOldAcc;
@@ -2008,7 +1950,7 @@ void SwAccessibleMap::InvalidateCursorPosition( const SwFrm *pFrm )
sal_Bool bOldShapeSelected = sal_False;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
xOldAcc = mxCursorContext;
mxCursorContext = xAcc; // clear reference
@@ -2065,7 +2007,7 @@ void SwAccessibleMap::InvalidateFocus()
uno::Reference < XAccessible > xAcc;
sal_Bool bShapeSelected;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
xAcc = mxCursorContext;
bShapeSelected = mbShapeSelected;
@@ -2084,14 +2026,13 @@ void SwAccessibleMap::InvalidateFocus()
}
void SwAccessibleMap::SetCursorContext(
- const ::vos::ORef < SwAccessibleContext >& rCursorContext )
+ const ::rtl::Reference < SwAccessibleContext >& rCursorContext )
{
- vos::OGuard aGuard( maMutex );
- uno::Reference < XAccessible > xAcc( rCursorContext.getBodyPtr() );
+ osl::MutexGuard aGuard( maMutex );
+ uno::Reference < XAccessible > xAcc( rCursorContext.get() );
mxCursorContext = xAcc;
}
-// --> OD 2005-12-12 #i27301# - use new type definition for <_nStates>
void SwAccessibleMap::InvalidateStates( tAccessibleStates _nStates,
const SwFrm* _pFrm )
{
@@ -2120,7 +2061,6 @@ void SwAccessibleMap::InvalidateStates( tAccessibleStates _nStates,
pAccImpl->InvalidateStates( _nStates );
}
}
-// <--
void SwAccessibleMap::_InvalidateRelationSet( const SwFrm* pFrm,
sal_Bool bFrom )
@@ -2131,7 +2071,7 @@ void SwAccessibleMap::_InvalidateRelationSet( const SwFrm* pFrm,
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -2176,24 +2116,14 @@ void SwAccessibleMap::InvalidateRelationSet( const SwFrm* pMaster,
_InvalidateRelationSet( pFollow, sal_True );
}
-/** invalidation CONTENT_FLOW_FROM/_TO relation of a paragraph
-
- OD 2005-12-01 #i27138#
-
- @author OD
-*/
+// invalidation of CONTENT_FLOW_FROM/_TO relation of a paragraph
void SwAccessibleMap::InvalidateParaFlowRelation( const SwTxtFrm& _rTxtFrm,
const bool _bFrom )
{
_InvalidateRelationSet( &_rTxtFrm, _bFrom );
}
-/** invalidation of text selection of a paragraph
-
- OD 2005-12-12 #i27301#
-
- @author OD
-*/
+// invalidation of text selection of a paragraph
void SwAccessibleMap::InvalidateParaTextSelection( const SwTxtFrm& _rTxtFrm )
{
// first, see if this frame is accessible, and if so, get the respective
@@ -2202,7 +2132,7 @@ void SwAccessibleMap::InvalidateParaTextSelection( const SwTxtFrm& _rTxtFrm )
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -2248,7 +2178,7 @@ sal_Int32 SwAccessibleMap::GetChildIndex( const SwFrm& rParentFrm,
{
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpFrmMap )
{
@@ -2274,9 +2204,6 @@ sal_Int32 SwAccessibleMap::GetChildIndex( const SwFrm& rParentFrm,
return nIndex;
}
-
-// OD 15.01.2003 #103492# - complete re-factoring of method due to new page/print
-// preview functionality.
void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
const SwPageFrm* _pSelectedPageFrm,
@@ -2285,20 +2212,19 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages
DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
DBG_ASSERT( mpPreview != NULL, "no preview data?" );
- // OD 15.01.2003 #103492# - adjustments for changed method signature
mpPreview->Update( *this, _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize );
// propagate change of VisArea through the document's
// accessibility tree; this will also send appropriate scroll
// events
SwAccessibleContext* pDoc =
- GetContextImpl( GetShell()->GetLayout() ).getBodyPtr();
+ GetContextImpl( GetShell()->GetLayout() ).get();
static_cast<SwAccessibleDocumentBase*>( pDoc )->SetVisArea();
uno::Reference < XAccessible > xOldAcc;
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
xOldAcc = mxCursorContext;
@@ -2323,13 +2249,12 @@ void SwAccessibleMap::InvalidatePreViewSelection( sal_uInt16 nSelPage )
DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
DBG_ASSERT( mpPreview != NULL, "no preview data?" );
- // OD 16.01.2003 #103492# - changed metthod call due to method signature change.
mpPreview->InvalidateSelection( GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
uno::Reference < XAccessible > xOldAcc;
uno::Reference < XAccessible > xAcc;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
xOldAcc = mxCursorContext;
@@ -2359,7 +2284,7 @@ sal_Bool SwAccessibleMap::IsPageSelected( const SwPageFrm *pPageFrm ) const
void SwAccessibleMap::FireEvents()
{
{
- vos::OGuard aGuard( maEventMutex );
+ osl::MutexGuard aGuard( maEventMutex );
if( mpEvents )
{
mpEvents->SetFiring();
@@ -2378,7 +2303,7 @@ void SwAccessibleMap::FireEvents()
}
}
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpShapes )
{
delete mpShapes;
@@ -2413,7 +2338,6 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
Window *pWin = GetShell()->GetWin();
if( pWin )
{
- // OD 16.01.2003 #103492# - get mapping mode for LogicToPixel conversion
MapMode aMapMode;
GetMapMode( aPoint, aMapMode );
aPoint = pWin->LogicToPixel( aPoint, aMapMode );
@@ -2430,7 +2354,6 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) const
Size aSize( OutputDevice::LogicToLogic( rSize, aSrc, aDest ) );
if( GetShell()->GetWin() )
{
- // OD 16.01.2003 #103492# - get mapping mode for LogicToPixel conversion
MapMode aMapMode;
GetMapMode( Point(0,0), aMapMode );
aSize = GetShell()->GetWin()->LogicToPixel( aSize, aMapMode );
@@ -2446,7 +2369,6 @@ Point SwAccessibleMap::PixelToLogic( const Point& rPoint ) const
if( pWin )
{
aPoint = pWin->ScreenToOutputPixel( rPoint );
- // OD 16.01.2003 #103492# - get mapping mode for PixelToLogic conversion
MapMode aMapMode;
GetMapMode( aPoint, aMapMode );
aPoint = pWin->PixelToLogic( aPoint, aMapMode );
@@ -2463,7 +2385,6 @@ Size SwAccessibleMap::PixelToLogic( const Size& rSize ) const
Size aSize;
if( GetShell()->GetWin() )
{
- // OD 16.01.2003 #103492# - get mapping mode for PixelToLogic conversion
MapMode aMapMode;
GetMapMode( Point(0,0), aMapMode );
aSize = GetShell()->GetWin()->PixelToLogic( rSize, aMapMode );
@@ -2484,7 +2405,7 @@ sal_Bool SwAccessibleMap::ReplaceChild (
{
const SdrObject *pObj = 0;
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( mpShapeMap )
{
SwAccessibleShapeMap_Impl::const_iterator aIter = mpShapeMap->begin();
@@ -2514,7 +2435,7 @@ sal_Bool SwAccessibleMap::ReplaceChild (
Dispose( 0, pObj, 0 );
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
if( !mpShapeMap )
mpShapeMap = new SwAccessibleShapeMap_Impl( this );
@@ -2558,7 +2479,6 @@ Point SwAccessibleMap::PixelToCore( const Point& rPoint ) const
Point aPoint;
if( GetShell()->GetWin() )
{
- // OD 15.01.2003 #103492# - replace <PreviewAdjust(..)> by <GetMapMode(..)>
MapMode aMapMode;
GetMapMode( rPoint, aMapMode );
aPoint = GetShell()->GetWin()->PixelToLogic( rPoint, aMapMode );
@@ -2604,7 +2524,6 @@ Rectangle SwAccessibleMap::CoreToPixel( const Rectangle& rRect ) const
Rectangle aRect;
if( GetShell()->GetWin() )
{
- // OD 15.01.2003 #103492# - replace <PreviewAdjust(..)> by <GetMapMode(..)>
MapMode aMapMode;
GetMapMode( rRect.TopLeft(), aMapMode );
aRect = GetShell()->GetWin()->LogicToPixel( rRect, aMapMode );
@@ -2618,15 +2537,11 @@ Rectangle SwAccessibleMap::CoreToPixel( const Rectangle& rRect ) const
/** get mapping mode for LogicToPixel and PixelToLogic conversions
- OD 15.01.2003 #103492#
- Replacement method <PreviewAdjust(..)> by new method <GetMapMode>.
Method returns mapping mode of current output device and adjusts it,
if the shell is in page/print preview.
Necessary, because <PreviewAdjust(..)> changes mapping mode at current
output device for mapping logic document positions to page preview window
positions and vice versa and doesn't take care to recover its changes.
-
- @author OD
*/
void SwAccessibleMap::GetMapMode( const Point& _rPoint,
MapMode& _orMapMode ) const
@@ -2641,12 +2556,6 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
_orMapMode = aMapMode;
}
-/** get size of a dedicated preview page
-
- OD 15.01.2003 #103492#
-
- @author OD
-*/
Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPrevwPageNum ) const
{
DBG_ASSERT( mpVSh->IsPreView(), "no page preview accessible." );
@@ -2664,11 +2573,7 @@ Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPrevwPageNum ) const
/** method to build up a new data structure of the accessible pararaphs,
which have a selection
-
- OD 2005-12-13 #i27301#
Important note: method has to used inside a mutual exclusive section
-
- @author OD
*/
SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
{
@@ -2727,7 +2632,7 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
pFrm;
pFrm = (SwFrm*)aIter.Next() )
{
- ASSERT( dynamic_cast<SwTxtFrm*>(pFrm),
+ OSL_ENSURE( dynamic_cast<SwTxtFrm*>(pFrm),
"<SwAccessibleMap::_BuildSelectedParas()> - unexpected frame type" );
SwTxtFrm* pTxtFrm( dynamic_cast<SwTxtFrm*>(pFrm) );
if ( pTxtFrm )
@@ -2767,15 +2672,9 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
return pRetSelectedParas;
}
-/** invalidation of text selection of all paragraphs
-
- OD 2005-12-13 #i27301#
-
- @author OD
-*/
void SwAccessibleMap::InvalidateTextSelectionOfAllParas()
{
- vos::OGuard aGuard( maMutex );
+ osl::MutexGuard aGuard( maMutex );
// keep previously known selected paragraphs
SwAccessibleSelectedParas_Impl* pPrevSelectedParas( mpSelectedParas );
@@ -2828,13 +2727,13 @@ void SwAccessibleMap::InvalidateTextSelectionOfAllParas()
uno::Reference < XAccessible > xAcc( (*aIter).first );
if ( xAcc.is() )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl(
+ ::rtl::Reference < SwAccessibleContext > xAccImpl(
static_cast<SwAccessibleContext*>( xAcc.get() ) );
- if ( xAccImpl.isValid() && xAccImpl->GetFrm() )
+ if ( xAccImpl.is() && xAccImpl->GetFrm() )
{
const SwTxtFrm* pTxtFrm(
dynamic_cast<const SwTxtFrm*>(xAccImpl->GetFrm()) );
- ASSERT( pTxtFrm,
+ OSL_ENSURE( pTxtFrm,
"<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexcepted type of frame" );
if ( pTxtFrm )
{
@@ -2856,13 +2755,13 @@ void SwAccessibleMap::InvalidateTextSelectionOfAllParas()
uno::Reference < XAccessible > xAcc( (*aIter).first );
if ( xAcc.is() )
{
- ::vos::ORef < SwAccessibleContext > xAccImpl(
+ ::rtl::Reference < SwAccessibleContext > xAccImpl(
static_cast<SwAccessibleContext*>( xAcc.get() ) );
- if ( xAccImpl.isValid() && xAccImpl->GetFrm() )
+ if ( xAccImpl.is() && xAccImpl->GetFrm() )
{
const SwTxtFrm* pTxtFrm(
dynamic_cast<const SwTxtFrm*>(xAccImpl->GetFrm()) );
- ASSERT( pTxtFrm,
+ OSL_ENSURE( pTxtFrm,
"<SwAccessibleMap::_SubmitTextSelectionChangedEvents()> - unexcepted type of frame" );
if ( pTxtFrm )
{
@@ -2886,3 +2785,4 @@ const SwRect& SwAccessibleMap::GetVisArea() const
: GetShell()->VisArea();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index fea47cb212e5..86910db5aa07 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -39,9 +40,7 @@
#include <ndnotxt.hxx>
#include <flyfrm.hxx>
#include <cntfrm.hxx>
-// --> OD 2009-07-14 #i73249#
-#include <hints.hxx>
-// <--
+#include <hints.hxx> //#i73249#
#include "accnotextframe.hxx"
using namespace ::com::sun::star;
@@ -72,7 +71,7 @@ SwAccessibleNoTextFrame::SwAccessibleNoTextFrame(
msDesc()
{
const SwNoTxtNode* pNd = GetNoTxtNode();
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
// consider new attributes Title and Description
if( pNd )
{
@@ -95,7 +94,7 @@ SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame()
void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
// suppress handling of RES_NAME_CHANGED in case that attribute Title is
// used as the accessible name.
if ( nWhich != RES_NAME_CHANGED ||
@@ -105,10 +104,10 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
const SwNoTxtNode *pNd = GetNoTxtNode();
- ASSERT( pNd == aDepend.GetRegisteredIn(), "invalid frame" );
+ OSL_ENSURE( pNd == aDepend.GetRegisteredIn(), "invalid frame" );
switch( nWhich )
{
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
@@ -157,26 +156,12 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
break;
- // <--
- /*
- case RES_OBJECTDYING:
- if( aDepend.GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) )
- const_cast < SwModify *>( aDepend.GetRegisteredIn()->Remove( aDepend );
- break;
-
- case RES_FMT_CHG:
- if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
- static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
- pRegisteredIn->Remove( this );
- break;
- */
}
}
void SwAccessibleNoTextFrame::Dispose( sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( aDepend.GetRegisteredIn() )
const_cast < SwModify *>( aDepend.GetRegisteredIn() )->Remove( &aDepend );
@@ -184,11 +169,11 @@ void SwAccessibleNoTextFrame::Dispose( sal_Bool bRecursive )
SwAccessibleFrameBase::Dispose( bRecursive );
}
-// --> OD 2009-07-14 #i73249#
+// #i73249#
OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -204,7 +189,7 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName (void)
OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -273,3 +258,5 @@ sal_Int32 SAL_CALL SwAccessibleNoTextFrame::getAccessibleImageWidth( )
{
return getSize().Width;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index 6e070c6dd864..f5e3e536d11a 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@ class SwAccessibleNoTextFrame : public SwAccessibleFrameBase,
public ::com::sun::star::accessibility::XAccessibleImage
{
SwDepend aDepend;
- // --> OD 2009-07-14 #i73249#
- ::rtl::OUString msTitle;
- // <--
+ ::rtl::OUString msTitle; // #i73249#
::rtl::OUString msDesc;
protected:
@@ -57,8 +56,7 @@ public:
//===== XAccessibleContext ==============================================
- // --> OD 2009-07-14 #i73249#
- /// Return the object's current name.
+ // #i73249# - Return the object's current name.
virtual ::rtl::OUString SAL_CALL
getAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException);
@@ -108,3 +106,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index d5feca2e0ba9..2b5886e026d2 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include "accpage.hxx"
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
#include <pagefrm.hxx>
using namespace ::com::sun::star;
@@ -70,8 +69,8 @@ void SwAccessiblePage::GetStates(
// FOCUSED
if( IsSelected() )
{
- ASSERT( bIsSelected, "bSelected out of sync" );
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ OSL_ENSURE( bIsSelected, "bSelected out of sync" );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
Window *pWin = GetWindow();
@@ -86,7 +85,7 @@ void SwAccessiblePage::_InvalidateCursorPos()
sal_Bool bOldSelected;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bOldSelected = bIsSelected;
bIsSelected = bNewSelected;
}
@@ -95,7 +94,7 @@ void SwAccessiblePage::_InvalidateCursorPos()
{
// remember that object as the one that has the caret. This is
// neccessary to notify that object if the cursor leaves it.
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -115,10 +114,10 @@ void SwAccessiblePage::_InvalidateFocus()
sal_Bool bSelected;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bSelected = bIsSelected;
}
- ASSERT( bSelected, "focus object should be selected" );
+ OSL_ENSURE( bSelected, "focus object should be selected" );
FireStateChangedEvent( AccessibleStateType::FOCUSED,
pWin->HasFocus() && bSelected );
@@ -134,7 +133,7 @@ SwAccessiblePage::SwAccessiblePage( SwAccessibleMap* pInitMap,
DBG_ASSERT( pInitMap != NULL, "need map" );
DBG_ASSERT( pFrame->IsPageFrm(), "need page frame" );
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sPage = OUString::valueOf(
static_cast<sal_Int32>(
@@ -148,7 +147,7 @@ SwAccessiblePage::~SwAccessiblePage()
sal_Bool SwAccessiblePage::HasCursor()
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
return bIsSelected;
}
@@ -179,7 +178,7 @@ Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -198,3 +197,5 @@ OUString SwAccessiblePage::getAccessibleDescription( )
OUString sArg( GetFormattedPageNumber() );
return GetResource( STR_ACCESS_PAGE_DESC, &sArg );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpage.hxx b/sw/source/core/access/accpage.hxx
index f8972060ecb3..ebb96cf8948f 100644
--- a/sw/source/core/access/accpage.hxx
+++ b/sw/source/core/access/accpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef _ACCPAGE_HXX
#define _ACCPAGE_HXX
-#ifndef _ACCCONTEXT_HXX
#include "acccontext.hxx"
-#endif
/**
@@ -97,3 +96,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 1a1d7312de02..87a59379fb38 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@
#include <accmap.hxx>
#include <fesh.hxx>
#include <viewopt.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <rtl/ustrbuf.hxx>
@@ -61,7 +62,6 @@
#include <unotools/charclass.hxx> // for GetWordBoundary
// for get/setCharacterAttribute(...)
#include <unocrsr.hxx>
-//#include <unoobj.hxx>
#include <unoport.hxx>
#include <doc.hxx>
#include <crsskip.hxx>
@@ -78,13 +78,11 @@
#include <viewimp.hxx>
#include <boost/scoped_ptr.hpp>
#include <textmarkuphelper.hxx>
-// --> OD 2010-02-22 #i10825#
+// #i10825#
#include <parachangetrackinginfo.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
// <--
-// --> OD 2010-03-08 #i92233#
-#include <comphelper/stlunosequence.hxx>
-// <--
+#include <comphelper/stlunosequence.hxx> // #i92233#
#include <algorithm>
@@ -128,9 +126,7 @@ const SwTxtNode* SwAccessibleParagraph::GetTxtNode() const
::rtl::OUString SwAccessibleParagraph::GetDescription()
{
- // --> OD 2004-09-29 #117933# - provide empty description for paragraphs
- return ::rtl::OUString();
- // <--
+ return ::rtl::OUString(); // provide empty description for paragraphs
}
sal_Int32 SwAccessibleParagraph::GetCaretPos()
@@ -138,9 +134,9 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
sal_Int32 nRet = -1;
// get the selection's point, and test whether it's in our node
- // --> OD 2005-12-20 #i27301# - consider adjusted method signature
+ // #i27301# - consider adjusted method signature
SwPaM* pCaret = GetCursor( false ); // caret is first PaM in PaM-ring
- // <--
+
if( pCaret != NULL )
{
const SwTxtNode* pNode = GetTxtNode();
@@ -155,7 +151,6 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
if( GetPortionData().IsValidCorePosition( nIndex ) )
{
// Yes, it's us!
- // --> OD 2006-10-19 #70538#
// consider that cursor/caret is in front of the list label
if ( pCaret->IsInFrontOfLabel() )
{
@@ -165,7 +160,6 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
{
nRet = GetPortionData().GetAccessiblePosition( nIndex );
}
- // <--
DBG_ASSERT( nRet >= 0, "invalid cursor?" );
DBG_ASSERT( nRet <= GetPortionData().GetAccessibleString().
@@ -188,9 +182,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
nEnd = -1;
// get the selection, and test whether it affects our text node
- // --> OD 2005-12-20 #i27301# - consider adjusted method signature
- SwPaM* pCrsr = GetCursor( true );
- // <--
+ SwPaM* pCrsr = GetCursor( true ); // #i27301# - consider adjusted method signature
if( pCrsr != NULL )
{
// get SwPosition for my node
@@ -309,16 +301,15 @@ sal_Bool SwAccessibleParagraph::GetSelection(
return bRet;
}
-// --> OD 2005-12-20 #i27301# - new parameter <_bForSelection>
+// #i27301# - new parameter <_bForSelection>
SwPaM* SwAccessibleParagraph::GetCursor( const bool _bForSelection )
{
// get the cursor shell; if we don't have any, we don't have a
// cursor/selection either
SwPaM* pCrsr = NULL;
SwCrsrShell* pCrsrShell = SwAccessibleParagraph::GetCrsrShell();
- // --> OD 2005-12-20 #i27301#
- // - if cursor is retrieved for selection, the cursors for a table selection
- // has to be returned.
+ // #i27301# - if cursor is retrieved for selection, the cursors for
+ // a table selection has to be returned.
if ( pCrsrShell != NULL &&
( _bForSelection || !pCrsrShell->IsTableMode() ) )
// <--
@@ -360,9 +351,7 @@ void SwAccessibleParagraph::GetStates(
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
// FOCUSED (simulates node index of cursor)
- // --> OD 2005-12-20 #i27301# - consider adjusted method signature
- SwPaM* pCaret = GetCursor( false );
- // <--
+ SwPaM* pCaret = GetCursor( false ); // #i27301# - consider adjusted method signature
const SwTxtNode* pTxtNd = GetTxtNode();
if( pCaret != 0 && pTxtNd != 0 &&
pTxtNd->GetIndex() == pCaret->GetPoint()->nNode.GetIndex() &&
@@ -371,7 +360,7 @@ void SwAccessibleParagraph::GetStates(
Window *pWin = GetWindow();
if( pWin && pWin->HasFocus() )
rStateSet.AddState( AccessibleStateType::FOCUSED );
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
}
@@ -405,7 +394,7 @@ void SwAccessibleParagraph::_InvalidateContent( sal_Bool bVisibleDataFired )
sal_Bool bNewIsHeading = IsHeading();
sal_Bool bOldIsHeading;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
bOldIsHeading = bIsHeading;
if( bIsHeading != bNewIsHeading )
bIsHeading = bNewIsHeading;
@@ -417,7 +406,7 @@ void SwAccessibleParagraph::_InvalidateContent( sal_Bool bVisibleDataFired )
::rtl::OUString sNewDesc( GetDescription() );
::rtl::OUString sOldDesc;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
sOldDesc = sDesc;
if( sDesc != sNewDesc )
sDesc = sNewDesc;
@@ -442,7 +431,7 @@ void SwAccessibleParagraph::_InvalidateCursorPos()
sal_Int32 nNew = GetCaretPos();
sal_Int32 nOld;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
nOld = nOldCaretPos;
nOldCaretPos = nNew;
}
@@ -450,7 +439,7 @@ void SwAccessibleParagraph::_InvalidateCursorPos()
{
// remember that object as the one that has the caret. This is
// neccessary to notify that object if the cursor leaves it.
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -481,10 +470,10 @@ void SwAccessibleParagraph::_InvalidateFocus()
{
sal_Int32 nPos;
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
nPos = nOldCaretPos;
}
- ASSERT( nPos != -1, "focus object should be selected" );
+ OSL_ENSURE( nPos != -1, "focus object should be selected" );
FireStateChangedEvent( AccessibleStateType::FOCUSED,
pWin->HasFocus() && nPos != -1 );
@@ -494,9 +483,7 @@ void SwAccessibleParagraph::_InvalidateFocus()
SwAccessibleParagraph::SwAccessibleParagraph(
SwAccessibleMap& rInitMap,
const SwTxtFrm& rTxtFrm )
- // --> OD 2010-02-24 #i108125#
- : SwClient( const_cast<SwTxtNode*>(rTxtFrm.GetTxtNode()) )
- // <--
+ : SwClient( const_cast<SwTxtNode*>(rTxtFrm.GetTxtNode()) ) // #i108125#
, SwAccessibleContext( &rInitMap, AccessibleRole::PARAGRAPH, &rTxtFrm )
, sDesc()
, pPortionData( NULL )
@@ -504,16 +491,12 @@ SwAccessibleParagraph::SwAccessibleParagraph(
, nOldCaretPos( -1 )
, bIsHeading( sal_False )
, aSelectionHelper( *this )
- // --> OD 2010-02-19 #i108125#
- , mpParaChangeTrackInfo( new SwParaChangeTrackingInfo( rTxtFrm ) )
- // <--
+ , mpParaChangeTrackInfo( new SwParaChangeTrackingInfo( rTxtFrm ) ) // #i108125#
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
bIsHeading = IsHeading();
- // --> OD 2004-09-27 #117970# - set an empty accessibility name for paragraphs
- SetName( ::rtl::OUString() );
- // <--
+ SetName( ::rtl::OUString() ); // set an empty accessibility name for paragraphs
// If this object has the focus, then it is remembered by the map itself.
nOldCaretPos = GetCaretPos();
@@ -521,18 +504,16 @@ SwAccessibleParagraph::SwAccessibleParagraph(
SwAccessibleParagraph::~SwAccessibleParagraph()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
delete pPortionData;
delete pHyperTextData;
- // --> OD 2010-02-22 #i108125#
- delete mpParaChangeTrackInfo;
- // <--
+ delete mpParaChangeTrackInfo; // #i108125#
}
sal_Bool SwAccessibleParagraph::HasCursor()
{
- vos::OGuard aGuard( aMutex );
+ osl::MutexGuard aGuard( aMutex );
return nOldCaretPos != -1;
}
@@ -834,11 +815,11 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary(
::rtl::OUString SAL_CALL SwAccessibleParagraph::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext );
- vos::OGuard aGuard2( aMutex );
+ osl::MutexGuard aGuard2( aMutex );
if( !sDesc.getLength() )
sDesc = GetDescription();
@@ -848,7 +829,7 @@ sal_Bool SwAccessibleParagraph::GetTextBoundary(
lang::Locale SAL_CALL SwAccessibleParagraph::getLocale (void)
throw (IllegalAccessibleComponentStateException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtFrm *pTxtFrm = PTR_CAST( SwTxtFrm, GetFrm() );
if( !pTxtFrm )
@@ -862,22 +843,17 @@ lang::Locale SAL_CALL SwAccessibleParagraph::getLocale (void)
return aLoc;
}
-/** paragraphs are in relation CONTENT_FLOWS_FROM and/or CONTENT_FLOWS_TO
-
- OD 2005-12-02 #i27138#
-
- @author OD
-*/
+/** #i27138# - paragraphs are in relation CONTENT_FLOWS_FROM and/or CONTENT_FLOWS_TO */
uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccessibleRelationSet()
throw ( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext );
utl::AccessibleRelationSetHelper* pHelper = new utl::AccessibleRelationSetHelper();
const SwTxtFrm* pTxtFrm = dynamic_cast<const SwTxtFrm*>(GetFrm());
- ASSERT( pTxtFrm,
+ OSL_ENSURE( pTxtFrm,
"<SwAccessibleParagraph::getAccessibleRelationSet()> - missing text frame");
if ( pTxtFrm )
{
@@ -908,15 +884,13 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleParagraph::getAccess
void SAL_CALL SwAccessibleParagraph::grabFocus()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext );
// get cursor shell
SwCrsrShell *pCrsrSh = GetCrsrShell();
- // --> OD 2005-12-20 #i27301# - consider new method signature
- SwPaM *pCrsr = GetCursor( false );
- // <--
+ SwPaM *pCrsr = GetCursor( false ); // #i27301# - consider new method signature
const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
const SwTxtNode* pTxtNd = pTxtFrm->GetTxtNode();
@@ -945,7 +919,7 @@ void SAL_CALL SwAccessibleParagraph::grabFocus()
/* <-#i13955# */
}
-// --> OD 2007-01-17 #i71385#
+// #i71385#
bool lcl_GetBackgroundColor( Color & rColor,
const SwFrm* pFrm,
SwCrsrShell* pCrsrSh )
@@ -1064,7 +1038,7 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType )
uno::Reference<XAccessibleHypertext> aAccHyp = this;
aRet <<= aAccHyp;
}
- // --> OD 2006-07-13 #i63870#
+ // #i63870#
// add interface com::sun:star:accessibility::XAccessibleTextAttributes
else if ( rType == ::getCppuType((uno::Reference<XAccessibleTextAttributes> *)0) )
{
@@ -1072,7 +1046,7 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType )
aRet <<= aAccTextAttr;
}
// <--
- // --> OD 2008-06-10 #i89175#
+ // #i89175#
// add interface com::sun:star:accessibility::XAccessibleTextMarkup
else if ( rType == ::getCppuType((uno::Reference<XAccessibleTextMarkup> *)0) )
{
@@ -1100,10 +1074,9 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleParagraph::getTypes() throw(uno:
uno::Sequence< uno::Type > aTypes( SwAccessibleContext::getTypes() );
sal_Int32 nIndex = aTypes.getLength();
- // --> OD 2006-07-13 #i63870#
- // add type accessibility::XAccessibleTextAttributes
- // --> OD 2008-06-10 #i89175#
- // add type accessibility::XAccessibleTextMarkup and accessibility::XAccessibleMultiLineText
+ // #i63870# - add type accessibility::XAccessibleTextAttributes
+ // #i89175# - add type accessibility::XAccessibleTextMarkup and
+ // accessibility::XAccessibleMultiLineText
aTypes.realloc( nIndex + 6 );
uno::Type* pTypes = aTypes.getArray();
@@ -1121,7 +1094,7 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleParagraph::getTypes() throw(uno:
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -1140,19 +1113,19 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId()
sal_Int32 SwAccessibleParagraph::getCaretPosition()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
sal_Int32 nRet = GetCaretPos();
{
- vos::OGuard aOldCaretPosGuard( aMutex );
- ASSERT( nRet == nOldCaretPos, "caret pos out of sync" );
+ osl::MutexGuard aOldCaretPosGuard( aMutex );
+ OSL_ENSURE( nRet == nOldCaretPos, "caret pos out of sync" );
nOldCaretPos = nRet;
}
if( -1 != nRet )
{
- ::vos::ORef < SwAccessibleContext > xThis( this );
+ ::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -1162,7 +1135,7 @@ sal_Int32 SwAccessibleParagraph::getCaretPosition()
sal_Bool SAL_CALL SwAccessibleParagraph::setCaretPosition( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1195,7 +1168,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::setCaretPosition( sal_Int32 nIndex )
sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1210,16 +1183,15 @@ sal_Unicode SwAccessibleParagraph::getCharacter( sal_Int32 nIndex )
throw lang::IndexOutOfBoundsException();
}
-// --> OD 2006-07-20 #i63870#
-// re-implement method on behalf of methods <_getDefaultAttributesImpl(..)> and
-// <_getRunAttributesImpl(..)>
+// #i63870# - re-implement method on behalf of methods
+// <_getDefaultAttributesImpl(..)> and <_getRunAttributesImpl(..)>
uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
sal_Int32 nIndex,
const uno::Sequence< ::rtl::OUString >& aRequestedAttributes )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
const ::rtl::OUString& rText = GetString();
@@ -1256,41 +1228,10 @@ uno::Sequence<PropertyValue> SwAccessibleParagraph::getCharacterAttributes(
++i;
}
-// // create a (dummy) text portion for the sole purpose of calling
-// // getPropertyValues on it
-// Reference<XMultiPropertySet> xPortion = CreateUnoPortion( nIndex, nIndex + 1 );
-
-// // get values
-// Sequence<OUString> aNames = getAttributeNames();
-// sal_Int32 nLength = aNames.getLength();
-// Sequence<Any> aAnys( nLength );
-// aAnys = xPortion->getPropertyValues( aNames );
-
-// // copy names + anys into return sequence
-// Sequence<PropertyValue> aValues( aNames.getLength() );
-// const OUString* pNames = aNames.getConstArray();
-// const Any* pAnys = aAnys.getConstArray();
-// PropertyValue* pValues = aValues.getArray();
-// for( sal_Int32 i = 0; i < nLength; i++ )
-// {
-// PropertyValue& rValue = pValues[i];
-// rValue.Name = pNames[i];
-// rValue.Value = pAnys[i];
-// rValue.Handle = -1; // handle not supported
-// rValue.State = PropertyState_DIRECT_VALUE; // states not supported
-// }
-
-// // adjust background color if we're in a gray portion
-// DBG_ASSERT( pValues[CHAR_BACK_COLOR_POS].Name.
-// equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CharBackColor")),
-// "Please adjust CHAR_BACK_COLOR_POS constant." );
-// if( GetPortionData().IsInGrayPortion( nIndex ) )
-// pValues[CHAR_BACK_COLOR_POS].Value <<= SwViewOption::GetFieldShadingsColor().GetColor();
-
return aValues;
}
-// --> OD 2006-07-11 #i63870#
+// #i63870#
void SwAccessibleParagraph::_getDefaultAttributesImpl(
const uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
tAccParaPropValMap& rDefAttrSeq,
@@ -1313,9 +1254,8 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
0 ) );
}
- // --> OD 2007-11-12 #i82637#
- // From the perspective of the a11y API the default character attributes
- // are the character attributes, which are set at the paragraph style
+ // #i82637# - From the perspective of the a11y API the default character
+ // attributes are the character attributes, which are set at the paragraph style
// of the paragraph. The character attributes set at the automatic paragraph
// style of the paragraph are treated as run attributes.
// pTxtNode->SwCntntNode::GetAttr( *pSet );
@@ -1330,7 +1270,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
pSet->Put( aParaSet );
}
// get default character attributes and merge these into <pSet>
- ASSERT( pTxtNode->GetTxtColl(),
+ OSL_ENSURE( pTxtNode->GetTxtColl(),
"<SwAccessibleParagraph::_getDefaultAttributesImpl(..)> - missing paragraph style. Serious defect, please inform OD!" );
if ( pTxtNode->GetTxtColl() )
{
@@ -1368,7 +1308,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
++aPropIt;
}
- // --> OD 2007-01-15 #i72800#
+ // #i72800#
// add property value entry for the paragraph style
if ( !bOnlyCharAttrs && pTxtNode->GetTxtColl() )
{
@@ -1389,7 +1329,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
}
// <--
- // --> OD 2007-01-15 #i73371#
+ // #i73371#
// resolve value text::WritingMode2::PAGE of property value entry WritingMode
if ( !bOnlyCharAttrs && GetFrm() )
{
@@ -1464,14 +1404,14 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getDefaultAttributes(
const uno::Sequence< ::rtl::OUString >& aRequestedAttributes )
throw ( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
tAccParaPropValMap aDefAttrSeq;
_getDefaultAttributesImpl( aRequestedAttributes, aDefAttrSeq );
- // --> OD 2010-03-08 #i92233#
- static rtl::OUString sMMToPixelRatio( rtl::OUString::createFromAscii( "MMToPixelRatio" ) );
+ // #i92233#
+ static rtl::OUString sMMToPixelRatio(RTL_CONSTASCII_USTRINGPARAM("MMToPixelRatio"));
bool bProvideMMToPixelRatio( false );
{
if ( aRequestedAttributes.getLength() == 0 )
@@ -1504,7 +1444,7 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getDefaultAttributes(
++i;
}
- // --> OD 2010-03-08 #i92233#
+ // #i92233#
if ( bProvideMMToPixelRatio )
{
PropertyValue rPropVal;
@@ -1546,7 +1486,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
SfxItemSet aSet( pPaM->GetDoc()->GetAttrPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END -1,
0 );
- // --> OD 2007-11-12 #i82637#
+ // #i82637#
// 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.
@@ -1577,11 +1517,9 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
{
tAccParaPropValMap aRunAttrSeq;
{
- // --> OD 2007-11-12 #i82637#
tAccParaPropValMap aDefAttrSeq;
uno::Sequence< ::rtl::OUString > aDummy;
- _getDefaultAttributesImpl( aDummy, aDefAttrSeq, true );
- // <--
+ _getDefaultAttributesImpl( aDummy, aDefAttrSeq, true ); // #i82637#
const SfxItemPropertyMap* pPropMap =
aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap();
@@ -1590,8 +1528,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
while ( aPropIt != aPropertyEntries.end() )
{
const SfxPoolItem* pItem( 0 );
- // --> OD 2007-11-12 #i82637#
- // Found character attributes, whose value equals the value of
+ // #i82637# - Found character attributes, whose value equals the value of
// the corresponding default character attributes, are excluded.
if ( aSet.GetItemState( aPropIt->nWID, sal_True, &pItem ) == SFX_ITEM_SET )
{
@@ -1645,7 +1582,7 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getRunAttributes(
throw ( lang::IndexOutOfBoundsException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
{
@@ -1678,7 +1615,7 @@ awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1741,7 +1678,7 @@ awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
sal_Int32 SwAccessibleParagraph::getCharacterCount()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1751,7 +1688,7 @@ sal_Int32 SwAccessibleParagraph::getCharacterCount()
sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1828,7 +1765,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
::rtl::OUString SwAccessibleParagraph::getSelectedText()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1842,7 +1779,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
sal_Int32 SwAccessibleParagraph::getSelectionStart()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1854,7 +1791,7 @@ sal_Int32 SwAccessibleParagraph::getSelectionStart()
sal_Int32 SwAccessibleParagraph::getSelectionEnd()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1866,7 +1803,7 @@ sal_Int32 SwAccessibleParagraph::getSelectionEnd()
sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1902,7 +1839,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
::rtl::OUString SwAccessibleParagraph::getText()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1913,7 +1850,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
sal_Int32 nStartIndex, sal_Int32 nEndIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1930,7 +1867,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
/*accessibility::*/TextSegment SwAccessibleParagraph::getTextAtIndex( sal_Int32 nIndex, sal_Int16 nTextType ) throw (lang::IndexOutOfBoundsException, lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -1966,7 +1903,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
/*accessibility::*/TextSegment SwAccessibleParagraph::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 nTextType ) throw (lang::IndexOutOfBoundsException, lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -2010,7 +1947,7 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
/*accessibility::*/TextSegment SwAccessibleParagraph::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 nTextType ) throw (lang::IndexOutOfBoundsException, lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
@@ -2052,7 +1989,7 @@ sal_Bool SwAccessibleParagraph::copyText( sal_Int32 nStartIndex, sal_Int32 nEndI
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
CHECK_FOR_DEFUNC_THIS( XAccessibleText, *this );
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// select and copy (through dispatch mechanism)
setSelection( nStartIndex, nEndIndex );
@@ -2069,7 +2006,7 @@ sal_Bool SwAccessibleParagraph::cutText( sal_Int32 nStartIndex, sal_Int32 nEndIn
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
CHECK_FOR_DEFUNC( XAccessibleEditableText );
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( !IsEditableState() )
return sal_False;
@@ -2084,7 +2021,7 @@ sal_Bool SwAccessibleParagraph::pasteText( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
CHECK_FOR_DEFUNC( XAccessibleEditableText );
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( !IsEditableState() )
return sal_False;
@@ -2112,7 +2049,7 @@ sal_Bool SwAccessibleParagraph::replaceText(
const ::rtl::OUString& sReplacement )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleEditableText );
@@ -2174,7 +2111,7 @@ sal_Bool SwAccessibleParagraph::setAttributes(
const uno::Sequence<PropertyValue>& rAttributeSet )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleEditableText );
const ::rtl::OUString& rText = GetString();
@@ -2219,7 +2156,7 @@ sal_Bool SwAccessibleParagraph::setAttributes(
{
xPortion->setPropertyValues( aNames, aValues );
}
- catch( UnknownPropertyException e )
+ catch( UnknownPropertyException &e )
{
// error handling through return code!
bRet = sal_False;
@@ -2290,7 +2227,7 @@ uno::Reference<XAccessible> SwAccessibleParagraph::getSelectedAccessibleChild(
return aSelectionHelper.getSelectedAccessibleChild(nSelectedChildIndex);
}
-// --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+// index has to be treated as global child index.
void SwAccessibleParagraph::deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException,
@@ -2357,12 +2294,12 @@ const SwTxtAttr *SwHyperlinkIter_Impl::next()
sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkCount()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleHypertext );
sal_Int32 nCount = 0;
- // --> OD 2007-06-27 #i77108# - provide hyperlinks also in editable documents.
+ // #i77108# - provide hyperlinks also in editable documents.
// if( !IsEditableState() )
// <--
{
@@ -2379,14 +2316,12 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
SwAccessibleParagraph::getHyperLink( sal_Int32 nLinkIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleHypertext );
uno::Reference< XAccessibleHyperlink > xRet;
- // --> OD 2007-06-27 #i77108# - provide hyperlinks also in editable documents.
-// if( !IsEditableState() )
- // <--
+ // #i77108#
{
const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwHyperlinkIter_Impl aHIter( pTxtFrm );
@@ -2434,7 +2369,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharIndex )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleHypertext );
// parameter checking
@@ -2445,9 +2380,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharInde
}
sal_Int32 nRet = -1;
- // --> OD 2007-06-27 #i77108# - provide hyperlinks also in editable documents.
-// if( !IsEditableState() )
- // <--
+ // #i77108#
{
const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwHyperlinkIter_Impl aHIter( pTxtFrm );
@@ -2469,8 +2402,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharInde
return nRet;
}
-// --> OD 2008-05-26 #i71360#
-// --> OD 2010-02-22 #i108125# - adjustments for change tracking text markup
+// #i71360#, #i108125# - adjustments for change tracking text markup
sal_Int32 SAL_CALL SwAccessibleParagraph::getTextMarkupCount( sal_Int32 nTextMarkupType )
throw (lang::IllegalArgumentException,
uno::RuntimeException)
@@ -2560,7 +2492,7 @@ uno::Sequence< /*accessibility::*/TextSegment > SAL_CALL
}
// <--
-// --> OD 2008-05-29 #i89175#
+// #i89175#
sal_Int32 SAL_CALL SwAccessibleParagraph::getLineNumberAtIndex( sal_Int32 nIndex )
throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
@@ -2668,11 +2600,12 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getNumberOfLineWithCaret()
return nLineNo;
}
-// --> OD 2010-02-19 #i108125#
+// #i108125#
void SwAccessibleParagraph::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
mpParaChangeTrackInfo->reset();
SwClient::Modify( pOld, pNew );
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 3d3f0bed687f..062af1aa8940 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,11 +35,9 @@
#include <com/sun/star/accessibility/XAccessibleTextMarkup.hpp>
#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <accselectionhelper.hxx>
-// --> OD 2010-02-19 #i108125#
-#include <calbck.hxx>
-// <--
+#include <calbck.hxx> // #i108125#
class SwTxtFrm;
class SwTxtNode;
@@ -46,9 +45,7 @@ class SwPaM;
class SwAccessiblePortionData;
class SwAccessibleHyperTextData;
class SwXTextPortion;
-// --> OD 2010-02-19 #i108125#
-class SwParaChangeTrackingInfo;
-// <--
+class SwParaChangeTrackingInfo; //#i108125#
namespace rtl { class OUString; }
namespace com { namespace sun { namespace star {
@@ -56,15 +53,13 @@ namespace com { namespace sun { namespace star {
namespace accessibility { class XAccessibleHyperlink; }
} } }
-typedef ::std::hash_map< ::rtl::OUString,
+typedef ::boost::unordered_map< ::rtl::OUString,
::com::sun::star::beans::PropertyValue,
::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > tAccParaPropValMap;
class SwAccessibleParagraph :
- // --> OD 2010-02-19 #i108125#
- public SwClient,
- // <--
+ public SwClient, // #i108125#
public SwAccessibleContext,
public ::com::sun::star::accessibility::XAccessibleEditableText,
public com::sun::star::accessibility::XAccessibleSelection,
@@ -94,9 +89,7 @@ class SwAccessibleParagraph :
// implementation for XAccessibleSelection
SwAccessibleSelectionHelper aSelectionHelper;
- // --> OD 2010-02-19 #i108125#
- SwParaChangeTrackingInfo* mpParaChangeTrackInfo;
- // <--
+ SwParaChangeTrackingInfo* mpParaChangeTrackInfo; // #i108125#
/// get the SwTxtNode (requires frame; check before)
const SwTxtNode* GetTxtNode() const;
@@ -114,9 +107,8 @@ class SwAccessibleParagraph :
sal_Bool GetSelection(sal_Int32& nStart, sal_Int32& nEnd);
// helper for GetSelection and getCaretPosition
- // --> OD 2005-12-20 #i27301#
- // - add parameter <_bForSelection>, which indicates, if the cursor is
- // retrieved for selection or for caret position.
+ // #i27301# - add parameter <_bForSelection>, which indicates,
+ // if the cursor is retrieved for selection or for caret position.
SwPaM* GetCursor( const bool _bForSelection );
/// for cut/copy/paste: execute a particular slot at the view shell
@@ -148,7 +140,7 @@ class SwAccessibleParagraph :
}
}
- // --> OD 2006-07-13 #i63870#
+ // #i63870#
void _getDefaultAttributesImpl(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
tAccParaPropValMap& rDefAttrSeq,
@@ -243,9 +235,7 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- // --> OD 2010-02-19 #i108125#
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew);
- // <--
+ virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew); // #i108125#
//===== XAccessibleContext ==============================================
@@ -261,12 +251,7 @@ public:
getLocale (void)
throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
- /** paragraphs are in relation CONTENT_FLOWS_FROM and/or CONTENT_FLOWS_TO
-
- OD 2005-12-02 #i27138#
-
- @author OD
- */
+ /** #i27138# - paragraphs are in relation CONTENT_FLOWS_FROM and/or CONTENT_FLOWS_TO */
virtual ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
getAccessibleRelationSet (void)
@@ -276,7 +261,7 @@ public:
virtual void SAL_CALL grabFocus()
throw (::com::sun::star::uno::RuntimeException);
- // --> OD 2007-01-17 #i71385#
+ // #i71385#
virtual sal_Int32 SAL_CALL getForeground()
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBackground()
@@ -374,7 +359,7 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
- // --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+ // index has to be treated as global child index.
virtual void SAL_CALL deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
@@ -392,7 +377,7 @@ public:
throw (::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
- // --> OD 2008-05-19 #i71360#
+ // #i71360#
//===== XAccesibleTextMarkup ============================================
virtual sal_Int32 SAL_CALL getTextMarkupCount( sal_Int32 nTextMarkupType )
throw (::com::sun::star::lang::IllegalArgumentException,
@@ -413,7 +398,7 @@ public:
::com::sun::star::uno::RuntimeException);
// <--
- // --> OD 2008-05-29 #i89175#
+ // #i89175#
//===== XAccessibleMultiLineText ========================================
virtual sal_Int32 SAL_CALL getLineNumberAtIndex( sal_Int32 nIndex )
throw (::com::sun::star::lang::IndexOutOfBoundsException,
@@ -432,7 +417,7 @@ public:
throw (::com::sun::star::uno::RuntimeException);
// <--
- // --> OD 2006-07-11 #i63870#
+ // #i63870#
//===== XAccesibleTextAttributes ========================================
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
@@ -447,3 +432,4 @@ inline SwAccessibleParagraph::operator ::com::sun::star::accessibility::XAccessi
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index c90fa9d4e34d..0142391027b8 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <txttypes.hxx>
// for portion replacement in Special()
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
#include <tools/resid.hxx>
#include "viewopt.hxx"
@@ -173,7 +172,7 @@ void SwAccessiblePortionData::Special(
sDisplay = aTmpBuffer.makeStringAndClear();
break;
}
- // --> OD 2010-06-04 #i111768# - apply patch from kstribley:
+ // #i111768# - apply patch from kstribley:
// Include the control characters.
case POR_CONTROLCHAR:
{
@@ -316,7 +315,7 @@ void SwAccessiblePortionData::GetLineBoundary(
FindBreak( aLineBreaks, nPos ) );
}
-// --> OD 2008-05-30 #i89175#
+// #i89175#
sal_Int32 SwAccessiblePortionData::GetLineCount() const
{
size_t nBreaks = aLineBreaks.size();
@@ -467,9 +466,7 @@ size_t SwAccessiblePortionData::FindLastBreak(
size_t nResult = FindBreak( rPositions, nValue );
// skip 'zero-length' portions
- // --> OD 2006-10-19 #i70538#
- // consider size of <rPosition> and ignore last entry
-// while( rPositions[nResult+1] <= nValue )
+ // #i70538# consider size of <rPosition> and ignore last entry
while ( nResult < rPositions.size() - 2 &&
rPositions[nResult+1] <= nValue )
{
@@ -553,11 +550,9 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) cons
DBG_ASSERT( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
// find the portion number
- // --> OD 2006-10-19 #i70538#
- // consider "empty" model portions - e.g. number portion
+ // #i70538# - consider "empty" model portions - e.g. number portion
size_t nPortionNo = FindLastBreak( aModelPositions,
static_cast<sal_Int32>(nPos) );
- // <--
sal_Int32 nRet = aAccessiblePositions[nPortionNo];
@@ -751,3 +746,5 @@ sal_uInt16 SwAccessiblePortionData::GetLastValidCorePosition() const
{
return static_cast<sal_uInt16>( aModelPositions[ aModelPositions.size()-1 ] );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 1e147ff2d99b..ef04e7ff56eb 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,7 +122,7 @@ public:
// get start and end position of the last line
void GetLastLineBoundary( com::sun::star::i18n::Boundary& rBound ) const;
- // --> OD 2008-05-30 #i89175#
+ // #i89175#
sal_Int32 GetLineCount() const;
sal_Int32 GetLineNo( const sal_Int32 nPos ) const;
void GetBoundaryOfLine( const sal_Int32 nLineNo,
@@ -173,3 +174,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index b8fabc3d5f25..c656b4000d05 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,29 +29,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <vcl/svapp.hxx>
#include <rtl/uuid.h>
-#ifndef _ACCESS_HRC
#include "access.hrc"
-#endif
#include <accpreview.hxx>
-
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";
-
-// using namespace accessibility;
-
using ::com::sun::star::lang::IndexOutOfBoundsException;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
-
-
-
//
// SwAccessiblePreview
//
@@ -92,7 +83,7 @@ Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
throw(RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -102,3 +93,5 @@ Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
}
return aId;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpreview.hxx b/sw/source/core/access/accpreview.hxx
index aab14dc80026..589811e927c9 100644
--- a/sw/source/core/access/accpreview.hxx
+++ b/sw/source/core/access/accpreview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 8e4593377c63..c3beba54da6e 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,7 +97,7 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
throw ( lang::IndexOutOfBoundsException,
RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// Get the respective child as SwFrm (also do index checking), ...
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()),
@@ -106,19 +107,14 @@ void SwAccessibleSelectionHelper::selectAccessibleChild(
// we can only select fly frames, so we ignore (should: return
// false) all other attempts at child selection
- sal_Bool bRet = sal_False;
SwFEShell* pFEShell = GetFEShell();
if( pFEShell != NULL )
{
const SdrObject *pObj = aChild.GetDrawObject();
if( pObj )
- {
- bRet = rContext.Select( const_cast< SdrObject *>( pObj ), 0==aChild.GetSwFrm());
- }
+ rContext.Select( const_cast< SdrObject *>( pObj ), 0==aChild.GetSwFrm());
}
// no frame shell, or no frame, or no fly frame -> can't select
-
- // return bRet;
}
sal_Bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
@@ -126,7 +122,7 @@ sal_Bool SwAccessibleSelectionHelper::isAccessibleChildSelected(
throw ( lang::IndexOutOfBoundsException,
RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// Get the respective child as SwFrm (also do index checking), ...
const SwAccessibleChild aChild = rContext.GetChild( *(rContext.GetMap()),
@@ -161,7 +157,7 @@ void SwAccessibleSelectionHelper::clearAccessibleSelection( )
void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
throw ( RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// We can select only one. So iterate over the children to find
// the first we can select, and select it.
@@ -193,7 +189,7 @@ void SwAccessibleSelectionHelper::selectAllAccessibleChildren( )
sal_Int32 SwAccessibleSelectionHelper::getSelectedAccessibleChildCount( )
throw ( RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nCount = 0;
// Only one frame can be selected at a time, and we only frames
@@ -245,7 +241,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
throw ( lang::IndexOutOfBoundsException,
RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// Since the index is relative to the selected children, and since
// there can be at most one selected frame child, the index must
@@ -301,27 +297,27 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
Reference< XAccessible > xChild;
if( aChild.GetSwFrm() )
{
- ::vos::ORef < SwAccessibleContext > xChildImpl(
+ ::rtl::Reference < SwAccessibleContext > xChildImpl(
rContext.GetMap()->GetContextImpl( aChild.GetSwFrm(),
sal_True ) );
- if( xChildImpl.isValid() )
+ if( xChildImpl.is() )
{
xChildImpl->SetParent( &rContext );
- xChild = xChildImpl.getBodyPtr();
+ xChild = xChildImpl.get();
}
}
else if ( aChild.GetDrawObject() )
{
- ::vos::ORef < ::accessibility::AccessibleShape > xChildImpl(
+ ::rtl::Reference < ::accessibility::AccessibleShape > xChildImpl(
rContext.GetMap()->GetContextImpl( aChild.GetDrawObject(),
&rContext, sal_True ) );
- if( xChildImpl.isValid() )
- xChild = xChildImpl.getBodyPtr();
+ if( xChildImpl.is() )
+ xChild = xChildImpl.get();
}
return xChild;
}
-// --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+// index has to be treated as global child index.
void SwAccessibleSelectionHelper::deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException,
@@ -332,3 +328,5 @@ void SwAccessibleSelectionHelper::deselectAccessibleChild(
nChildIndex >= rContext.GetChildCount( *(rContext.GetMap()) ) )
throwIndexOutOfBoundsException();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accselectionhelper.hxx b/sw/source/core/access/accselectionhelper.hxx
index ff0833d25ed6..43ccce61612d 100644
--- a/sw/source/core/access/accselectionhelper.hxx
+++ b/sw/source/core/access/accselectionhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,7 +70,7 @@ public:
sal_Int32 nSelectedChildIndex )
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
- // --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+ // index has to be treated as global child index.
void deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
@@ -79,3 +80,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 8114f67ec3f0..563a000a3230 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
@@ -102,7 +103,7 @@ class SwAccessibleTableData_Impl
SwAccTableSelHander_Impl& rSelHdl,
sal_Bool bColumns ) const;
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
inline bool IncludeRow( const SwFrm& rFrm ) const
{
return !mbOnlyTableColumnHeader ||
@@ -110,8 +111,7 @@ class SwAccessibleTableData_Impl
}
// <--
public:
- // --> OD 2007-06-27 #i77106#
- // add third optional parameter <bOnlyTableColumnHeader>, default value <false>
+ // #i77106# - add third optional parameter <bOnlyTableColumnHeader>, default value <false>
SwAccessibleTableData_Impl( SwAccessibleMap& rAccMap,
const SwTabFrm *pTabFrm,
sal_Bool bIsInPagePreview,
@@ -164,13 +164,12 @@ void SwAccessibleTableData_Impl::CollectData( const SwFrm *pFrm )
{
if( pLower->IsRowFrm() )
{
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( IncludeRow( *pLower ) )
{
maRows.insert( pLower->Frm().Top() - maTabFrmPos.Y() );
CollectData( pLower );
}
- // <--
}
else if( pLower->IsCellFrm() &&
rLower.IsAccessible( mbIsInPagePreview ) )
@@ -210,13 +209,12 @@ void SwAccessibleTableData_Impl::CollectExtents( const SwFrm *pFrm )
}
else
{
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( !pLower->IsRowFrm() ||
IncludeRow( *pLower ) )
{
CollectExtents( pLower );
}
- // <--
}
}
++aIter;
@@ -236,17 +234,17 @@ sal_Bool SwAccessibleTableData_Impl::FindCell(
{
const SwAccessibleChild& rLower = *aIter;
const SwFrm *pLower = rLower.GetSwFrm();
- ASSERT( pLower, "child should be a frame" );
+ OSL_ENSURE( pLower, "child should be a frame" );
if( pLower )
{
if( rLower.IsAccessible( mbIsInPagePreview ) )
{
- ASSERT( pLower->IsCellFrm(), "lower is not a cell frame" );
+ OSL_ENSURE( pLower->IsCellFrm(), "lower is not a cell frame" );
const SwRect& rFrm = pLower->Frm();
if( rFrm.Right() >= rPos.X() && rFrm.Bottom() >= rPos.Y() )
{
// We have found the cell
- ASSERT( rFrm.Left() <= rPos.X() && rFrm.Top() <= rPos.Y(),
+ OSL_ENSURE( rFrm.Left() <= rPos.X() && rFrm.Top() <= rPos.Y(),
"find frame moved to far!" );
bFound = sal_True;
if( !bExact ||
@@ -258,13 +256,12 @@ sal_Bool SwAccessibleTableData_Impl::FindCell(
}
else
{
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( !pLower->IsRowFrm() ||
IncludeRow( *pLower ) )
{
bFound = FindCell( rPos, pLower, bExact, rRet );
}
- // <--
}
}
++aIter;
@@ -288,13 +285,13 @@ void SwAccessibleTableData_Impl::GetSelection(
{
const SwAccessibleChild& rLower = *aIter;
const SwFrm *pLower = rLower.GetSwFrm();
- ASSERT( pLower, "child should be a frame" );
+ OSL_ENSURE( pLower, "child should be a frame" );
const SwRect& rBox = rLower.GetBox( mrAccMap );
if( pLower && rBox.IsOver( rArea ) )
{
if( rLower.IsAccessible( mbIsInPagePreview ) )
{
- ASSERT( pLower->IsCellFrm(), "lower is not a cell frame" );
+ OSL_ENSURE( pLower->IsCellFrm(), "lower is not a cell frame" );
const SwCellFrm *pCFrm =
static_cast < const SwCellFrm * >( pLower );
SwTableBox *pBox =
@@ -325,14 +322,13 @@ void SwAccessibleTableData_Impl::GetSelection(
}
else
{
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( !pLower->IsRowFrm() ||
IncludeRow( *pLower ) )
{
GetSelection( rTabPos, rArea, rSelBoxes, pLower, rSelHdl,
bColumns );
}
- // <--
}
}
++aIter;
@@ -560,7 +556,7 @@ inline SwAccAllTableSelHander_Impl::SwAccAllTableSelHander_Impl( sal_Int32 nSize
uno::Sequence < sal_Int32 > SwAccAllTableSelHander_Impl::GetSelSequence()
{
- ASSERT( nCount >= 0, "underflow" );
+ OSL_ENSURE( nCount >= 0, "underflow" );
uno::Sequence < sal_Int32 > aRet( nCount );
sal_Int32 *pRet = aRet.getArray();
sal_Int32 nPos = 0;
@@ -574,7 +570,7 @@ uno::Sequence < sal_Int32 > SwAccAllTableSelHander_Impl::GetSelSequence()
}
}
- ASSERT( nPos == nCount, "count is wrong" );
+ OSL_ENSURE( nPos == nCount, "count is wrong" );
return aRet;
}
@@ -582,9 +578,9 @@ uno::Sequence < sal_Int32 > SwAccAllTableSelHander_Impl::GetSelSequence()
void SwAccAllTableSelHander_Impl::Unselect( sal_Int32 nRowOrCol,
sal_Int32 nExt )
{
- ASSERT( static_cast< size_t >( nRowOrCol ) < aSelected.size(),
+ OSL_ENSURE( static_cast< size_t >( nRowOrCol ) < aSelected.size(),
"index to large" );
- ASSERT( static_cast< size_t >( nRowOrCol+nExt ) <= aSelected.size(),
+ OSL_ENSURE( static_cast< size_t >( nRowOrCol+nExt ) <= aSelected.size(),
"extent to large" );
while( nExt )
{
@@ -633,9 +629,7 @@ void SwAccessibleTable::FireTableChangeEvent(
const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
{
DBG_ASSERT( nChildIndex >= 0, "Illegal child index." );
- // --> OD 2007-06-27 #i77106#
- DBG_ASSERT( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." );
- // <--
+ DBG_ASSERT( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
const SwTableBox* pBox = NULL;
@@ -674,9 +668,7 @@ sal_Int32 SwAccessibleTable::GetIndexOfSelectedChild(
sal_Int32 nSelectedChildIndex ) const
{
// iterate over all children to n-th isAccessibleChildSelected()
- // --> OD 2007-06-27 #i77106#
- sal_Int32 nChildren = const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount();
- // <--
+ sal_Int32 nChildren = const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(); // #i77106#
if( nSelectedChildIndex >= nChildren )
return -1L;
@@ -713,7 +705,7 @@ SwAccessibleTable::SwAccessibleTable(
SwAccessibleContext( pInitMap, AccessibleRole::TABLE, pTabFrm ),
mpTableData( 0 )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwFrmFmt *pFrmFmt = pTabFrm->GetFmt();
const_cast< SwFrmFmt * >( pFrmFmt )->Add( this );
@@ -735,7 +727,7 @@ SwAccessibleTable::SwAccessibleTable(
SwAccessibleTable::~SwAccessibleTable()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
delete mpTableData;
}
@@ -750,7 +742,7 @@ void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
if( pTabFrm )
{
const SwFrmFmt *pFrmFmt = pTabFrm->GetFmt();
- ASSERT( pFrmFmt == GetRegisteredIn(), "invalid frame" );
+ OSL_ENSURE( pFrmFmt == GetRegisteredIn(), "invalid frame" );
OUString sOldName( GetName() );
@@ -839,7 +831,7 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleTable::getTypes()
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -850,7 +842,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
return aId;
}
-// --> OD 2007-06-28 #i77106#
+// #i77106#
SwAccessibleTableData_Impl* SwAccessibleTable::CreateNewTableData()
{
const SwTabFrm* pTabFrm = static_cast<const SwTabFrm*>( GetFrm() );
@@ -860,7 +852,7 @@ SwAccessibleTableData_Impl* SwAccessibleTable::CreateNewTableData()
void SwAccessibleTable::UpdateTableData()
{
- // --> OD 2007-06-28 #i77106# - usage of new method <CreateNewTableData()>
+ // #i77106# - usage of new method <CreateNewTableData()>
delete mpTableData;
mpTableData = CreateNewTableData();
// <--
@@ -875,7 +867,7 @@ void SwAccessibleTable::ClearTableData()
OUString SAL_CALL SwAccessibleTable::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -885,7 +877,7 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleDescription (void)
sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowCount()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -895,7 +887,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowCount()
sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnCount( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -906,9 +898,8 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleRowDescription(
sal_Int32 nRow )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- // --> OD 2010-03-10 #i87532#
- // determine table cell in <nRow>th row and in first column of row header table
- // and return its text content.
+ // #i87532# - determine table cell in <nRow>th row and
+ // in first column of row header table and return its text content.
OUString sRowDesc;
GetTableData().CheckRowAndCol(nRow, 0, this);
@@ -918,7 +909,7 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleRowDescription(
{
uno::Reference< XAccessible > xRowHeaderCell =
xTableRowHeader->getAccessibleCellAt( nRow, 0 );
- ASSERT( xRowHeaderCell.is(),
+ OSL_ENSURE( xRowHeaderCell.is(),
"<SwAccessibleTable::getAccessibleRowDescription(..)> - missing row header cell -> serious issue." );
uno::Reference< XAccessibleContext > xRowHeaderCellContext =
xRowHeaderCell->getAccessibleContext();
@@ -942,9 +933,8 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleColumnDescription(
sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- // --> OD 2010-03-10 #i87532#
- // determine table cell in first row and in <nColumn>th column of column header table
- // and return its text content.
+ // #i87532# - determine table cell in first row and
+ // in <nColumn>th column of column header table and return its text content.
OUString sColumnDesc;
GetTableData().CheckRowAndCol(0, nColumn, this);
@@ -954,7 +944,7 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleColumnDescription(
{
uno::Reference< XAccessible > xColumnHeaderCell =
xTableColumnHeader->getAccessibleCellAt( 0, nColumn );
- ASSERT( xColumnHeaderCell.is(),
+ OSL_ENSURE( xColumnHeaderCell.is(),
"<SwAccessibleTable::getAccessibleColumnDescription(..)> - missing column header cell -> serious issue." );
uno::Reference< XAccessibleContext > xColumnHeaderCellContext =
xColumnHeaderCell->getAccessibleContext();
@@ -980,7 +970,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowExtentAt(
{
sal_Int32 nExtend = -1;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1011,7 +1001,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumnExtentAt(
{
sal_Int32 nExtend = -1;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1048,8 +1038,8 @@ uno::Reference< XAccessibleTable > SAL_CALL
SwAccessibleTable::getAccessibleColumnHeaders( )
throw (uno::RuntimeException)
{
- // --> OD 2010-03-10 #i87532#
- // assure that return accesible object is empty, if no column header exists.
+ // #i87532# - assure that return accesible object is empty,
+ // if no column header exists.
SwAccessibleTableColHeaders* pTableColHeaders =
new SwAccessibleTableColHeaders( GetMap(), static_cast< const SwTabFrm *>( GetFrm() ) );
uno::Reference< XAccessibleTable > xTableColumnHeaders( pTableColHeaders );
@@ -1065,7 +1055,7 @@ uno::Reference< XAccessibleTable > SAL_CALL
uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleRows()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1089,7 +1079,7 @@ uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleRows
uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleColumns()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1112,7 +1102,7 @@ uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleColu
sal_Bool SAL_CALL SwAccessibleTable::isAccessibleRowSelected( sal_Int32 nRow )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1139,7 +1129,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleColumnSelected(
sal_Int32 nColumn )
throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1169,7 +1159,7 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleTable::getAccessibleCellAt(
{
uno::Reference< XAccessible > xRet;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1201,7 +1191,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleSelected(
{
sal_Bool bRet = sal_False;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1228,7 +1218,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleIndex(
{
sal_Int32 nRet = -1;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
@@ -1246,11 +1236,11 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex )
{
sal_Int32 nRet = -1;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( ( nChildIndex < 0 ) ||
( nChildIndex >= getAccessibleChildCount() ) )
{
@@ -1270,7 +1260,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex )
}
else
{
- ASSERT( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
+ OSL_ENSURE( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
"aCell not expected to be valid.");
throw lang::IndexOutOfBoundsException();
@@ -1285,11 +1275,11 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
{
sal_Int32 nRet = -1;
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable )
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
if ( ( nChildIndex < 0 ) ||
( nChildIndex >= getAccessibleChildCount() ) )
{
@@ -1309,7 +1299,7 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
}
else
{
- ASSERT( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
+ OSL_ENSURE( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
"aCell not expected to be valid.");
throw lang::IndexOutOfBoundsException();
@@ -1347,7 +1337,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
void SwAccessibleTable::InvalidatePosOrSize( const SwRect& rOldBox )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( HasTableData() )
GetTableData().SetTablePos( GetFrm()->Frm().Pos() );
@@ -1357,7 +1347,7 @@ void SwAccessibleTable::InvalidatePosOrSize( const SwRect& rOldBox )
void SwAccessibleTable::Dispose( sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( GetRegisteredIn() )
pRegisteredIn->Remove( this );
@@ -1368,10 +1358,10 @@ void SwAccessibleTable::Dispose( sal_Bool bRecursive )
void SwAccessibleTable::DisposeChild( const SwAccessibleChild& rChildFrmOrObj,
sal_Bool bRecursive )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwFrm *pFrm = rChildFrmOrObj.GetSwFrm();
- ASSERT( pFrm, "frame expected" );
+ OSL_ENSURE( pFrm, "frame expected" );
if( HasTableData() )
{
FireTableChangeEvent( GetTableData() );
@@ -1391,18 +1381,16 @@ void SwAccessibleTable::DisposeChild( const SwAccessibleChild& rChildFrmOrObj,
void SwAccessibleTable::InvalidateChildPosOrSize( const SwAccessibleChild& rChildFrmOrObj,
const SwRect& rOldBox )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if( HasTableData() )
{
- ASSERT( !HasTableData() ||
+ OSL_ENSURE( !HasTableData() ||
GetFrm()->Frm().Pos() == GetTableData().GetTablePos(),
"table has invalid position" );
if( HasTableData() )
{
- // --> OD 2007-06-28 #i77106#
- SwAccessibleTableData_Impl *pNewTableData = CreateNewTableData();
- // <--
+ SwAccessibleTableData_Impl *pNewTableData = CreateNewTableData(); // #i77106#
if( !pNewTableData->CompareExtents( GetTableData() ) )
{
FireTableChangeEvent( GetTableData() );
@@ -1416,9 +1404,8 @@ void SwAccessibleTable::InvalidateChildPosOrSize( const SwAccessibleChild& rChil
}
}
- // --> OD 2010-02-18 #i013961# - always call super class method
+ // #i013961# - always call super class method
SwAccessibleContext::InvalidateChildPosOrSize( rChildFrmOrObj, rOldBox );
- // <--
}
@@ -1430,12 +1417,10 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
- // --> OD 2007-06-27 #i77106#
- if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) )
- // <--
+ if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
throw lang::IndexOutOfBoundsException();
// preliminaries: get 'our' table box, and get the cursor shell
@@ -1446,13 +1431,11 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
if( pCrsrShell == NULL )
return;
- // --> OD 2004-11-16 #111714# - assure, that child, indentified by the given
- // index, isn't already selected.
+ // assure, that child, indentified by the given index, isn't already selected.
if ( IsChildSelected( nChildIndex ) )
{
return;
}
- // <--
// now we can start to do the work: check whether we already have
// a table selection (in 'our' table). If so, extend the
@@ -1477,14 +1460,6 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
const SwStartNode* pStartNode = pBox->GetSttNd();
if( pSelectedTable == NULL || !pCrsrShell->GetTblCrs() )
{
- // if we're in the wrong table, or there's no table selection
- // at all, then select the current table cell.
-// SwPaM* pPaM = pCrsrShell->GetCrsr();
-// pPaM->DeleteMark();
-// *(pPaM->GetPoint()) = SwPosition( *pStartNode );
-// pPaM->Move( fnMoveForward, fnGoNode );
-// // pCrsrShell->SelTblBox();
-
pCrsrShell->StartAction();
// Set cursor into current cell. This deletes any table cursor.
SwPaM aPaM( *pStartNode );
@@ -1514,20 +1489,6 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
*(aPaM.GetMark()) = *pPaM->GetMark();
Select( aPaM );
- // if only one box is selected, we select this one in
- // order to maintain our table selection
-// if( aPaM.GetPoint()->nNode.GetNode().FindTableBoxStartNode() ==
-// aPaM.GetMark()->nNode.GetNode().FindTableBoxStartNode() )
-// {
-// // pCrsrShell->SelTblBox();
-// }
-// else
-// {
- // finally; set the selection. This will call UpdateCursor
- // on the cursor shell, too.
-// pCrsrShell->KillPams();
- // pCrsrShell->SetSelection( aPaM );
-// }
}
}
@@ -1537,12 +1498,10 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleChildSelected(
throw ( lang::IndexOutOfBoundsException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
- // --> OD 2007-06-27 #i77106#
- if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) )
- // <--
+ if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
throw lang::IndexOutOfBoundsException();
return IsChildSelected( nChildIndex );
@@ -1551,7 +1510,7 @@ sal_Bool SAL_CALL SwAccessibleTable::isAccessibleChildSelected(
void SAL_CALL SwAccessibleTable::clearAccessibleSelection( )
throw ( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
@@ -1570,23 +1529,19 @@ void SAL_CALL SwAccessibleTable::selectAllAccessibleChildren( )
// first clear selection, then select first and last child
clearAccessibleSelection();
selectAccessibleChild( 0 );
- // --> OD 2007-06-27 #i77106#
- selectAccessibleChild( getAccessibleChildCount()-1 );
- // <--
+ selectAccessibleChild( getAccessibleChildCount()-1 ); // #i77106#
}
sal_Int32 SAL_CALL SwAccessibleTable::getSelectedAccessibleChildCount( )
throw ( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
// iterate over all children and count isAccessibleChildSelected()
sal_Int32 nCount = 0;
- // --> OD 2007-06-27 #i71106#
- sal_Int32 nChildren = getAccessibleChildCount();
- // <--
+ sal_Int32 nChildren = getAccessibleChildCount(); // #i71106#
for( sal_Int32 n = 0; n < nChildren; n++ )
if( IsChildSelected( n ) )
nCount++;
@@ -1599,7 +1554,7 @@ uno::Reference<XAccessible> SAL_CALL SwAccessibleTable::getSelectedAccessibleChi
throw ( lang::IndexOutOfBoundsException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
// paremter checking (part 1): index lower 0
@@ -1612,35 +1567,32 @@ uno::Reference<XAccessible> SAL_CALL SwAccessibleTable::getSelectedAccessibleChi
if( nChildIndex < 0 )
throw lang::IndexOutOfBoundsException();
- // --> OD 2007-06-28 #i77106#
+ // #i77106#
if ( nChildIndex >= getAccessibleChildCount() )
{
throw lang::IndexOutOfBoundsException();
}
- // <--
return getAccessibleChild( nChildIndex );
}
-// --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+// index has to be treated as global child index.
void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( lang::IndexOutOfBoundsException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleTable );
SwCrsrShell* pCrsrShell = GetCrsrShell();
- // --> OD 2004-11-16 #111714# - index has to be treated as global child index
+ // index has to be treated as global child index
if ( !pCrsrShell )
throw lang::IndexOutOfBoundsException();
// assure, that given child index is in bounds.
- // --> OD 2007-06-27 #i77106#
- if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
- // <--
+ if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() ) // #i77106#
throw lang::IndexOutOfBoundsException();
// assure, that child, identified by the given index, is selected.
@@ -1677,13 +1629,12 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
pCrsrShell->EndAction();
}
-// --> OD 2007-06-28 #i77106#
-// implementation of class <SwAccessibleTableColHeaders>
+// #i77106# - implementation of class <SwAccessibleTableColHeaders>
SwAccessibleTableColHeaders::SwAccessibleTableColHeaders( SwAccessibleMap *pMap2,
const SwTabFrm *pTabFrm )
: SwAccessibleTable( pMap2, pTabFrm )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwFrmFmt *pFrmFmt = pTabFrm->GetFmt();
const_cast< SwFrmFmt * >( pFrmFmt )->Add( this );
@@ -1705,9 +1656,7 @@ SwAccessibleTableColHeaders::SwAccessibleTableColHeaders( SwAccessibleMap *pMap2
OUString sDesc2 = GetResource( STR_ACCESS_TABLE_DESC, &sArg1, &sArg2 );
SetDesc( sDesc2 );
- // --> OD 2008-03-10 #i85634#
- NotRegisteredAtAccessibleMap();
- // <--
+ NotRegisteredAtAccessibleMap(); // #i85634#
}
SwAccessibleTableData_Impl* SwAccessibleTableColHeaders::CreateNewTableData()
@@ -1732,7 +1681,7 @@ uno::Any SAL_CALL SwAccessibleTableColHeaders::queryInterface( const uno::Type&
sal_Int32 SAL_CALL SwAccessibleTableColHeaders::getAccessibleChildCount(void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -1801,3 +1750,5 @@ uno::Reference< XAccessibleTable >
static const sal_Char sImplName[] = "com.sun.star.comp.Writer.SwAccessibleTableColumnHeadersView";
return OUString(RTL_CONSTASCII_USTRINGPARAM(sImplName));
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index 8bdf2e8b49b2..04fe465a91a6 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,15 +68,13 @@ protected:
virtual ~SwAccessibleTable();
- // --> OD 2007-06-27 #i77106#
+ // #i77106#
inline void SetDesc( ::rtl::OUString sNewDesc )
{
sDesc = sNewDesc;
}
- // --> OD 2007-06-28 #i77106#
- virtual SwAccessibleTableData_Impl* CreateNewTableData();
- // <--
+ virtual SwAccessibleTableData_Impl* CreateNewTableData(); // #i77106#
// force update of table data
void UpdateTableData();
@@ -252,7 +251,7 @@ public:
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
- // --> OD 2004-11-16 #111714# - index has to be treated as global child index.
+ // index has to be treated as global child index.
virtual void SAL_CALL deselectAccessibleChild(
sal_Int32 nChildIndex )
throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
@@ -267,8 +266,7 @@ inline SwAccessibleTableData_Impl& SwAccessibleTable::GetTableData()
return *mpTableData;
}
-// --> OD 2007-06-28 #i77106#
-// subclass to represent table column headers
+// #i77106# - subclass to represent table column headers
class SwAccessibleTableColHeaders : public SwAccessibleTable
{
protected:
@@ -330,3 +328,5 @@ public:
};
// <--
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 75fc1fdebc0e..d86e3e3a8173 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <rtl/uuid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -43,9 +44,7 @@
#include <flyfrm.hxx>
#include <accmap.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
-// --> OD 2009-07-14 #i73249#
-#include <hints.hxx>
-// <--
+#include <hints.hxx> // #i73249#
#include "acctextframe.hxx"
using namespace ::com::sun::star;
@@ -87,9 +86,8 @@ SwAccessibleTextFrame::~SwAccessibleTextFrame()
void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
- // --> OD 2009-07-14 #i73249#
- // suppress handling of RES_NAME_CHANGED in case that attribute Title is
- // used as the accessible name.
+ // #i73249# - suppress handling of RES_NAME_CHANGED
+ // in case that attribute Title is used as the accessible name.
if ( nWhich != RES_NAME_CHANGED ||
msTitle.getLength() == 0 )
{
@@ -99,7 +97,7 @@ void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( GetFrm() );
switch( nWhich )
{
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
@@ -156,11 +154,11 @@ void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-// --> OD 2009-07-14 #i73249#
+// #i73249#
OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -175,7 +173,7 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void)
OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext )
@@ -212,7 +210,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTextFrame::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -254,7 +252,7 @@ AccessibleRelation SwAccessibleTextFrame::makeRelation( sal_Int16 nType, const S
uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccessibleRelationSet( )
throw ( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
CHECK_FOR_DEFUNC( XAccessibleContext );
// get the frame, and insert prev/next relations into helper
@@ -276,3 +274,5 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccess
return pHelper;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx
index d6c9a7a74331..f9b90fe50d19 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +38,7 @@ namespace com { namespace star {
class SwAccessibleTextFrame : public SwAccessibleFrameBase
{
private:
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
::rtl::OUString msTitle;
::rtl::OUString msDesc;
// <--
@@ -55,8 +56,7 @@ public:
//===== XAccessibleContext ==============================================
- // --> OD 2009-07-14 #i73249#
- /// Return the object's current name.
+ // #i73249# - Return the object's current name.
virtual ::rtl::OUString SAL_CALL
getAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException);
@@ -113,3 +113,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/parachangetrackinginfo.cxx b/sw/source/core/access/parachangetrackinginfo.cxx
index 465e4a01b3da..b8c2cdfa68ff 100644
--- a/sw/source/core/access/parachangetrackinginfo.cxx
+++ b/sw/source/core/access/parachangetrackinginfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -32,7 +30,6 @@
#include <parachangetrackinginfo.hxx>
-#include <errhdl.hxx>
#include <wrong.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
@@ -56,7 +53,7 @@ namespace {
if ( !rTxtFrm.GetTxtNode() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<initChangeTrackTextMarkupLists(..) - missing <SwTxtNode> instance!" );
return;
}
@@ -65,7 +62,7 @@ namespace {
const IDocumentRedlineAccess* pIDocChangeTrack( rTxtNode.getIDocumentRedlineAccess() );
if ( !pIDocChangeTrack )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<initChangeTrackTextMarkupLists(..) - missing <IDocumentRedlineAccess> instance!" );
return;
}
@@ -193,9 +190,9 @@ const SwWrongList* SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList( co
if ( mpChangeTrackInsertionTextMarkupList == 0 )
{
- ASSERT( mpChangeTrackDeletionTextMarkupList == 0,
+ OSL_ENSURE( mpChangeTrackDeletionTextMarkupList == 0,
"<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..) - <mpChangeTrackDeletionTextMarkupList> expected to be NULL." );
- ASSERT( mpChangeTrackFormatChangeTextMarkupList == 0,
+ OSL_ENSURE( mpChangeTrackFormatChangeTextMarkupList == 0,
"<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..) - <mpChangeTrackFormatChangeTextMarkupList> expected to be NULL." );
initChangeTrackTextMarkupLists( mrTxtFrm,
mpChangeTrackInsertionTextMarkupList,
@@ -222,10 +219,12 @@ const SwWrongList* SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList( co
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwParaChangeTrackingInfo::getChangeTrackingTextMarkupList(..)> - misusage - unexpected text markup type for change tracking." );
}
}
return pChangeTrackingTextMarkupList;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/parachangetrackinginfo.hxx b/sw/source/core/access/parachangetrackinginfo.hxx
index 91131f37b757..fea7d2fb5f14 100644
--- a/sw/source/core/access/parachangetrackinginfo.hxx
+++ b/sw/source/core/access/parachangetrackinginfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6,9 +7,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: $
- * $Revision: $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -57,3 +55,4 @@ class SwParaChangeTrackingInfo
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx
index 90444e4cdca0..6eb9ffa9edab 100644
--- a/sw/source/core/access/textmarkuphelper.cxx
+++ b/sw/source/core/access/textmarkuphelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,6 @@
#include <algorithm>
#include <comphelper/stlunosequence.hxx>
-#include <errhdl.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
#include <com/sun/star/accessibility/TextSegment.hpp>
@@ -85,14 +85,14 @@ namespace {
SwTextMarkupHelper::SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
const SwTxtNode& rTxtNode )
: mrPortionData( rPortionData )
- // --> OD 2010-02-19 #i108125#
+ // #i108125#
, mpTxtNode( &rTxtNode )
, mpTextMarkupList( 0 )
// <--
{
}
-// --> OD 2010-02-19 #i108125#
+// #i108125#
SwTextMarkupHelper::SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
const SwWrongList& rTextMarkupList )
: mrPortionData( rPortionData )
@@ -108,7 +108,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
{
sal_Int32 nTextMarkupCount( 0 );
- // --> OD 2010-02-19 #i108125#
+ // #i108125#
const SwWrongList* pTextMarkupList =
mpTextMarkupList
? mpTextMarkupList
@@ -138,7 +138,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
aTextMarkupSegment.SegmentStart = -1;
aTextMarkupSegment.SegmentEnd = -1;
- // --> OD 2010-02-19 #i108125#
+ // #i108125#
const SwWrongList* pTextMarkupList =
mpTextMarkupList
? mpTextMarkupList
@@ -161,7 +161,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwTextMarkupHelper::getTextMarkup(..)> - missing <SwWrongArea> instance" );
}
}
@@ -187,7 +187,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
return uno::Sequence< ::com::sun::star::accessibility::TextSegment >();
}
- // --> OD 2010-02-19 #i108125#
+ // #i108125#
const SwWrongList* pTextMarkupList =
mpTextMarkupList
? mpTextMarkupList
@@ -203,7 +203,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
{
const SwWrongArea* pTextMarkup =
pTextMarkupList->GetElement( static_cast<sal_uInt16>(nTextMarkupIdx) );
- ASSERT( pTextMarkup,
+ OSL_ENSURE( pTextMarkup,
"<SwTextMarkupHelper::getTextMarkup(..)> - missing <SwWrongArea> instance" );
if ( pTextMarkup &&
pTextMarkup->mnPos <= nCoreCharIndex &&
@@ -229,3 +229,5 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
return aTextMarkups;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/textmarkuphelper.hxx b/sw/source/core/access/textmarkuphelper.hxx
index 9b2bb519a2a1..57d3152bab2a 100644
--- a/sw/source/core/access/textmarkuphelper.hxx
+++ b/sw/source/core/access/textmarkuphelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,19 +40,14 @@ struct TextSegment;
class SwAccessiblePortionData;
class SwTxtNode;
-// --> OD 2010-02-19 #i108125#
-class SwWrongList;
-// <--
-
+class SwWrongList; // #i108125#
class SwTextMarkupHelper
{
public:
SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
const SwTxtNode& rTxtNode );
- // --> OD 2010-02-19 #i108125#
SwTextMarkupHelper( const SwAccessiblePortionData& rPortionData,
- const SwWrongList& rTextMarkupList );
- // <--
+ const SwWrongList& rTextMarkupList ); // #i108125#
~SwTextMarkupHelper() {}
sal_Int32 getTextMarkupCount( const sal_Int32 nTextMarkupType )
@@ -78,10 +74,11 @@ class SwTextMarkupHelper
const SwAccessiblePortionData& mrPortionData;
- // --> OD 2010-02-19 #i108125#
+ // #i108125#
const SwTxtNode* mpTxtNode;
const SwWrongList* mpTextMarkupList;
// <--
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index bbdedfea13d4..f25f117b36f1 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include <swcache.hxx>
#include <swfntcch.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include <unotextmarkup.hxx>
#endif
@@ -47,8 +48,6 @@ TYPEINIT0(SwClient); //rtti
|* SwClient::SwClient(SwModify *)
|*
|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 20. Mar. 95
*************************************************************************/
@@ -69,8 +68,6 @@ SwClient::SwClient(SwModify *pToRegisterIn)
|* SwClient::Modify()
|*
|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
*************************************************************************/
@@ -96,8 +93,6 @@ void SwClient::Modify( SfxPoolItem *pOld, SfxPoolItem * )
|* SwClient::~SwClient()
|*
|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 25. Jan. 94
*************************************************************************/
@@ -106,7 +101,7 @@ SwClient::~SwClient()
if( pRegisteredIn && pRegisteredIn->GetDepends() )
pRegisteredIn->Remove( this );
- ASSERT( !IsModifyLocked(), "Modify destroyed but locked." );
+ OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." );
}
@@ -120,8 +115,6 @@ sal_Bool SwClient::GetInfo( SfxPoolItem& ) const
|* SwModify::SwModify( SwModify * )
|*
|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung VB 20.03.91
*************************************************************************/
@@ -141,8 +134,6 @@ SwModify::SwModify( const SwModify & )
|* SwModify::~SwModify()
|*
|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 15.04.94
*************************************************************************/
@@ -188,8 +179,6 @@ SwModify::~SwModify()
|* SwModify::Modify( SwHint * pOldValue, SwHint * pNewValue )
|*
|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung MA 20. Mar. 95
*************************************************************************/
@@ -208,9 +197,7 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
LockModify();
-#ifndef DBG_UTIL
- bInModify = sal_True;
-#else
+#if OSL_DEBUG_LEVEL > 1
if( !pOldValue )
bInModify = sal_True;
else
@@ -231,6 +218,8 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
default:
bInModify = sal_True;
}
+#else
+ bInModify = sal_True;
#endif
SwClientIter aIter( *this );
@@ -271,24 +260,22 @@ sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
|* SwModify::Add( SwClient *pDepend )
|*
|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
*************************************************************************/
void SwModify::Add(SwClient *pDepend)
{
- ASSERT( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" );
+ OSL_ENSURE( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" );
// nur wenn das hier noch nicht eingetragen ist einfuegen
if(pDepend->pRegisteredIn != this )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- ASSERT( &pTmp->rRoot != pRoot,
+ OSL_ENSURE( &pTmp->rRoot != pRoot,
"Client beim angemeldeten ClientIter einfuegen?" );
pTmp = pTmp->pNxtIter;
}
@@ -321,8 +308,6 @@ void SwModify::Add(SwClient *pDepend)
|* SwModify::_Remove( SwClient *pDepend )
|*
|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
*************************************************************************/
@@ -330,7 +315,9 @@ void SwModify::Add(SwClient *pDepend)
SwClient *SwModify::_Remove(SwClient * pDepend)
{
// FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
- ASSERT( !bInModify || 0 != dynamic_cast<SwXTextMarkup*>(pDepend), "Client innerhalb des eigenen Modifies loeschen?" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !bInModify || 0 != dynamic_cast<SwXTextMarkup*>(pDepend), "Client innerhalb des eigenen Modifies loeschen?" );
+#endif
// loesche das Object aus der Liste und setze den
// Registrierungs-Pointer zurueck
@@ -353,10 +340,9 @@ SwClient *SwModify::_Remove(SwClient * pDepend)
if( pTmp->pAkt == pDepend || pTmp->pDelNext == pDepend )
pTmp->pDelNext = pR;
- // --> FME 2006-02-03 #127369# Notify SwClientIter if mpWatchClient is removed
+ // Notify SwClientIter if mpWatchClient is removed
if ( pTmp->mpWatchClient == pDepend )
pTmp->mpWatchClient = 0;
- // <--
pTmp = pTmp->pNxtIter;
}
@@ -365,7 +351,7 @@ SwClient *SwModify::_Remove(SwClient * pDepend)
pDepend->pRight = 0;
}
else {
- ASSERT( sal_False, "SwModify::Remove(): pDepend nicht gefunden");
+ OSL_ENSURE( sal_False, "SwModify::Remove(): pDepend nicht gefunden");
}
pDepend->pRegisteredIn = 0;
return pDepend;
@@ -374,9 +360,6 @@ SwClient *SwModify::_Remove(SwClient * pDepend)
/*************************************************************************
|* SwModify::CheckCaching( const sal_uInt16 nWhich )
-|*
-|* Ersterstellung JP 25.06.95
-|* Letzte Aenderung JP 25.06.95
*************************************************************************/
@@ -420,8 +403,6 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich )
|* SwDepend::SwDepend(SwClient *pTellHim,SwModify *pDepend)
|*
|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
*************************************************************************/
@@ -436,8 +417,6 @@ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
|* SwDepend::Modify(SwHint *, SwHint *)
|*
|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
|*
*************************************************************************/
@@ -494,7 +473,7 @@ SwClientIter::~SwClientIter()
while( pTmp->pNxtIter != this )
if( 0 == ( pTmp = pTmp->pNxtIter ) )
{
- ASSERT( this, "wo ist mein Pointer" );
+ OSL_ENSURE( this, "wo ist mein Pointer" );
return ;
}
pTmp->pNxtIter = pNxtIter;
@@ -503,13 +482,9 @@ SwClientIter::~SwClientIter()
}
-#ifndef CFRONT
// Postfix Operator
SwClient* SwClientIter::operator++(int)
{
-// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer
-// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der
-// Code entsprechen umgestellt werden !!!
if( pDelNext == pAkt )
{
pAkt = pAkt->pRight;
@@ -519,7 +494,6 @@ SwClient* SwClientIter::operator++(int)
pAkt = pDelNext;
return pAkt;
}
-#endif
// Prefix Operator
@@ -536,7 +510,6 @@ SwClient* SwClientIter::operator++()
}
-#ifndef CFRONT
// Postfix Operator
SwClient* SwClientIter::operator--(int)
{
@@ -550,7 +523,6 @@ SwClient* SwClientIter::operator--(int)
pDelNext = pAkt;
return pAkt;
}
-#endif
// Prefix Operator
@@ -632,3 +604,4 @@ SwClient* SwClientIter::Next()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index cb5624b615e4..aae83558ca47 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,7 +60,7 @@ SwTblBoxNumFormat::SwTblBoxNumFormat( sal_uInt32 nFormat, sal_Bool bFlag )
int SwTblBoxNumFormat::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return GetValue() == ((SwTblBoxNumFormat&)rAttr).GetValue() &&
bAuto == ((SwTblBoxNumFormat&)rAttr).bAuto;
}
@@ -87,7 +88,7 @@ SwTblBoxFormula::SwTblBoxFormula( const String& rFormula )
int SwTblBoxFormula::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return GetFormula() == ((SwTblBoxFormula&)rAttr).GetFormula() &&
pDefinedIn == ((SwTblBoxFormula&)rAttr).pDefinedIn;
}
@@ -157,9 +158,6 @@ void SwTblBoxFormula::ChangeState( const SfxPoolItem* pItem )
// setze das Value-Flag zurueck
// JP 17.06.96: interne Darstellung auf alle Formeln
// (Referenzen auf andere Tabellen!!!)
-// if( VF_CMD & pFld->GetFormat() )
-// pFld->PtrToBoxNm( pUpdtFld->pTbl );
-// else
ChgValid( sal_False );
break;
case TBL_BOXNAME:
@@ -250,7 +248,7 @@ SwTblBoxValue::SwTblBoxValue( const double nVal )
int SwTblBoxValue::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT(SfxPoolItem::operator==(rAttr), "SwTblBoxValue: item not equal");
+ OSL_ENSURE(SfxPoolItem::operator==(rAttr), "SwTblBoxValue: item not equal");
SwTblBoxValue const& rOther( static_cast<SwTblBoxValue const&>(rAttr) );
// items with NaN should be equal to enable pooling
return ::rtl::math::isNan(nValue)
@@ -267,3 +265,4 @@ SfxPoolItem* SwTblBoxValue::Clone( SfxItemPool* ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/fmtfollowtextflow.cxx b/sw/source/core/attr/fmtfollowtextflow.cxx
index 8bcd5b682116..b51d15be5cc3 100644
--- a/sw/source/core/attr/fmtfollowtextflow.cxx
+++ b/sw/source/core/attr/fmtfollowtextflow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,3 +36,5 @@ SfxPoolItem* SwFmtFollowTextFlow::Clone( SfxItemPool * ) const
{
return new SwFmtFollowTextFlow(*this);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
index fde57e74e2ff..038776466d43 100644
--- a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
+++ b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_sw.hxx"
#include <fmtwrapinfluenceonobjpos.hxx>
-#ifndef _UNOMID_H
#include <unomid.h>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -66,7 +65,7 @@ SwFmtWrapInfluenceOnObjPos& SwFmtWrapInfluenceOnObjPos::operator=(
int SwFmtWrapInfluenceOnObjPos::operator==( const SfxPoolItem& _rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( _rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( _rAttr ), "keine gleichen Attribute" );
return ( mnWrapInfluenceOnPosition ==
static_cast<const SwFmtWrapInfluenceOnObjPos&>(_rAttr).
GetWrapInfluenceOnObjPos() );
@@ -77,10 +76,10 @@ SfxPoolItem* SwFmtWrapInfluenceOnObjPos::Clone( SfxItemPool * ) const
return new SwFmtWrapInfluenceOnObjPos(*this);
}
-sal_Bool SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_WRAP_INFLUENCE:
@@ -89,17 +88,17 @@ sal_Bool SwFmtWrapInfluenceOnObjPos::QueryValue( Any& rVal, sal_uInt8 nMemberId
}
break;
default:
- ASSERT( false, "<SwFmtWrapInfluenceOnObjPos::QueryValue()> - unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( false, "<SwFmtWrapInfluenceOnObjPos::QueryValue()> - unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
@@ -107,25 +106,24 @@ sal_Bool SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, sal_uInt8 nMembe
{
sal_Int16 nNewWrapInfluence = 0;
rVal >>= nNewWrapInfluence;
- // --> OD 2004-10-18 #i35017# - constant names have changed and
+ // #i35017# - constant names have changed and
// <ITERATIVE> has been added
if ( nNewWrapInfluence == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ||
nNewWrapInfluence == text::WrapInfluenceOnPosition::ONCE_CONCURRENT ||
nNewWrapInfluence == text::WrapInfluenceOnPosition::ITERATIVE )
- // <--
{
SetWrapInfluenceOnObjPos( nNewWrapInfluence );
}
else
{
- ASSERT( false, "<SwFmtWrapInfluenceOnObjPos::PutValue(..)> - invalid attribute value" );
- bRet = sal_False;
+ OSL_ENSURE( false, "<SwFmtWrapInfluenceOnObjPos::PutValue(..)> - invalid attribute value" );
+ bRet = false;
}
}
break;
default:
- ASSERT( false, "<SwFmtWrapInfluenceOnObjPos::QueryValue()> - unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( false, "<SwFmtWrapInfluenceOnObjPos::QueryValue()> - unknown MemberId" );
+ bRet = false;
}
return bRet;
@@ -133,22 +131,21 @@ sal_Bool SwFmtWrapInfluenceOnObjPos::PutValue( const Any& rVal, sal_uInt8 nMembe
void SwFmtWrapInfluenceOnObjPos::SetWrapInfluenceOnObjPos( sal_Int16 _nWrapInfluenceOnPosition )
{
- // --> OD 2004-10-18 #i35017# - constant names have changed and consider
+ // #i35017# - constant names have changed and consider
// new value <ITERATIVE>
if ( _nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ||
_nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_CONCURRENT ||
_nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ITERATIVE )
- // <--
{
mnWrapInfluenceOnPosition = _nWrapInfluenceOnPosition;
}
else
{
- ASSERT( false, "<SwFmtWrapInfluenceOnObjPos::SetWrapInfluenceOnObjPos(..)> - invalid attribute value" );
+ OSL_ENSURE( false, "<SwFmtWrapInfluenceOnObjPos::SetWrapInfluenceOnObjPos(..)> - invalid attribute value" );
}
}
-// --> OD 2004-10-18 #i35017# - add parameter <_bIterativeAsOnceConcurrent>
+// #i35017# - add parameter <_bIterativeAsOnceConcurrent>
// to control, if value <ITERATIVE> has to be treated as <ONCE_CONCURRENT>
sal_Int16 SwFmtWrapInfluenceOnObjPos::GetWrapInfluenceOnObjPos(
const bool _bIterativeAsOnceConcurrent ) const
@@ -163,4 +160,5 @@ sal_Int16 SwFmtWrapInfluenceOnObjPos::GetWrapInfluenceOnObjPos(
return nWrapInfluenceOnPosition;
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index f1c9142b7193..d4b217e49d11 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include <doc.hxx>
#include <paratr.hxx> // fuer SwParaFmt - SwHyphenBug
#include <swcache.hxx>
-// --> OD 2006-11-22 #i71574#
#include <fmtcolfunc.hxx>
-// <--
TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -109,8 +108,6 @@ SwFmt::SwFmt( const SwFmt& rFmt )
|* SwFmt &SwFmt::operator=(const SwFmt& aFmt)
|*
|* Beschreibung Dokument 1.14
-|* Ersterstellung JP 22.11.90
-|* Letzte Aenderung JP 05.08.94
*************************************************************************/
@@ -164,7 +161,7 @@ SwFmt &SwFmt::operator=(const SwFmt& rFmt)
void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast )
{
- ASSERT(!IsDefault(), "SetName: Defaultformat" );
+ OSL_ENSURE(!IsDefault(), "SetName: Defaultformat" );
if( bBroadcast )
{
SwStringMsgPoolItem aOld( RES_NAME_CHANGED, aFmtName );
@@ -241,8 +238,6 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, sal_Bool bReplace )
|* SwFmt::~SwFmt()
|*
|* Beschreibung Dokument 1.14
-|* Ersterstellung JP 22.11.90
-|* Letzte Aenderung JP 14.02.91
*************************************************************************/
@@ -252,14 +247,14 @@ SwFmt::~SwFmt()
/* alle Abhaengigen auf DerivedFrom umhaengen */
if( GetDepends() )
{
- ASSERT(DerivedFrom(), "SwFmt::~SwFmt: Def Abhaengige!" );
+ OSL_ENSURE(DerivedFrom(), "SwFmt::~SwFmt: Def Abhaengige!" );
bFmtInDTOR = sal_True;
SwFmt *pParentFmt = DerivedFrom();
- if (!pParentFmt) // see #112405#
+ if (!pParentFmt)
{
- DBG_ERROR( "~SwFmt: parent format missing" );
+ OSL_FAIL( "~SwFmt: parent format missing" );
}
else
{
@@ -280,8 +275,6 @@ SwFmt::~SwFmt()
|* void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
|*
|* Beschreibung Dokument 1.14
-|* Ersterstellung JP 22.11.90
-|* Letzte Aenderung JP 05.08.94
*************************************************************************/
@@ -371,9 +364,9 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
{
// wie finde ich heraus, ob nicht ich die Message versende ??
// aber wer ruft das hier ????
-//ASSERT( sal_False, "Modify ohne Absender verschickt" );
+// OSL_ENSURE( FALSE, "Modify ohne Absender verschickt" );
//JP 11.06.96: DropCaps koennen hierher kommen
-ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
+ OSL_ENSURE( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
bWeiter = sal_False;
}
@@ -413,7 +406,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
if ( (pDerFrom == DerivedFrom()) || (pDerFrom == this) )
return sal_False;
- ASSERT( Which()==pDerFrom->Which()
+ OSL_ENSURE( Which()==pDerFrom->Which()
|| ( Which()==RES_CONDTXTFMTCOLL && pDerFrom->Which()==RES_TXTFMTCOLL)
|| ( Which()==RES_TXTFMTCOLL && pDerFrom->Which()==RES_CONDTXTFMTCOLL)
|| ( Which()==RES_FLYFRMFMT && pDerFrom->Which()==RES_FRMFMT ),
@@ -455,12 +448,11 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
{
if( 0 != ( bRet = (0 != aSet.Put( rAttr ))) )
aSet.SetModifyAtAttr( this );
- // --> OD 2006-11-22 #i71574#
+ // #i71574#
if ( nFmtWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
}
- // <--
}
else
{
@@ -506,12 +498,11 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
{
if( 0 != ( bRet = (0 != aSet.Put( rSet ))) )
aSet.SetModifyAtAttr( this );
- // --> OD 2006-11-22 #i71574#
+ // #i71574#
if ( nFmtWhich == RES_TXTFMTCOLL )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle( this );
}
- // <--
}
else
{
@@ -568,10 +559,9 @@ sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
-// --> OD 2007-01-24 #i73790#
+// #i73790#
// method renamed
sal_uInt16 SwFmt::ResetAllFmtAttr()
-// <--
{
if( !aSet.Count() )
return 0;
@@ -603,10 +593,6 @@ sal_uInt16 SwFmt::ResetAllFmtAttr()
/*************************************************************************
|* void SwFmt::GetInfo( const SfxPoolItem& ) const
-|*
-|* Beschreibung
-|* Ersterstellung JP 18.04.94
-|* Letzte Aenderung JP 05.08.94
*************************************************************************/
@@ -648,9 +634,8 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet )
}
}
-/** SwFmt::IsBackgroundTransparent - for feature #99657#
+/** SwFmt::IsBackgroundTransparent
- OD 22.08.2002
Virtual method to determine, if background of format is transparent.
Default implementation returns false. Thus, subclasses have to overload
method, if the specific subclass can have a transparent background.
@@ -664,15 +649,12 @@ sal_Bool SwFmt::IsBackgroundTransparent() const
return sal_False;
}
-/** SwFmt::IsShadowTransparent - for feature #99657#
+/** SwFmt::IsShadowTransparent
- OD 22.08.2002
Virtual method to determine, if shadow of format is transparent.
Default implementation returns false. Thus, subclasses have to overload
method, if the specific subclass can have a transparent shadow.
- @author OD
-
@return false, default implementation
*/
sal_Bool SwFmt::IsShadowTransparent() const
@@ -692,3 +674,4 @@ IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); }
IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); }
IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); }
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index 3d9d284b8c6d..8be07e422fc1 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,14 +30,11 @@
#include "precompiled_sw.hxx"
#include <hints.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <editeng/scripttypeitem.hxx>
#include <hintids.hxx>
#include <swtypes.hxx>
#include <ndtxt.hxx>
-#include <errhdl.hxx>
SwFmtChg::SwFmtChg( SwFmt *pFmt )
: SwMsgPoolItem( RES_FMT_CHG ),
@@ -85,7 +83,7 @@ SwRefMarkFldUpdate::SwRefMarkFldUpdate( const OutputDevice* pOutput )
: SwMsgPoolItem( RES_REFMARKFLD_UPDATE ),
pOut( pOutput )
{
- ASSERT( pOut, "es muss ein OutputDevice-Pointer gesetzt werden!" );
+ OSL_ENSURE( pOut, "es muss ein OutputDevice-Pointer gesetzt werden!" );
}
@@ -104,7 +102,7 @@ SwTableFmlUpdate::SwTableFmlUpdate( const SwTable* pNewTbl )
{
DATA.pDelTbl = 0;
bModified = bBehindSplitLine = sal_False;
- ASSERT( pTbl, "es muss ein Table-Pointer gesetzt werden!" );
+ OSL_ENSURE( pTbl, "es muss ein Table-Pointer gesetzt werden!" );
}
@@ -138,11 +136,11 @@ SwAttrSetChg::~SwAttrSetChg()
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwAttrSetChg::ClearItem( sal_uInt16 nWhch )
{
- ASSERT( bDelSet, "der Set darf nicht veraendert werden!" );
+ OSL_ENSURE( bDelSet, "der Set darf nicht veraendert werden!" );
pChgSet->ClearItem( nWhch );
}
@@ -157,14 +155,14 @@ SwMsgPoolItem::SwMsgPoolItem( sal_uInt16 nWhch )
// "Overhead" vom SfxPoolItem
int SwMsgPoolItem::operator==( const SfxPoolItem& ) const
{
- ASSERT( sal_False, "SwMsgPoolItem kennt kein ==" );
+ OSL_ENSURE( sal_False, "SwMsgPoolItem kennt kein ==" );
return 0;
}
SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const
{
- ASSERT( sal_False, "SwMsgPoolItem kennt kein Clone" );
+ OSL_ENSURE( sal_False, "SwMsgPoolItem kennt kein Clone" );
return 0;
}
@@ -174,20 +172,19 @@ SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const
* Ist keines vorhanden, returnt ein 0-Pointer !!!
* Used to be inlined (hintids.hxx) in PRODUCT.
******************************************************************************/
-#ifndef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich )
{
- return aAttrTab[ nWhich - POOLATTR_BEGIN ];
+ OSL_ASSERT( nWhich < POOLATTR_END && nWhich >= POOLATTR_BEGIN );
+
+ SfxPoolItem *pHt = aAttrTab[ nWhich - POOLATTR_BEGIN ];
+ OSL_ENSURE( pHt, "GetDfltFmtAttr(): Dflt == 0" );
+ return pHt;
}
#else
const SfxPoolItem* GetDfltAttr( sal_uInt16 nWhich )
{
- ASSERT_ID( nWhich < POOLATTR_END && nWhich >= POOLATTR_BEGIN,
- ERR_OUTOFSCOPE );
-
- SfxPoolItem *pHt = aAttrTab[ nWhich - POOLATTR_BEGIN ];
- ASSERT( pHt, "GetDfltFmtAttr(): Dflt == 0" );
- return pHt;
+ return aAttrTab[ nWhich - POOLATTR_BEGIN ];
}
#endif
@@ -207,17 +204,6 @@ SwVirtPageNumInfo::SwVirtPageNumInfo( const SwPageFrm *pPg ) :
{
}
-// --> OD 2008-02-19 #refactorlists#
-//SwNumRuleInfo::SwNumRuleInfo( const String& rRuleName )
-// : SwMsgPoolItem( RES_GETNUMNODES ), rName( rRuleName )
-//{
-//}
-
-//void SwNumRuleInfo::AddNode( SwTxtNode& rNd )
-//{
-// aList.Insert(rNd.GetIndex(), &rNd);
-//}
-
SwFindNearestNode::SwFindNearestNode( const SwNode& rNd )
: SwMsgPoolItem( RES_FINDNEARESTNODE ), pNd( &rNd ), pFnd( 0 )
@@ -306,3 +292,5 @@ sal_uInt16 GetWhichOfScript( sal_uInt16 nWhich, sal_uInt16 nScript )
nRet = nWhich;
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 1753f06a8c1f..558f5ba7caf4 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,14 +44,10 @@
#include <node.hxx>
#include <paratr.hxx> // fuer SetModifyAtAttr
#include <cellatr.hxx> // fuer SetModifyAtAttr
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#include <istyleaccess.hxx>
#include <numrule.hxx>
-// --> OD 2008-03-19 #refactorlists#
#include <list.hxx>
-// <--
SwAttrPool::SwAttrPool( SwDoc* pD )
@@ -64,7 +61,7 @@ SwAttrPool::SwAttrPool( SwDoc* pD )
SetVersionMap( 2, 1, 75, pVersionMap2 );
SetVersionMap( 3, 1, 86, pVersionMap3 );
SetVersionMap( 4, 1,121, pVersionMap4 );
- // OD 2004-01-21 #i18732# - apply new version map
+ // #i18732# - apply new version map
SetVersionMap( 5, 1,130, pVersionMap5 );
SetVersionMap( 6, 1,136, pVersionMap6 );
}
@@ -159,7 +156,7 @@ sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich,
sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2,
SwAttrSet* pOld, SwAttrSet* pNew )
{
- ASSERT( nWhich1 <= nWhich2, "kein gueltiger Bereich" );
+ OSL_ENSURE( nWhich1 <= nWhich2, "kein gueltiger Bereich" );
pNewSet = pNew;
pOldSet = pOld;
sal_uInt16 nRet = 0;
@@ -249,9 +246,8 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
{
if( Count() )
{
- // --> OD 2008-08-15 #i92811#
+ // #i92811#
SfxStringItem* pNewListIdItem( 0 );
- // <--
const SfxPoolItem* pItem;
const SwDoc *pSrcDoc = GetDoc();
@@ -273,7 +269,6 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
}
}
- // --> OD 2008-03-19 #refactorlists#
// copy list and if needed also the corresponding list style
// for text nodes
if ( pSrcDoc != pDstDoc &&
@@ -289,7 +284,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// copy list style, if needed
const String sDefaultListStyleName =
pList->GetDefaultListStyleName();
- // --> OD 2008-08-15 #i92811#
+ // #i92811#
const SwNumRule* pDstDocNumRule =
pDstDoc->FindNumRulePtr( sDefaultListStyleName );
if ( !pDstDocNumRule )
@@ -320,13 +315,11 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// copy list
pDstDoc->createList( sListId, sDefaultListStyleName );
}
- // <--
}
}
- // <--
- // JP 04.02.99: Task #61467# Seitenvorlagenwechsel mit kopieren
- // Gegenueber dem alten Verhalten, sie zu entfernen
+ // Seitenvorlagenwechsel mit kopieren Gegenueber dem alten
+ // Verhalten, sie zu entfernen
const SwPageDesc* pPgDesc;
if( pSrcDoc != pDstDoc && SFX_ITEM_SET == GetItemState(
RES_PAGEDESC, sal_False, &pItem ) &&
@@ -349,12 +342,11 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
if( pCNd )
{
- // --> OD 2008-08-15 #i92811#
+ // #i92811#
if ( pNewListIdItem != 0 )
{
aTmpSet.Put( *pNewListIdItem );
}
- // <--
pCNd->SetAttr( aTmpSet );
}
else
@@ -362,7 +354,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
}
else if( pCNd )
{
- // --> OD 2008-08-15 #i92811#
+ // #i92811#
if ( pNewListIdItem != 0 )
{
SfxItemSet aTmpSet( *this );
@@ -373,20 +365,18 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
{
pCNd->SetAttr( *this );
}
- // <--
}
else
pFmt->SetFmtAttr( *this );
- // --> OD 2008-08-15 #i92811#
+ // #i92811#
delete pNewListIdItem;
pNewListIdItem = 0;
- // <--
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !this, "weder Format noch ContentNode - keine Attribute kopiert");
+ OSL_ENSURE( !this, "weder Format noch ContentNode - keine Attribute kopiert");
#endif
}
@@ -402,3 +392,4 @@ sal_Bool IsInRange( const sal_uInt16* pRange, const sal_uInt16 nId )
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/SwSmartTagMgr.cxx b/sw/source/core/bastyp/SwSmartTagMgr.cxx
index ac661389ae6a..2e773d532e41 100644
--- a/sw/source/core/bastyp/SwSmartTagMgr.cxx
+++ b/sw/source/core/bastyp/SwSmartTagMgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,11 @@
#include "precompiled_sw.hxx"
#include "SwSmartTagMgr.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swmodule.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -47,7 +46,7 @@ SwSmartTagMgr& SwSmartTagMgr::Get()
if ( !mpTheSwSmartTagMgr )
{
mpTheSwSmartTagMgr = new SwSmartTagMgr( SwDocShell::Factory().GetModuleName() );
- mpTheSwSmartTagMgr->Init( rtl::OUString::createFromAscii("Writer") );
+ mpTheSwSmartTagMgr->Init(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Writer")));
}
return *mpTheSwSmartTagMgr;
}
@@ -64,7 +63,7 @@ SwSmartTagMgr::~SwSmartTagMgr()
// ::com::sun::star::util::XModifyListener
void SwSmartTagMgr::modified( const lang::EventObject& rEO ) throw( RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// Installed recognizers have changed. We remove all existing smart tags:
SW_MOD()->CheckSpellChanges( sal_False, sal_True, sal_True, sal_True );
@@ -75,7 +74,7 @@ void SwSmartTagMgr::modified( const lang::EventObject& rEO ) throw( RuntimeExcep
// ::com::sun::star::util::XChangesListener
void SwSmartTagMgr::changesOccurred( const util::ChangesEvent& rEvent ) throw( RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// Configuration has changed. We remove all existing smart tags:
SW_MOD()->CheckSpellChanges( sal_False, sal_True, sal_True, sal_True );
@@ -83,13 +82,4 @@ void SwSmartTagMgr::changesOccurred( const util::ChangesEvent& rEvent ) throw( R
SmartTagMgr::changesOccurred( rEvent );
}
-/*
-SmartTagMgr& SwSmartTagMgr::Get()
-{
- if ( !pSmartTagMgr )
- pSmartTagMgr = new SmartTagMgr( SwDocShell::Factory().GetModuleName() );
-
- return *pSmartTagMgr;
-}
-*/
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 1b6db5d3dc52..f7f87e160dad 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,11 +39,7 @@
// immer ~ 20 * MAXENTRY == 20000 Eintraege
const sal_uInt16 nBlockGrowSize = 20;
-#ifndef DBG_UTIL
-
-#define CHECKIDX( p, n, i, c )
-
-#else
+#if OSL_DEBUG_LEVEL > 2
#define CHECKIDX( p, n, i, c ) CheckIdx( p, n, i, c );
@@ -62,6 +59,10 @@ void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, sal_uLong nSize, sal_uInt16
DBG_ASSERT( nIdx == nSize, "BigPtrArray: Anzahl ungueltig" );
}
+#else
+
+#define CHECKIDX( p, n, i, c )
+
#endif
@@ -578,3 +579,4 @@ sal_uInt16 BigPtrArray::Compress( short nMax )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 29fc02a3f7e1..c571e389acf8 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,14 +32,10 @@
#include "breakit.hxx"
#include <unicode/uchar.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <unotools/localedatawrapper.hxx>
-#ifndef _SVX_LINGU_HXX
#include <editeng/unolingu.hxx>
-#endif
#include <editeng/scripttypeitem.hxx>
#include "swtypes.hxx"
@@ -71,18 +68,6 @@ SwBreakIt::SwBreakIt(
aForbiddenLang( LANGUAGE_DONTKNOW)
{
DBG_ASSERT( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
- //if ( m_xMSF.is() )
- //{
- // xBreak = uno::Reference< i18n::XBreakIterator >(
- // m_xMSF->createInstance(
- // rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) ),
- // uno::UNO_QUERY);
-
- // xCTLDetect = uno::Reference< i18n::XScriptTypeDetector >(
- // m_xMSF->createInstance(
- // rtl::OUString::createFromAscii( "com.sun.star.i18n.ScriptTypeDetector" ) ),
- // uno::UNO_QUERY);
- // }
}
SwBreakIt::~SwBreakIt()
@@ -184,3 +169,4 @@ sal_uInt16 SwBreakIt::GetAllScriptsOfText( const String& rTxt ) const
return nRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index b5622c150801..ba6aa92fadb6 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,6 @@
#endif
#include <cstdlib>
#include <climits>
-// #include <cmath>
#include <cfloat>
#include <hintids.hxx>
#include <osl/diagnose.hxx>
@@ -59,9 +59,7 @@
#include <dbfld.hxx>
#include <expfld.hxx>
#include <usrfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <docfld.hxx>
#include <swunodef.hxx>
#include <swtypes.hxx>
@@ -71,35 +69,35 @@ using namespace ::com::sun::star;
// tippt sich schneller
#define RESOURCE ViewShell::GetShellRes()
-const sal_Char __FAR_DATA sCalc_Add[] = "add";
-const sal_Char __FAR_DATA sCalc_Sub[] = "sub";
-const sal_Char __FAR_DATA sCalc_Mul[] = "mul";
-const sal_Char __FAR_DATA sCalc_Div[] = "div";
-const sal_Char __FAR_DATA sCalc_Phd[] = "phd";
-const sal_Char __FAR_DATA sCalc_Sqrt[] = "sqrt";
-const sal_Char __FAR_DATA sCalc_Pow[] = "pow";
-const sal_Char __FAR_DATA sCalc_Or[] = "or";
-const sal_Char __FAR_DATA sCalc_Xor[] = "xor";
-const sal_Char __FAR_DATA sCalc_And[] = "and";
-const sal_Char __FAR_DATA sCalc_Not[] = "not";
-const sal_Char __FAR_DATA sCalc_Eq[] = "eq";
-const sal_Char __FAR_DATA sCalc_Neq[] = "neq";
-const sal_Char __FAR_DATA sCalc_Leq[] = "leq";
-const sal_Char __FAR_DATA sCalc_Geq[] = "geq";
-const sal_Char __FAR_DATA sCalc_L[] = "l";
-const sal_Char __FAR_DATA sCalc_G[] = "g";
-const sal_Char __FAR_DATA sCalc_Sum[] = "sum";
-const sal_Char __FAR_DATA sCalc_Mean[] = "mean";
-const sal_Char __FAR_DATA sCalc_Min[] = "min";
-const sal_Char __FAR_DATA sCalc_Max[] = "max";
-const sal_Char __FAR_DATA sCalc_Sin[] = "sin";
-const sal_Char __FAR_DATA sCalc_Cos[] = "cos";
-const sal_Char __FAR_DATA sCalc_Tan[] = "tan";
-const sal_Char __FAR_DATA sCalc_Asin[] = "asin";
-const sal_Char __FAR_DATA sCalc_Acos[] = "acos";
-const sal_Char __FAR_DATA sCalc_Atan[] = "atan";
-const sal_Char __FAR_DATA sCalc_Round[] = "round";
-const sal_Char __FAR_DATA sCalc_Date[] = "date";
+const sal_Char sCalc_Add[] = "add";
+const sal_Char sCalc_Sub[] = "sub";
+const sal_Char sCalc_Mul[] = "mul";
+const sal_Char sCalc_Div[] = "div";
+const sal_Char sCalc_Phd[] = "phd";
+const sal_Char sCalc_Sqrt[] = "sqrt";
+const sal_Char sCalc_Pow[] = "pow";
+const sal_Char sCalc_Or[] = "or";
+const sal_Char sCalc_Xor[] = "xor";
+const sal_Char sCalc_And[] = "and";
+const sal_Char sCalc_Not[] = "not";
+const sal_Char sCalc_Eq[] = "eq";
+const sal_Char sCalc_Neq[] = "neq";
+const sal_Char sCalc_Leq[] = "leq";
+const sal_Char sCalc_Geq[] = "geq";
+const sal_Char sCalc_L[] = "l";
+const sal_Char sCalc_G[] = "g";
+const sal_Char sCalc_Sum[] = "sum";
+const sal_Char sCalc_Mean[] = "mean";
+const sal_Char sCalc_Min[] = "min";
+const sal_Char sCalc_Max[] = "max";
+const sal_Char sCalc_Sin[] = "sin";
+const sal_Char sCalc_Cos[] = "cos";
+const sal_Char sCalc_Tan[] = "tan";
+const sal_Char sCalc_Asin[] = "asin";
+const sal_Char sCalc_Acos[] = "acos";
+const sal_Char sCalc_Atan[] = "atan";
+const sal_Char sCalc_Round[] = "round";
+const sal_Char sCalc_Date[] = "date";
@@ -113,7 +111,7 @@ struct _CalcOp
SwCalcOper eOp;
};
-_CalcOp __READONLY_DATA aOpTable[] = {
+_CalcOp const aOpTable[] = {
/* ACOS */ {{sCalc_Acos}, CALC_ACOS}, // Arcuscosinus
/* ADD */ {{sCalc_Add}, CALC_PLUS}, // Addition
/* AND */ {{sCalc_And}, CALC_AND}, // log. und
@@ -145,13 +143,13 @@ _CalcOp __READONLY_DATA aOpTable[] = {
/* XOR */ {{sCalc_Xor}, CALC_XOR} // log. xoder
};
-double __READONLY_DATA nRoundVal[] = {
+double const nRoundVal[] = {
5.0e+0, 0.5e+0, 0.5e-1, 0.5e-2, 0.5e-3, 0.5e-4, 0.5e-5, 0.5e-6,
0.5e-7, 0.5e-8, 0.5e-9, 0.5e-10,0.5e-11,0.5e-12,0.5e-13,0.5e-14,
0.5e-15,0.5e-16
};
-double __READONLY_DATA nKorrVal[] = {
+double const nKorrVal[] = {
9, 9e-1, 9e-2, 9e-3, 9e-4, 9e-5, 9e-6, 9e-7, 9e-8,
9e-9, 9e-10, 9e-11, 9e-12, 9e-13, 9e-14
};
@@ -262,9 +260,6 @@ double lcl_ConvertToDateValue( SwDoc& rDoc, sal_Int32 nDate )
|*
|* SwCalc::SwCalc( SwDoc* pD ) :
|*
-|* Erstellung OK 12-02-93 11:04am
-|* Letzte Aenderung JP 03.11.95
-|*
|******************************************************************************/
SwCalc::SwCalc( SwDoc& rD )
@@ -294,7 +289,7 @@ SwCalc::SwCalc( SwDoc& rD )
sCurrSym.EraseLeadingChars().EraseTrailingChars();
pCharClass->toLower( sCurrSym );
-static sal_Char __READONLY_DATA
+static sal_Char const
sNType0[] = "false",
sNType1[] = "true",
sNType2[] = "pi",
@@ -325,7 +320,7 @@ static sal_Char __READONLY_DATA
sNType26[] = "graph"
;
-static const sal_Char* __READONLY_DATA sNTypeTab[ 27 ] =
+static const sal_Char* const sNTypeTab[ 27 ] =
{
sNType0, sNType1, sNType2, sNType3, sNType4, sNType5,
sNType6, sNType7, sNType8, sNType9, sNType10, sNType11,
@@ -336,25 +331,25 @@ static const sal_Char* __READONLY_DATA sNTypeTab[ 27 ] =
// diese sind mit doppelten HashIds
sNType25, sNType26
};
-static sal_uInt16 __READONLY_DATA aHashValue[ 27 ] =
+static sal_uInt16 const 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 sal_uInt16 __READONLY_DATA aAdrToken[ 12 ] =
+static sal_uInt16 const 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 sal_uInt16 SwDocStat::* __READONLY_DATA aDocStat1[ 3 ] =
+static sal_uInt16 SwDocStat::* const aDocStat1[ 3 ] =
{
&SwDocStat::nTbl, &SwDocStat::nGrf, &SwDocStat::nOLE
};
-static sal_uLong SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
+static sal_uLong SwDocStat::* const aDocStat2[ 4 ] =
{
&SwDocStat::nPage, &SwDocStat::nPara,
&SwDocStat::nWord, &SwDocStat::nChar
@@ -400,20 +395,12 @@ static sal_uLong SwDocStat::* __READONLY_DATA aDocStat2[ 4 ] =
sTmpStr.AssignAscii( sNTypeTab[ 25 ] );
VarTable[ aHashValue[ 25 ] ]->pNext = new SwCalcExp( sTmpStr, nVal, 0 );
-// at time its better not to use "graph", because then the im-/export have
-// to change in all formulas this name.
-// nVal.PutLong( rDocStat.*aDocStat1[ 1 ] );
-// VarTable[ aHashValue[ 26 ] ]->pNext = new SwCalcExp(
-// sNTypeTab[ 26 ], nVal, 0 );
}
/******************************************************************************
|*
|* SwCalc::~SwCalc()
|*
-|* Erstellung OK 12-02-93 11:04am
-|* Letzte Aenderung OK 12-02-93 11:04am
-|*
|******************************************************************************/
SwCalc::~SwCalc()
@@ -430,9 +417,6 @@ SwCalc::~SwCalc()
|*
|* SwSbxValue SwCalc::Calculate( const String& rStr )
|*
-|* Erstellung OK 12-02-93 11:04am
-|* Letzte Aenderung OK 12-02-93 11:04am
-|*
|******************************************************************************/
SwSbxValue SwCalc::Calculate( const String& rStr )
@@ -465,8 +449,6 @@ SwSbxValue SwCalc::Calculate( const String& rStr )
|* 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
-|* Letzte Aenderung JP 19.02.98
|*
|******************************************************************************/
@@ -508,9 +490,6 @@ String SwCalc::GetStrResult( double nValue, sal_Bool )
|*
|* SwCalcExp* SwCalc::VarLook( const String& )
|*
-|* Erstellung OK 12-02-93 11:04am
-|* Letzte Aenderung JP 15.11.99
-|*
|******************************************************************************/
SwCalcExp* SwCalc::VarInsert( const String &rStr )
@@ -524,9 +503,6 @@ SwCalcExp* SwCalc::VarInsert( const String &rStr )
|*
|* 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, sal_uInt16 ins )
{
@@ -591,7 +567,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
// Name(p)=Adress.PLZ oder Adress.DATENSATZNUMMER
// DBSETNUMBERFLD = DatenSATZ-nummernfeld (NICHT "setze Datensatznummer!!!")
- // #101436#: At this point the "real" case variable has to be used
+ // At this point the "real" case variable has to be used
String sTmpName( rStr );
::ReplacePoint( sTmpName );
@@ -608,7 +584,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
pMgr->OpenDataSource(sSourceName, sTableName, -1, false))
{
String sColumnName( GetColumnName( sTmpName ));
- ASSERT (sColumnName.Len(), "DB-Spaltenname fehlt!");
+ OSL_ENSURE(sColumnName.Len(), "DB-Spaltenname fehlt!");
String sDBNum( SwFieldType::GetTypeStr(TYP_DBSETNUMBERFLD) );
pCharClass->toLower(sDBNum);
@@ -658,7 +634,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
VarTable[ ii ] = pNewExp;
String sColumnName( GetColumnName( sTmpName ));
- ASSERT( sColumnName.Len(), "DB-Spaltenname fehlt!" );
+ OSL_ENSURE( sColumnName.Len(), "DB-Spaltenname fehlt!" );
if( sColumnName.EqualsIgnoreCaseAscii(
SwFieldType::GetTypeStr( TYP_DBSETNUMBERFLD ) ))
{
@@ -681,9 +657,6 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
|*
|* 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
-|*
|******************************************************************************/
void SwCalc::VarChange( const String& rStr, double nValue )
@@ -714,9 +687,6 @@ void SwCalc::VarChange( const String& rStr, const SwSbxValue& rValue )
|*
|* sal_Bool SwCalc::Push( const void* pPtr )
|*
-|* Erstellung OK 12-02-93 11:05am
-|* Letzte Aenderung OK 12-02-93 11:05am
-|*
|******************************************************************************/
sal_Bool SwCalc::Push( const VoidPtr pPtr )
@@ -732,14 +702,11 @@ sal_Bool SwCalc::Push( const VoidPtr pPtr )
|*
|* void SwCalc::Pop( const void* pPtr )
|*
-|* Erstellung OK 12-02-93 11:05am
-|* Letzte Aenderung OK 12-02-93 11:05am
-|*
|******************************************************************************/
void SwCalc::Pop( const VoidPtr )
{
- ASSERT( aRekurStk.Count(), "SwCalc: Pop auf ungueltigen Ptr" );
+ OSL_ENSURE( aRekurStk.Count(), "SwCalc: Pop auf ungueltigen Ptr" );
aRekurStk.Remove( aRekurStk.Count() - 1 );
}
@@ -749,16 +716,13 @@ void SwCalc::Pop( const VoidPtr )
|*
|* SwCalcOper SwCalc::GetToken()
|*
-|* Erstellung OK 12-02-93 11:05am
-|* Letzte Aenderung JP 03.11.95
-|*
|******************************************************************************/
SwCalcOper SwCalc::GetToken()
{
#if OSL_DEBUG_LEVEL > 1
-//JP 25.01.2001: static for switch back to the "old" implementation of the
-// calculator, which don't use the I18N routines.
+//static for switch back to the "old" implementation of the
+//calculator, which don't use the I18N routines.
static int nUseOld = 0;
if( !nUseOld )
{
@@ -1103,8 +1067,7 @@ else
}
break;
- default: if( ch && pCharClass->isLetter( sCommand, nCommandPos - 1)
- || '_' == ch )
+ default: if (ch && (pCharClass->isLetter( sCommand, nCommandPos - 1) || '_' == ch))
{
xub_StrLen nStt = nCommandPos-1;
while( 0 != (ch = NextCh( sCommand, nCommandPos )) &&
@@ -1164,9 +1127,6 @@ else
|*
|* SwSbxValue SwCalc::Term()
|*
-|* Erstellung OK 12-02-93 11:05am
-|* Letzte Aenderung JP 16.01.96
-|*
|******************************************************************************/
SwSbxValue SwCalc::Term()
@@ -1179,10 +1139,6 @@ SwSbxValue SwCalc::Term()
switch( eCurrOper )
{
-// wir haben kein Bitweises verodern, oder ?
-// case CALC_AND: eSbxOper = SbxAND; break;
-// case CALC_OR: eSbxOper = SbxOR; break;
-// case CALC_XOR: eSbxOper = SbxXOR; break;
case CALC_AND: {
GetToken();
sal_Bool bB = Prim().GetBool();
@@ -1310,33 +1266,8 @@ SwSbxValue SwCalc::Term()
}
break;
-/*
-// removed here because of #77448# (=2*3^2 != 18)
- case CALC_POW: {
- GetToken();
- double fraction, integer;
- double right = Prim().GetDouble(),
- dleft = left.GetDouble();
+//#77448# (=2*3^2 != 18)
- fraction = modf( right, &integer );
- if( ( dleft < 0.0 && 0.0 != fraction ) ||
- ( 0.0 == dleft && right < 0.0 ) )
- {
- eError = CALC_OVERFLOW;
- left.Clear();
- return left;
- }
- dleft = pow(dleft, right );
- if( dleft == HUGE_VAL )
- {
- eError = CALC_POWERR;
- left.Clear();
- return left;
- }
- left.PutDouble( dleft );
- }
- break;
-*/
default: return left;
}
@@ -1367,9 +1298,6 @@ SwSbxValue SwCalc::Term()
|*
|* SwSbxValue SwCalc::Prim()
|*
-|* Erstellung OK 12-02-93 11:05am
-|* Letzte Aenderung JP 03.11.95
-|*
|******************************************************************************/
extern "C" typedef double (*pfCalc)( double );
@@ -1405,7 +1333,7 @@ SwSbxValue SwCalc::Prim()
nErg.PutLong( nErg.GetDouble() == 0.0 ? 1 : 0 );
else
{
- DBG_ERROR( "unexpected case. computing binary NOT" );
+ OSL_FAIL( "unexpected case. computing binary NOT" );
//!! computes a binary NOT
nErg.Compute( SbxNOT, nErg );
}
@@ -1502,7 +1430,6 @@ SwSbxValue SwCalc::Prim()
eError = CALC_OVERFLOW;
}
- // added here because of #77448# (=2*3^2 should be 18)
if( bChkPow && eCurrOper == CALC_POW )
{
double dleft = nErg.GetDouble();
@@ -1540,9 +1467,6 @@ SwSbxValue SwCalc::Prim()
|*
|* SwSbxValue SwCalc::Expr()
|*
-|* Erstellung OK 12-02-93 11:06am
-|* Letzte Aenderung JP 03.11.95
-|*
|******************************************************************************/
SwSbxValue SwCalc::Expr()
@@ -1634,9 +1558,6 @@ lcl_Str2Double( const String& rCommand, xub_StrLen& rCommandPos, double& rVal,
/******************************************************************************
* Methode : sal_Bool SwCalc::Str2Double( double& )
- * Beschreibung:
- * Erstellt : OK 07.06.94 12:56
- * Aenderung : JP 27.10.98
******************************************************************************/
bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
double& rVal, const LocaleDataWrapper* const pLclData )
@@ -1703,9 +1624,6 @@ sal_Bool SwCalc::IsValidVarName( const String& rStr,
|*
|* CTOR DTOR der SwHash classes
|*
-|* Ersterstellung OK 25.06.93 12:20
-|* Letzte Aenderung OK 25.06.93 12:20
-|*
******************************************************************************/
SwHash::SwHash( const String& rStr ) :
@@ -1764,7 +1682,7 @@ double SwSbxValue::GetDouble() const
SwSbxValue& SwSbxValue::MakeDouble()
{
- if( SbxSTRING == GetType() )
+ if( GetType() == SbxSTRING || GetType() == SbxBOOL )
PutDouble( GetDouble() );
return *this;
}
@@ -1824,3 +1742,4 @@ static const sal_Char* sNTypeTab[ 27 ] =
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/checkit.cxx b/sw/source/core/bastyp/checkit.cxx
index 9e5ee1f368fd..ec4a3b8e8aed 100644
--- a/sw/source/core/bastyp/checkit.cxx
+++ b/sw/source/core/bastyp/checkit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@ SwCheckIt::SwCheckIt()
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
Reference < XInterface > xI = xMSF->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.i18n.InputSequenceChecker" ) );
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
if ( xI.is() )
{
Any x = xI->queryInterface( ::getCppuType((const Reference< XExtendedInputSequenceChecker >*)0) );
@@ -49,3 +50,4 @@ SwCheckIt::SwCheckIt()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index d22c781169b3..32457b85c960 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,11 +33,9 @@
#include <stdlib.h> // fuer qsort
#include <tools/solar.h>
-#include "errhdl.hxx" // fuers ASSERT
#include "index.hxx"
-#include "error.h" // fuers ASSERT
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
int SwIndex::nSerial = 0;
#endif
@@ -44,46 +43,6 @@ int SwIndex::nSerial = 0;
TYPEINIT0(SwIndexReg); // rtti
-#ifdef CHK
-
-#define IDX_CHK_ARRAY pArray->ChhkArr();
-#define ARR_CHK_ARRAY ChhkArr();
-
-
-void SwIndexReg::ChkArr()
-{
- ASSERT( (pFirst && pLast) || (!pFirst && !pLast),
- "Array falsch Indiziert" );
-
- if( !pFirst )
- return;
-
- xub_StrLen nVal = 0;
- const SwIndex* pIdx = pFirst, *pPrev = 0;
- ASSERT( !pIdx->pPrev, "Array-pFirst nicht am Anfang" );
-
- while( pIdx != pLast )
- {
- ASSERT( pIdx->pPrev != pIdx && pIdx->pNext != pIdx,
- "Index zeigt auf sich selbst" )
-
- ASSERT( pIdx->nIndex >= nVal, "Reihenfolge stimmt nicht" );
- ASSERT( pPrev == pIdx->pPrev, "Verkettung stimmt nicht" );
- pPrev = pIdx;
- pIdx = pIdx->pNext;
- nVal = pPrev->nIndex;
- }
-}
-
-#else // CHK
-
-#define IDX_CHK_ARRAY
-#define ARR_CHK_ARRAY
-
-#endif // CHK
-
-
-
SwIndex::SwIndex(SwIndexReg *const pArr, xub_StrLen const nIdx)
: nIndex( nIdx ), pArray( pArr ), pNext( 0 ), pPrev( 0 )
{
@@ -93,17 +52,16 @@ SwIndex::SwIndex(SwIndexReg *const pArr, xub_StrLen const nIdx)
nIndex = 0; // steht immer auf 0 !!!
}
- if( !pArray->pFirst ) // 1. Index ??
+ if( !pArray->pFirst || !pArray->pLast ) // 1. Index ??
pArray->pFirst = pArray->pLast = this;
else if( nIdx > ((pArray->pLast->nIndex - pArray->pFirst->nIndex) / 2) )
ChgValue( *pArray->pLast, nIdx );
else
ChgValue( *pArray->pFirst, nIdx );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
-IDX_CHK_ARRAY
}
@@ -112,10 +70,9 @@ SwIndex::SwIndex( const SwIndex& rIdx, short nIdx )
{
ChgValue( rIdx, rIdx.nIndex + nIdx );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
-IDX_CHK_ARRAY
}
@@ -123,10 +80,9 @@ SwIndex::SwIndex( const SwIndex& rIdx )
: nIndex( rIdx.nIndex ), pArray( rIdx.pArray ), pNext( 0 ), pPrev( 0 )
{
ChgValue( rIdx, rIdx.nIndex );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
-IDX_CHK_ARRAY
}
@@ -221,8 +177,6 @@ SwIndex& SwIndex::ChgValue( const SwIndex& rIdx, xub_StrLen nNewValue )
nIndex = nNewValue;
-IDX_CHK_ARRAY
-
return *this; }
@@ -237,18 +191,10 @@ void SwIndex::Remove()
pArray->pLast = pPrev;
else
pNext->pPrev = pPrev;
-
-IDX_CHK_ARRAY
}
/*************************************************************************
-|*
|* SwIndex & SwIndex::operator=( const SwIndex & aSwIndex )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
@@ -271,13 +217,7 @@ SwIndex& SwIndex::operator=( const SwIndex& rIdx )
}
/*************************************************************************
-|*
|* SwIndex &SwIndex::Assign
-|*
-|* Beschreibung
-|* Ersterstellung VB 25.03.91
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
@@ -306,7 +246,6 @@ SwIndex& SwIndex::Assign( SwIndexReg* pArr, xub_StrLen nIdx )
}
else if( nIndex != nIdx )
ChgValue( *this, nIdx );
-IDX_CHK_ARRAY
return *this;
}
@@ -320,7 +259,7 @@ SwIndexReg::SwIndexReg()
SwIndexReg::~SwIndexReg()
{
- ASSERT( !pFirst || !pLast, "Es sind noch Indizies angemeldet" );
+ OSL_ENSURE( !pFirst || !pLast, "Es sind noch Indizies angemeldet" );
}
@@ -365,205 +304,134 @@ void SwIndexReg::Update( SwIndex const & rIdx, const xub_StrLen nDiff,
pStt = pStt->pNext;
}
}
-ARR_CHK_ARRAY
}
-#ifdef DBG_UTIL
-#ifndef CFRONT
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
-|*
|* SwIndex::operator++()
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
xub_StrLen SwIndex::operator++(int)
{
- ASSERT_ID( nIndex < INVALID_INDEX, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex < INVALID_INDEX );
xub_StrLen nOldIndex = nIndex;
ChgValue( *this, nIndex+1 );
return nOldIndex;
}
-#endif
xub_StrLen SwIndex::operator++()
{
- ASSERT_ID( nIndex < INVALID_INDEX, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex < INVALID_INDEX );
ChgValue( *this, nIndex+1 );
return nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator--()
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
-#ifndef CFRONT
xub_StrLen SwIndex::operator--(int)
{
- ASSERT_ID( nIndex, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex );
xub_StrLen nOldIndex = nIndex;
ChgValue( *this, nIndex-1 );
return nOldIndex;
}
-#endif
xub_StrLen SwIndex::operator--()
{
- ASSERT_ID( nIndex, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex );
return ChgValue( *this, nIndex-1 ).nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator+=( xub_StrLen )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
xub_StrLen SwIndex::operator+=( xub_StrLen nWert )
{
- ASSERT_ID( nIndex < INVALID_INDEX - nWert, ERR_OUTOFSCOPE);
+ OSL_ASSERT( nIndex < INVALID_INDEX - nWert );
return ChgValue( *this, nIndex + nWert ).nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator-=( xub_StrLen )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
xub_StrLen SwIndex::operator-=( xub_StrLen nWert )
{
- ASSERT_ID( nIndex >= nWert, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex >= nWert );
return ChgValue( *this, nIndex - nWert ).nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator+=( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
xub_StrLen SwIndex::operator+=( const SwIndex & rIndex )
{
- ASSERT_ID( nIndex < INVALID_INDEX - rIndex.nIndex, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex < INVALID_INDEX - rIndex.nIndex );
return ChgValue( *this, nIndex + rIndex.nIndex ).nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator-=( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
xub_StrLen SwIndex::operator-=( const SwIndex & rIndex )
{
- ASSERT_ID( nIndex >= rIndex.nIndex, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nIndex >= rIndex.nIndex );
return ChgValue( *this, nIndex - rIndex.nIndex ).nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator<( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
sal_Bool SwIndex::operator<( const SwIndex & rIndex ) const
{
- ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
+ OSL_ENSURE( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex < rIndex.nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator<=( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 04.06.92
-|*
*************************************************************************/
sal_Bool SwIndex::operator<=( const SwIndex & rIndex ) const
{
- ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
+ OSL_ENSURE( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex <= rIndex.nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator>( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 04.06.92
-|*
*************************************************************************/
sal_Bool SwIndex::operator>( const SwIndex & rIndex ) const
{
- ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
+ OSL_ENSURE( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex > rIndex.nIndex;
}
/*************************************************************************
-|*
|* SwIndex::operator>=( const SwIndex & )
-|*
-|* Beschreibung
-|* Ersterstellung JP 07.11.90
-|* Letzte Aenderung JP 04.06.92
-|*
*************************************************************************/
sal_Bool SwIndex::operator>=( const SwIndex & rIndex ) const
{
- ASSERT( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
+ OSL_ENSURE( pArray == rIndex.pArray, "Attempt to compare indices into different arrays.");
return nIndex >= rIndex.nIndex;
}
/*************************************************************************
-|*
|* SwIndex & SwIndex::operator=( xub_StrLen )
-|*
-|* Beschreibung
-|* Ersterstellung JP 10.12.90
-|* Letzte Aenderung JP 07.03.94
-|*
*************************************************************************/
SwIndex& SwIndex::operator=( xub_StrLen nWert )
@@ -591,3 +459,5 @@ void SwIndexReg::MoveTo( SwIndexReg& rArr )
pFirst = 0, pLast = 0;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index e150f5f0ae26..270385c63bbb 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,9 +67,7 @@
#include <editeng/charrotateitem.hxx>
#include <editeng/charreliefitem.hxx>
#include <editeng/frmdiritem.hxx>
-#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
-#endif
#include <editeng/swafopt.hxx>
#include <editeng/svxacorr.hxx>
#include <unotools/charclass.hxx>
@@ -103,7 +102,6 @@
#include <fmtfordr.hxx>
#include <fmtflcnt.hxx>
#include <fchrfmt.hxx>
-#include <fmtautofmt.hxx>
#include <fmtinfmt.hxx>
#include <fmtcnct.hxx>
#include <fmtline.hxx>
@@ -131,9 +129,7 @@
#include <swcalwrp.hxx>
#include <SwStyleNameMapper.hxx>
-// OD 09.10.2003 #i18732#
#include <fmtfollowtextflow.hxx>
-// OD 2004-05-05 #i28701#
#include <fmtwrapinfluenceonobjpos.hxx>
#include <fmtmeta.hxx>
@@ -148,15 +144,14 @@ extern void ClearFEShellTabCols();
|* einige Bereiche fuer die Set in Collections / Nodes
|*************************************************************************/
// AttrSet-Range fuer die 2 Break-Attribute
-sal_uInt16 __FAR_DATA aBreakSetRange[] = {
+sal_uInt16 aBreakSetRange[] = {
RES_PAGEDESC, RES_BREAK,
0 };
// AttrSet-Range fuer die TxtFmtColl
- // OD 2008-02-27 #refactorlists# :
// list attributes ( RES_PARATR_LIST_BEGIN - RES_PARATR_LIST_END ) are not
// included in the paragraph style's itemset.
-sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[] = {
+sal_uInt16 aTxtFmtCollSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
@@ -165,7 +160,7 @@ sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[] = {
};
// AttrSet-Range fuer die GrfFmtColl
-sal_uInt16 __FAR_DATA aGrfFmtCollSetRange[] = {
+sal_uInt16 aGrfFmtCollSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -173,26 +168,24 @@ sal_uInt16 __FAR_DATA aGrfFmtCollSetRange[] = {
};
// AttrSet-Range fuer die TextNode
-sal_uInt16 __FAR_DATA aTxtNodeSetRange[] = {
+sal_uInt16 aTxtNodeSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
// AttrSet-Range fuer die NoTxtNode
-sal_uInt16 __FAR_DATA aNoTxtNodeSetRange[] = {
+sal_uInt16 aNoTxtNodeSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
-sal_uInt16 __FAR_DATA aTableSetRange[] = {
+sal_uInt16 aTableSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_BREAK,
RES_BACKGROUND, RES_SHADOW,
@@ -207,7 +200,7 @@ sal_uInt16 __FAR_DATA aTableSetRange[] = {
0
};
-sal_uInt16 __FAR_DATA aTableLineSetRange[] = {
+sal_uInt16 aTableLineSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
@@ -218,7 +211,7 @@ sal_uInt16 __FAR_DATA aTableLineSetRange[] = {
0
};
-sal_uInt16 __FAR_DATA aTableBoxSetRange[] = {
+sal_uInt16 aTableBoxSetRange[] = {
RES_FILL_ORDER, RES_FRM_SIZE,
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
@@ -231,21 +224,21 @@ sal_uInt16 __FAR_DATA aTableBoxSetRange[] = {
};
// AttrSet-Range fuer die SwFrmFmt
-sal_uInt16 __FAR_DATA aFrmFmtSetRange[] = {
+sal_uInt16 aFrmFmtSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
// AttrSet-Range fuer die SwCharFmt
-sal_uInt16 __FAR_DATA aCharFmtSetRange[] = {
+sal_uInt16 aCharFmtSetRange[] = {
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
// AttrSet-Range fuer die character autostyles
-sal_uInt16 __FAR_DATA aCharAutoFmtSetRange[] = {
+sal_uInt16 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 +246,7 @@ sal_uInt16 __FAR_DATA aCharAutoFmtSetRange[] = {
};
// AttrSet-Range fuer die SwPageDescFmt
-sal_uInt16 __FAR_DATA aPgFrmFmtSetRange[] = {
+sal_uInt16 aPgFrmFmtSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
@@ -263,9 +256,9 @@ sal_uInt16 __FAR_DATA aPgFrmFmtSetRange[] = {
* lege eine Tabelle fuer einen Zugriff auf die
* Default-Format-Attribute an
******************************************************************************/
-SwDfltAttrTab __FAR_DATA aAttrTab;
+SwDfltAttrTab aAttrTab;
-SfxItemInfo __FAR_DATA aSlotTab[] =
+SfxItemInfo aSlotTab[] =
{
{ SID_ATTR_CHAR_CASEMAP, SFX_ITEM_POOLABLE }, // RES_CHRATR_CASEMAP
{ SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEM_POOLABLE }, // RES_CHRATR_CHARSETCOLOR
@@ -336,10 +329,8 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ SID_ATTR_PARA_HYPHENZONE, SFX_ITEM_POOLABLE }, // RES_PARATR_HYPHENZONE
{ FN_FORMAT_DROPCAPS, 0 }, // RES_PARATR_DROP
{ SID_ATTR_PARA_REGISTER, SFX_ITEM_POOLABLE }, // RES_PARATR_REGISTER
- // --> OD 2008-03-04 #refactorlists#
// RES_PARATR_NUMRULE is now poolable
{ SID_ATTR_PARA_NUMRULE, SFX_ITEM_POOLABLE }, // RES_PARATR_NUMRULE
- // <--
{ SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE }, // RES_PARATR_SCRIPTSPACE
{ SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE },// RES_PARATR_HANGINGPUNCTUATION
@@ -350,13 +341,11 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ SID_ATTR_PARA_OUTLINE_LEVEL, SFX_ITEM_POOLABLE }, // RES_PARATR_OUTLINELEVEL //#outline level,zhaojianwei
- // --> OD 2008-02-19 #refactorlists#
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ID
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_LEVEL
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ISRESTART
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_RESTARTVALUE
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ISCOUNTED
- // <--
{ 0, SFX_ITEM_POOLABLE }, // RES_FILL_ORDER
{ 0, SFX_ITEM_POOLABLE }, // RES_FRM_SIZE
@@ -396,12 +385,11 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ SID_ATTR_HDFT_DYNAMIC_SPACING, SFX_ITEM_POOLABLE }, // RES_HEADER_FOOTER_EAT_SPACING
{ FN_TABLE_ROW_SPLIT, SFX_ITEM_POOLABLE }, // RES_ROW_SPLIT
- // DVO, OD 18.09.2003 #i18732# - use slot-id define in svx
+ // #i18732# - use slot-id define in svx
{ SID_SW_FOLLOW_TEXT_FLOW, SFX_ITEM_POOLABLE }, // RES_FOLLOW_TEXT_FLOW
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // collapsing borders #i29550#
{ SID_SW_COLLAPSING_BORDERS, SFX_ITEM_POOLABLE }, // RES_COLLAPSING_BORDERS
- // <-- collapsing
- // OD 2004-05-04 #i28701#
+ // #i28701#
{ SID_SW_WRAP_INFLUENCE_ON_OBJPOS, SFX_ITEM_POOLABLE }, // RES_WRAP_INFLUENCE_ON_OBJPOS
{ 0, 0 }, // RES_AUTO_STYLE
{ 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_STYLE_NAME
@@ -437,18 +425,18 @@ 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#
+// #i18732#
sal_uInt16* SwAttrPool::pVersionMap5 = 0;
sal_uInt16* SwAttrPool::pVersionMap6 = 0;
SwIndexReg* SwIndexReg::pEmptyIndexArray = 0;
-const sal_Char* __FAR_DATA pMarkToTable = "table";
-const sal_Char* __FAR_DATA pMarkToFrame = "frame";
-const sal_Char* __FAR_DATA pMarkToRegion = "region";
-const sal_Char* __FAR_DATA pMarkToText = "text";
-const sal_Char* __FAR_DATA pMarkToOutline = "outline";
-const sal_Char* __FAR_DATA pMarkToGraphic = "graphic";
-const sal_Char* __FAR_DATA pMarkToOLE = "ole";
+const sal_Char* pMarkToTable = "table";
+const sal_Char* pMarkToFrame = "frame";
+const sal_Char* pMarkToRegion = "region";
+const sal_Char* pMarkToText = "text";
+const sal_Char* pMarkToOutline = "outline";
+const sal_Char* pMarkToGraphic = "graphic";
+const sal_Char* pMarkToOLE = "ole";
SvPtrarr *pGlobalOLEExcludeList = 0;
@@ -572,13 +560,11 @@ void _InitCore()
aAttrTab[ RES_PARATR_OUTLINELEVEL - POOLATTR_BEGIN ] = new SfxUInt16Item( RES_PARATR_OUTLINELEVEL, 0 );//#outline level,zhaojianwei
- // --> 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, 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, sal_True );
- // <--
aAttrTab[ RES_FILL_ORDER- POOLATTR_BEGIN ] = new SwFmtFillOrder;
aAttrTab[ RES_FRM_SIZE- POOLATTR_BEGIN ] = new SwFmtFrmSize;
@@ -616,13 +602,12 @@ void _InitCore()
aAttrTab[ RES_FRAMEDIR - POOLATTR_BEGIN ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, RES_FRAMEDIR );
aAttrTab[ RES_ROW_SPLIT - POOLATTR_BEGIN ] = new SwFmtRowSplit;
- // OD 18.09.2003 #i18732#
+ // #i18732#
aAttrTab[ RES_FOLLOW_TEXT_FLOW - POOLATTR_BEGIN ] = new SwFmtFollowTextFlow( sal_True );
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // collapsing borders #i29550#
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
+ // #i28701#
+ // #i35017# - constant name has changed
aAttrTab[ RES_WRAP_INFLUENCE_ON_OBJPOS - POOLATTR_BEGIN ] =
new SwFmtWrapInfluenceOnObjPos( text::WrapInfluenceOnPosition::ONCE_CONCURRENT );
// <--
@@ -712,7 +697,7 @@ void _InitCore()
for ( i = 66; i <= 121; ++i )
SwAttrPool::pVersionMap4[ i-1 ] = i + 9;
- // OD 2004-01-21 #i18732# - setup new version map due to extension of
+ // #i18732# - setup new version map due to extension of
// the frame attributes (RES_FRMATR_*) for binary filters.
SwAttrPool::pVersionMap5 = new sal_uInt16[ 130 ];
for( i = 1; i <= 109; i++ )
@@ -733,9 +718,6 @@ void _InitCore()
SwBreakIt::_Create( xMSF );
pCheckIt = NULL;
- /*pAppCharClass = new CharClass(
- xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));*/
- //pCalendarWrapper = new SwCalendarWrapper( xMSF );
_FrmInit();
_TextInit();
@@ -777,7 +759,7 @@ void _FinitCore()
delete SwEditShell::pAutoFmtFlags;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//Defaultattribut freigeben lassen um asserts zu vermeiden.
if ( aAttrTab[0]->GetRefCount() )
SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, sal_False);
@@ -836,7 +818,7 @@ void _FinitCore()
delete[] SwAttrPool::pVersionMap2;
delete[] SwAttrPool::pVersionMap3;
delete[] SwAttrPool::pVersionMap4;
- // OD 2004-01-21 #i18732#
+ // #i18732#
delete[] SwAttrPool::pVersionMap5;
delete[] SwAttrPool::pVersionMap6;
@@ -916,3 +898,5 @@ const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
}
return *pTransWrp;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/ring.cxx b/sw/source/core/bastyp/ring.cxx
index 1831093a1d19..697bb9f3c80a 100644
--- a/sw/source/core/bastyp/ring.cxx
+++ b/sw/source/core/bastyp/ring.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,12 +35,7 @@
/*************************************************************************
-|*
|* Ring::Ring()
-|*
-|* Ersterstellung VB 02.07.91
-|* Letzte Aenderung JP 10.10.97
-|*
*************************************************************************/
Ring::Ring( Ring *pObj )
@@ -56,12 +52,7 @@ Ring::Ring( Ring *pObj )
}
/*************************************************************************
-|*
|* Ring::~Ring()
-|*
-|* Ersterstellung VB 02.07.91
-|* Letzte Aenderung JP 10.10.97
-|*
*************************************************************************/
Ring::~Ring()
@@ -71,12 +62,7 @@ Ring::~Ring()
}
/*************************************************************************
-|*
|* Ring::MoveTo
-|*
-|* Ersterstellung VB 4.3.91
-|* Letzte Aenderung JP 10.10.97
-|*
*************************************************************************/
void Ring::MoveTo(Ring *pDestRing)
@@ -123,3 +109,4 @@ sal_uInt32 Ring::numberOf() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index e3db1a266648..34502cdcc920 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,29 +29,22 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <tools/debug.hxx>
-#include <errhdl.hxx>
#include <swcache.hxx>
SV_IMPL_PTRARR(SwCacheObjArr,SwCacheObj*);
-#ifndef DBG_UTIL
-#define INCREMENT( nVar )
-#else
+#if OSL_DEBUG_LEVEL > 1
#define INCREMENT( nVar ) ++nVar
+#else
+#define INCREMENT( nVar )
#endif
/*************************************************************************
-|*
|* SwCache::Check()
-|*
-|* Ersterstellung MA 23. Mar. 94
-|* Letzte Aenderung MA 23. Mar. 94
-|*
|*************************************************************************/
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwCache::Check()
{
@@ -58,8 +52,8 @@ void SwCache::Check()
return;
//Konsistenspruefung.
- ASSERT( !pLast->GetNext(), "Last but not last." );
- ASSERT( !pRealFirst->GetPrev(), "First but not first." );
+ OSL_ENSURE( !pLast->GetNext(), "Last but not last." );
+ OSL_ENSURE( !pRealFirst->GetPrev(), "First but not first." );
sal_uInt16 nCnt = 0;
sal_Bool bFirstFound = sal_False;
SwCacheObj *pObj = pRealFirst;
@@ -70,41 +64,36 @@ void SwCache::Check()
SwCacheObj *pTmp = pLast;
while ( pTmp && pTmp != pObj )
pTmp = pTmp->GetPrev();
- ASSERT( pTmp, "Objekt not found." );
+ OSL_ENSURE( pTmp, "Objekt not found." );
++nCnt;
if ( pObj == pFirst )
bFirstFound = sal_True;
if ( !pObj->GetNext() )
- ASSERT( pObj == pLast, "Last not Found." );
+ OSL_ENSURE( pObj == pLast, "Last not Found." );
pObj = pObj->GetNext();
- ASSERT( pObj != pRekursive, "Recursion in SwCache." );
+ OSL_ENSURE( pObj != pRekursive, "Recursion in SwCache." );
}
- ASSERT( bFirstFound, "First not Found." );
- ASSERT( (nCnt + aFreePositions.Count()) == Count(), "Lost Chain." );
+ OSL_ENSURE( bFirstFound, "First not Found." );
+ OSL_ENSURE( (nCnt + aFreePositions.Count()) == Count(), "Lost Chain." );
if ( Count() == nCurMax )
- ASSERT( (nCurMax - nCnt) == aFreePositions.Count(), "Lost FreePositions." );
+ OSL_ENSURE( (nCurMax - nCnt) == aFreePositions.Count(), "Lost FreePositions." );
}
#endif
-#if defined(DBG_UTIL) && defined(MADEBUG)
+#if OSL_DEBUG_LEVEL > 1
#define CHECK Check();
#else
#define CHECK
#endif
/*************************************************************************
-|*
|* SwCache::SwCache(), ~SwCache()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 15. Mar. 94
-|*
|*************************************************************************/
SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, const ByteString &rNm
#endif
) :
@@ -115,7 +104,7 @@ SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
pLast( 0 ),
nMax( nInitSize ),
nCurMax( nInitSize )
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, aName( rNm ),
nAppend( 0 ),
nInsertFree( 0 ),
@@ -134,12 +123,9 @@ SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
{
}
-#ifdef DBG_UTIL
-
-
+#if OSL_DEBUG_LEVEL > 1
SwCache::~SwCache()
{
-#if OSL_DEBUG_LEVEL > 1
{
ByteString sOut( aName ); sOut += '\n';
(( sOut += "Anzahl neuer Eintraege: " )
@@ -172,17 +158,11 @@ SwCache::~SwCache()
DBG_ERROR( sOut.GetBuffer() );
}
Check();
-#endif
}
#endif
/*************************************************************************
-|*
|* SwCache::Flush()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 15. Mar. 94
-|*
|*************************************************************************/
@@ -194,10 +174,10 @@ void SwCache::Flush( const sal_uInt8 )
SwCacheObj *pTmp;
while ( pObj )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( pObj->IsLocked() )
{
- ASSERT( sal_True, "Flushing locked objects." );
+ OSL_ENSURE( TRUE, "Flushing locked objects." );
if ( !pRealFirst )
{
pRealFirst = pFirst = pLast = pObj;
@@ -228,12 +208,7 @@ void SwCache::Flush( const sal_uInt8 )
}
/*************************************************************************
-|*
|* SwCache::ToTop()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 24. Apr. 95
-|*
|*************************************************************************/
@@ -249,7 +224,7 @@ void SwCache::ToTop( SwCacheObj *pObj )
if ( !pRealFirst )
{ //Der erste wird eingetragen.
- ASSERT( !pFirst && !pLast, "First not first." );
+ OSL_ENSURE( !pFirst && !pLast, "First not first." );
pRealFirst = pFirst = pLast = pObj;
CHECK;
return;
@@ -258,7 +233,7 @@ void SwCache::ToTop( SwCacheObj *pObj )
//Ausschneiden.
if ( pObj == pLast )
{
- ASSERT( pObj->GetPrev(), "Last but no Prev." );
+ OSL_ENSURE( pObj->GetPrev(), "Last but no Prev." );
pLast = pObj->GetPrev();
pLast->SetNext( 0 );
}
@@ -281,7 +256,7 @@ void SwCache::ToTop( SwCacheObj *pObj )
}
else
{
- ASSERT( pFirst, "ToTop, First ist not RealFirst an Empty." );
+ OSL_ENSURE( pFirst, "ToTop, First ist not RealFirst an Empty." );
if ( pFirst->GetPrev() )
{
@@ -298,12 +273,7 @@ void SwCache::ToTop( SwCacheObj *pObj )
}
/*************************************************************************
-|*
|* SwCache::Get()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 22. Aug. 94
-|*
|*************************************************************************/
@@ -319,7 +289,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const sal_uInt16 nIndex,
ToTop( pRet );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( pRet )
++nGetSuccess;
else
@@ -343,7 +313,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const sal_Bool bToTop )
if ( bToTop && pRet && pRet != pFirst )
ToTop( pRet );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( pRet )
++nGetSuccess;
else
@@ -354,19 +324,14 @@ SwCacheObj *SwCache::Get( const void *pOwner, const sal_Bool bToTop )
}
/*************************************************************************
-|*
|* SwCache::Delete()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 15. Mar. 94
-|*
|*************************************************************************/
void SwCache::DeleteObj( SwCacheObj *pObj )
{
CHECK;
- ASSERT( !pObj->IsLocked(), "SwCache::Delete: Object ist Locked." );
+ OSL_ENSURE( !pObj->IsLocked(), "SwCache::Delete: Object ist Locked." );
if ( pObj->IsLocked() )
return;
@@ -414,20 +379,6 @@ void SwCache::DeleteObj( SwCacheObj *pObj )
CHECK;
}
-/*
-
-
-void SwCache::Delete( const void *pOwner, const sal_uInt16 nIndex )
-{
- INCREMENT( nDelete );
- SwCacheObj *pObj;
- if ( 0 != (pObj = Get( pOwner, nIndex, sal_False )) )
- DeleteObj( pObj );
-}
-*/
-
-
-
void SwCache::Delete( const void *pOwner )
{
INCREMENT( nDelete );
@@ -438,19 +389,14 @@ void SwCache::Delete( const void *pOwner )
/*************************************************************************
-|*
|* SwCache::Insert()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 20. Sep. 94
-|*
|*************************************************************************/
sal_Bool SwCache::Insert( SwCacheObj *pNew )
{
CHECK;
- ASSERT( !pNew->GetPrev() && !pNew->GetNext(), "New but not new." );
+ OSL_ENSURE( !pNew->GetPrev() && !pNew->GetNext(), "New but not new." );
sal_uInt16 nPos;//Wird hinter den if's zum setzen am Obj benutzt.
if ( Count() < nCurMax )
@@ -479,13 +425,13 @@ sal_Bool SwCache::Insert( SwCacheObj *pNew )
pObj = pObj->GetPrev();
if ( !pObj )
{
- ASSERT( sal_False, "Cache overflow." );
+ OSL_ENSURE( sal_False, "Cache overflow." );
return sal_False;
}
nPos = pObj->GetCachePos();
if ( pObj == pLast )
- { ASSERT( pObj->GetPrev(), "Last but no Prev" );
+ { OSL_ENSURE( pObj->GetPrev(), "Last but no Prev" );
pLast = pObj->GetPrev();
pLast->SetNext( 0 );
}
@@ -513,7 +459,7 @@ sal_Bool SwCache::Insert( SwCacheObj *pNew )
pNew->SetNext( pFirst );
}
else
- { ASSERT( !pLast, "Last but no First." );
+ { OSL_ENSURE( !pLast, "Last but no First." );
pLast = pNew;
}
if ( pFirst == pRealFirst )
@@ -525,12 +471,7 @@ sal_Bool SwCache::Insert( SwCacheObj *pNew )
}
/*************************************************************************
-|*
|* SwCache::SetLRUOfst()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 15. Mar. 94
-|*
|*************************************************************************/
@@ -552,12 +493,7 @@ void SwCache::SetLRUOfst( const sal_uInt16 nOfst )
}
/*************************************************************************
-|*
|* SwCacheObj::SwCacheObj()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 24. Nov. 95
-|*
|*************************************************************************/
@@ -577,21 +513,14 @@ SwCacheObj::~SwCacheObj()
}
/*************************************************************************
-|*
|* SwCacheObj::SetLock(), Unlock()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 15. Mar. 94
-|*
|*************************************************************************/
-#ifdef DBG_UTIL
-
-
+#if OSL_DEBUG_LEVEL > 1
void SwCacheObj::Lock()
{
- ASSERT( nLock < UCHAR_MAX, "To many Locks for CacheObject." );
+ OSL_ENSURE( nLock < UCHAR_MAX, "To many Locks for CacheObject." );
++nLock;
}
@@ -599,7 +528,7 @@ void SwCacheObj::Lock()
void SwCacheObj::Unlock()
{
- ASSERT( nLock, "No more Locks available." );
+ OSL_ENSURE( nLock, "No more Locks available." );
--nLock;
}
#endif
@@ -612,18 +541,12 @@ SwCacheAccess::~SwCacheAccess()
}
/*************************************************************************
-|*
|* SwCacheAccess::Get()
-|*
-|* Ersterstellung MA 15. Mar. 94
-|* Letzte Aenderung MA 04. Apr. 95
-|*
|*************************************************************************/
-
void SwCacheAccess::_Get()
{
- ASSERT( !pObj, "SwCacheAcces Obj already available." );
+ OSL_ENSURE( !pObj, "SwCacheAcces Obj already available." );
pObj = NewObj();
if ( !rCache.Insert( pObj ) )
@@ -636,21 +559,12 @@ void SwCacheAccess::_Get()
}
/*************************************************************************
-|*
|* SwCacheAccess::IsAvailable()
-|*
-|* Ersterstellung MA 23. Mar. 94
-|* Letzte Aenderung MA 23. Mar. 94
-|*
|*************************************************************************/
-
sal_Bool SwCacheAccess::IsAvailable() const
{
return pObj != 0;
}
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 701f7dbbd69c..616c375f70d1 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,9 @@
#include "precompiled_sw.hxx"
-#ifdef DBG_UTIL
-#ifndef _STREAM_HXX //autogen
+#if OSL_DEBUG_LEVEL > 1
#include <tools/stream.hxx>
#endif
-#endif
#include <stdlib.h>
#include "swrect.hxx"
#include <math.h>
@@ -42,9 +41,6 @@
|*
|* SwRect::SwRect()
|*
-|* Ersterstellung MA 02. Feb. 93
-|* Letzte Aenderung MA 05. Sep. 93
-|*
|*************************************************************************/
@@ -62,30 +58,17 @@ SwRect::SwRect( const Rectangle &rRect ) :
|*
|* SwRect::Center()
|*
-|* Ersterstellung MA 27. Jan. 93
-|* Letzte Aenderung MA 27. Jan. 93
-|*
|*************************************************************************/
Point SwRect::Center() const
{
return Point( Left() + Width() / 2,
Top() + Height() / 2 );
-
-/* Wer ruft schon ein Center auf ein "falsches" Rechteck?
- const long nRight = Right();
- const long nBottom= Bottom();
- return Point( min( Left(), nRight ) + long(abs( (nRight - Left())/2) ),
- min( Top(), nBottom) + long(abs( (nBottom - Top())/2)));
-*/
}
/*************************************************************************
|*
|* SwRect::Union()
|*
-|* Ersterstellung MA 27. Jan. 93
-|* Letzte Aenderung MA 27. Jan. 93
-|*
|*************************************************************************/
@@ -108,9 +91,6 @@ SwRect& SwRect::Union( const SwRect& rRect )
|*
|* SwRect::Intersection(), _Intersection()
|*
-|* Ersterstellung MA 27. Jan. 93
-|* Letzte Aenderung MA 05. Sep. 93
-|*
|*************************************************************************/
@@ -163,9 +143,6 @@ SwRect& SwRect::_Intersection( const SwRect& rRect )
|*
|* SwRect::IsInside()
|*
-|* Ersterstellung MA 27. Jan. 93
-|* Letzte Aenderung MA 27. Jan. 93
-|*
|*************************************************************************/
@@ -207,9 +184,6 @@ sal_Bool SwRect::IsNear( const Point& rPoint, long nTolerance ) const
|*
|* SwRect::IsOver()
|*
-|* Ersterstellung MA 25. Feb. 94
-|* Letzte Aenderung MA 27. Jun. 96
-|*
|*************************************************************************/
@@ -226,9 +200,6 @@ sal_Bool SwRect::IsOver( const SwRect& rRect ) const
|*
|* SwRect::Justify()
|*
-|* Ersterstellung MA 10. Oct. 94
-|* Letzte Aenderung MA 23. Oct. 96
-|*
|*************************************************************************/
@@ -318,7 +289,7 @@ void SwRect::SetUpperRightCorner( const Point& rNew )
void SwRect::SetLowerLeftCorner( const Point& rNew )
{ m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* operator<<( ostream&, SwRect&)
*************************************************************************/
@@ -334,3 +305,4 @@ SvStream &operator<<( SvStream &rStream, const SwRect &rRect )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index e2b4829b563c..5b812314da95 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,12 +41,7 @@
SV_IMPL_VARARR( SwRects, SwRect );
/*************************************************************************
-|*
|* SwRegionRects::SwRegionRects()
-|*
-|* Ersterstellung MA 28. Oct. 92
-|* Letzte Aenderung MA 01. Feb. 93
-|*
|*************************************************************************/
SwRegionRects::SwRegionRects( const SwRect &rStartRect, sal_uInt16 nInit,
@@ -86,8 +82,6 @@ inline void SwRegionRects::InsertRect( const SwRect &rRect, const sal_uInt16 nPo
|* entfernt.
|* Dazu muessen die vorhandenen Rechtecke entweder aufgeteilt oder
|* geloescht werden.
-|* Ersterstellung MA 28. Oct. 92
-|* Letzte Aenderung MA 09. Sep. 93
|*
|*************************************************************************/
@@ -195,8 +189,6 @@ void SwRegionRects::Invert()
|* SwRegionRects::Compress()
|*
|* Beschreibung Zusammenfassen von benachbarten Rechtecken.
-|* Ersterstellung MA 16. Apr. 93
-|* Letzte Aenderung MA 21. Apr. 93
|*
|*************************************************************************/
inline SwTwips CalcArea( const SwRect &rRect )
@@ -252,3 +244,4 @@ void SwRegionRects::Compress( sal_Bool bFuzzy )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx
index 3015d8cf4b44..a683ed170c0f 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,3 +133,4 @@ uno::Reference< beans::XPropertySet > GetLinguPropertySet()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/tabcol.cxx b/sw/source/core/bastyp/tabcol.cxx
index bf5b4b06084f..a6c943b8dcde 100644
--- a/sw/source/core/bastyp/tabcol.cxx
+++ b/sw/source/core/bastyp/tabcol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include "tabcol.hxx"
-#include <errhdl.hxx> // fuer Create-Methoden
SwTabCols::SwTabCols( sal_uInt16 nSize ) :
@@ -60,11 +60,11 @@ SwTabCols::SwTabCols( const SwTabCols& rCpy ) :
SwTabColsEntry aEntry2 = rCpy.GetData()[i];
(void) aEntry1;
(void) aEntry2;
- ASSERT( aEntry1.nPos == aEntry2.nPos &&
+ OSL_ENSURE( aEntry1.nPos == aEntry2.nPos &&
aEntry1.nMin == aEntry2.nMin &&
aEntry1.nMax == aEntry2.nMax &&
aEntry1.bHidden == aEntry2.bHidden,
- "CopyContructor of SwTabColsEntries did not succeed!" )
+ "CopyContructor of SwTabColsEntries did not succeed!" );
}
#endif
}
@@ -140,3 +140,4 @@ void SwTabCols::Remove( sal_uInt16 nPos, sal_uInt16 nAnz )
aData.erase( aStart, aStart + nAnz );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/BlockCursor.cxx b/sw/source/core/crsr/BlockCursor.cxx
index 589549c0ade8..45e5c0c7291e 100644
--- a/sw/source/core/crsr/BlockCursor.cxx
+++ b/sw/source/core/crsr/BlockCursor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,3 +105,4 @@ IBlockCursor *createBlockCursor( const SwCrsrShell& rCrsrSh, const SwPosition &r
return new SwBlockCursor( rCrsrSh, rPos );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/BlockCursor.hxx b/sw/source/core/crsr/BlockCursor.hxx
index a3acb0bac187..aced7c582cd1 100644
--- a/sw/source/core/crsr/BlockCursor.hxx
+++ b/sw/source/core/crsr/BlockCursor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,3 +35,5 @@ struct SwPosition;
IBlockCursor *createBlockCursor(const SwCrsrShell& rCrsrSh, const SwPosition &rPos);
#endif //_BLOCKURSOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/IBlockCursor.hxx b/sw/source/core/crsr/IBlockCursor.hxx
index 99b5cf3b734a..da3c3c3ef383 100644
--- a/sw/source/core/crsr/IBlockCursor.hxx
+++ b/sw/source/core/crsr/IBlockCursor.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,4 @@ class Point;
#endif // IBLOCKCURSOR_HXX_INCLUDED
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 18dc67cfc958..12b32dd6a853 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,6 @@
#include <IDocumentMarkAccess.hxx>
#include <IDocumentUndoRedo.hxx>
#include <doc.hxx>
-#include <errhdl.hxx>
#include <ndtxt.hxx>
#include <pam.hxx>
#include <swserv.hxx>
@@ -84,17 +84,20 @@ namespace
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);
+ xub_StrLen nEndPos = rEnd.nContent.GetIndex() == 0 ? 0 : rEnd.nContent.GetIndex() - 1;
+ const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos );
SwPaM aStartPaM(rStart);
SwPaM aEndPaM(rEnd);
io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
- if(ch_start != aStartMark)
+ if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) )
{
io_pDoc->InsertString(aStartPaM, aStartMark);
+ rStart.nContent--;
}
- if ( aEndMark && ( ch_end != aEndMark ) && ( rStart != rEnd ) )
+ if ( aEndMark && ( ch_end != aEndMark ) )
{
io_pDoc->InsertString(aEndPaM, aEndMark);
+ rEnd.nContent++;
}
io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL);
};
@@ -118,19 +121,17 @@ namespace sw { namespace mark
bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const
{
- return GetMarkStart() <= rPos && rPos <= GetMarkEnd();
+ return GetMarkStart() <= rPos && rPos < GetMarkEnd();
}
void MarkBase::SetMarkPos(const SwPosition& rNewPos)
{
::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
- //lcl_FixPosition(*m_pPos1);
}
void MarkBase::SetOtherMarkPos(const SwPosition& rNewPos)
{
::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos2);
- //lcl_FixPosition(*m_pPos2);
}
rtl::OUString MarkBase::ToString( ) const
@@ -180,13 +181,13 @@ namespace sw { namespace mark
: MarkBase(rPaM, our_sNamePrefix)
{ }
- const ::rtl::OUString NavigatorReminder::our_sNamePrefix = ::rtl::OUString::createFromAscii("__NavigatorReminder__");
+ const ::rtl::OUString NavigatorReminder::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__NavigatorReminder__"));
UnoMark::UnoMark(const SwPaM& aPaM)
: MarkBase(aPaM, MarkBase::GenerateNewName(our_sNamePrefix))
{ }
- const ::rtl::OUString UnoMark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__UnoMark__");
+ const ::rtl::OUString UnoMark::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__UnoMark__"));
DdeBookmark::DdeBookmark(const SwPaM& aPaM)
: MarkBase(aPaM, MarkBase::GenerateNewName(our_sNamePrefix))
@@ -198,7 +199,7 @@ namespace sw { namespace mark
m_aRefObj = pObj;
}
- const ::rtl::OUString DdeBookmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__DdeLink__");
+ const ::rtl::OUString DdeBookmark::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__DdeLink__"));
void DdeBookmark::DeregisterFromDoc(SwDoc* const pDoc)
{
@@ -308,7 +309,7 @@ namespace sw { namespace mark
aPaM.InvalidatePaM();
}
- const ::rtl::OUString Fieldmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__Fieldmark__");
+ const ::rtl::OUString Fieldmark::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__Fieldmark__"));
TextFieldmark::TextFieldmark(const SwPaM& rPaM)
: Fieldmark(rPaM)
@@ -325,7 +326,7 @@ namespace sw { namespace mark
void CheckboxFieldmark::InitDoc(SwDoc* const io_pDoc)
{
- lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FORMELEMENT, CH_TXT_ATR_FIELDEND);
+ lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FORMELEMENT);
// For some reason the end mark is moved from 1 by the Insert: we don't
// want this for checkboxes
@@ -333,16 +334,38 @@ namespace sw { namespace mark
}
void CheckboxFieldmark::SetChecked(bool checked)
{
- (*GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT)] = makeAny(checked);
+ if ( IsChecked() != checked )
+ {
+ (*GetParameters())[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_RESULT))] = makeAny(checked);
+ // mark document as modified
+ SwDoc *const pDoc( GetMarkPos().GetDoc() );
+ if ( pDoc )
+ pDoc->SetModified();
+ }
}
bool CheckboxFieldmark::IsChecked() const
{
bool bResult = false;
- parameter_map_t::const_iterator pResult = GetParameters()->find(::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT));
+ parameter_map_t::const_iterator pResult = GetParameters()->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX_RESULT)));
if(pResult != GetParameters()->end())
pResult->second >>= bResult;
return bResult;
}
+ rtl::OUString CheckboxFieldmark::toString( ) const
+ {
+ rtl::OUStringBuffer buf;
+ buf.appendAscii( "CheckboxFieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " );
+ buf.append( m_aName ).appendAscii( ", " );
+ buf.append( GetFieldname() ).appendAscii( ", [ " );
+ buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
+ buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" );
+ buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
+ buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " );
+
+ return buf.makeStringAndClear( );
+ }
}}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 74275c1014ef..7a496a422298 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <fmtcntnt.hxx>
#include <txatbase.hxx>
#include <frmatr.hxx>
@@ -43,10 +42,15 @@
#include <doc.hxx>
#include <frmfmt.hxx>
#include <txtfrm.hxx>
+#include <tabfrm.hxx>
+#include <rowfrm.hxx>
+#include <fmtfsize.hxx>
#include <ndtxt.hxx>
#include <flyfrm.hxx>
#include <breakit.hxx>
+#include<vcl/window.hxx>
+
SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt,
sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection )
@@ -60,7 +64,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCn
SwCallLink::SwCallLink( SwCrsrShell & rSh )
: rShell( rSh )
{
- // SPoint-Werte vom aktuellen Cursor merken
+ // remember SPoint-values of current cursor
SwPaM* pCrsr = rShell.IsTableMode() ? rShell.GetTblCrs() : rShell.GetCrsr();
SwNode& rNd = pCrsr->GetPoint()->nNode.GetNode();
nNode = rNd.GetIndex();
@@ -75,10 +79,11 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
{
nLeftFrmPos = 0;
- // eine Sonderbehandlung fuer die SwFeShell: diese setzt beim Loeschen
- // der Kopf-/Fusszeile, Fussnoten den Cursor auf NULL (Node + Content)
- // steht der Cursor auf keinem CntntNode, wird sich das im NdType
- // gespeichert.
+ // A special treatment for SwFeShell:
+ // When deleting the header/footer, footnotes SwFeShell sets the
+ // Cursor to NULL (Node + Content).
+ // If the Cursor is not on a CntntNode (ContentNode) this fact gets
+ // saved in NdType.
if( ND_CONTENTNODE & nNdTyp )
nNdTyp = 0;
}
@@ -87,31 +92,67 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
SwCallLink::~SwCallLink()
{
- if( !nNdTyp || !rShell.bCallChgLnk ) // siehe ctor
+ if( !nNdTyp || !rShell.bCallChgLnk ) // see ctor
return ;
- // wird ueber Nodes getravellt, Formate ueberpruefen und im neuen
- // Node wieder anmelden
+ // If travelling over Nodes check formats and register them anew at the
+ // new Node.
SwPaM* pCurCrsr = rShell.IsTableMode() ? rShell.GetTblCrs() : rShell.GetCrsr();
SwCntntNode * pCNd = pCurCrsr->GetCntntNode();
if( !pCNd )
return;
+ SwFrm *myFrm=pCNd->GetFrm();
+ if (myFrm!=NULL)
+ {
+ // We need to emulated a change of the row height in order
+ // to have the complete row redrawn
+ SwRowFrm* pRow = myFrm->FindRowFrm( );
+ if ( pRow )
+ {
+ const SwTableLine* pLine = pRow->GetTabLine( );
+ SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
+ pRow->Modify( NULL, &pSize );
+ }
+ }
+
+ const SwDoc *pDoc=rShell.GetDoc();
+ const SwCntntNode *pNode = NULL;
+ if ( ( pDoc != NULL && nNode < pDoc->GetNodes( ).Count( ) ) )
+ {
+ pNode = pDoc->GetNodes()[nNode]->GetCntntNode();
+ }
+ if ( pNode != NULL )
+ {
+ SwFrm *myFrm2=pNode->GetFrm();
+ if (myFrm2!=NULL)
+ {
+ // We need to emulated a change of the row height in order
+ // to have the complete row redrawn
+ SwRowFrm* pRow = myFrm2->FindRowFrm();
+ if ( pRow )
+ {
+ const SwTableLine* pLine = pRow->GetTabLine( );
+ SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
+ pRow->Modify( NULL, &pSize );
+ }
+ }
+ }
+
xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.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.
+ // Register the Shell as dependent at the current Node. By doing this all
+ // attribute changes can be signaled over the link.
pCNd->Add( &rShell );
if( nNdTyp != nNdWhich || nNode != nAktNode )
{
- /* immer, wenn zwischen Nodes gesprungen wird, kann es
- * vorkommen, das neue Attribute gelten; die Text-Attribute.
- * Es muesste also festgestellt werden, welche Attribute
- * jetzt gelten; das kann auch gleich der Handler machen
- */
+ // Every time a switch between nodes occurs, there is a chance that
+ // new attributes do apply - meaning text-attributes.
+ // So the currently applying attributes would have to be determined.
+ // That can be done in one go by the handler.
rShell.CallChgLnk();
}
else if( !bHasSelection != !(*pCurCrsr->GetPoint() != *pCurCrsr->GetMark()) )
@@ -122,14 +163,14 @@ SwCallLink::~SwCallLink()
else if( rShell.aChgLnk.IsSet() && ND_TEXTNODE == nNdWhich &&
nCntnt != nAktCntnt )
{
- // nur wenn mit Left/right getravellt, dann Text-Hints pruefen
- // und sich nicht der Frame geaendert hat (Spalten!)
+ // If travelling with left/right only and the frame is
+ // unchanged (columns!) then check text hints.
if( nLeftFrmPos == SwCallLink::GetFrm( (SwTxtNode&)*pCNd, nAktCntnt,
!rShell.ActionPend() ) &&
(( nCmp = nCntnt ) + 1 == nAktCntnt || // Right
nCntnt -1 == ( nCmp = nAktCntnt )) ) // Left
{
- if( nCmp == nAktCntnt && pCurCrsr->HasMark() ) // left & Sele
+ if( nCmp == nAktCntnt && pCurCrsr->HasMark() ) // left & select
++nCmp;
if ( ((SwTxtNode*)pCNd)->HasHints() )
{
@@ -145,8 +186,8 @@ SwCallLink::~SwCallLink()
pEnd = pHt->GetEnd();
nStart = *pHt->GetStart();
- // nur Start oder Start und Ende gleich, dann immer
- // beim Ueberlaufen von Start callen
+ // If "only start" or "start and end equal" then call on
+ // every overflow of start.
if( ( !pEnd || ( nStart == *pEnd ) ) &&
( nStart == nCntnt || nStart == nAktCntnt) )
{
@@ -154,9 +195,9 @@ SwCallLink::~SwCallLink()
return;
}
- // hat das Attribut einen Bereich und dieser nicht leer
+ // If the attribute has an area and that area is not empty ...
else if( pEnd && nStart < *pEnd &&
- // dann teste, ob ueber Start/Ende getravellt wurde
+ // ... then test if travelling occurred via start/end.
( nStart == nCmp ||
( pHt->DontExpand() ? nCmp == *pEnd-1
: nCmp == *pEnd ) ))
@@ -181,11 +222,9 @@ SwCallLink::~SwCallLink()
}
}
else
- /* wenn mit Home/End/.. mehr als 1 Zeichen getravellt, dann
- * immer den ChgLnk rufen, denn es kann hier nicht
- * festgestellt werden, was sich geaendert; etwas kann
- * veraendert sein.
- */
+ // If travelling more than one character with home/end/.. then
+ // always call ChgLnk, because it can not be determined here what
+ // has changed. Something may have changed.
rShell.CallChgLnk();
}
@@ -195,7 +234,7 @@ SwCallLink::~SwCallLink()
0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() )
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
- ASSERT( pIndex, "Fly ohne Cntnt" );
+ OSL_ENSURE( pIndex, "Fly ohne Cntnt" );
if (!pIndex)
return;
@@ -223,3 +262,4 @@ long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm )
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index ad2ea384cc8b..b710b5db96c3 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ public:
#endif // _CALLNK_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 0ef82902ff08..33a2c686ebaa 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -251,10 +252,12 @@ bool SwCrsrShell::GotoFieldmark(::sw::mark::IFieldmark const * const pMark)
// watch Crsr-Moves
CrsrStateHelper aCrsrSt(*this);
aCrsrSt.SetCrsrToMark(pMark);
- //aCrsrSt.m_pCrsr->GetPoint()->nContent--;
- //aCrsrSt.m_pCrsr->GetMark()->nContent++;
+ aCrsrSt.m_pCrsr->GetPoint()->nContent++;
+ aCrsrSt.m_pCrsr->GetMark()->nContent--;
if(aCrsrSt.RollbackIfIllegal()) return false;
UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
return true;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index dc083801ee8e..3f649ef7ed56 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,8 +32,7 @@
#include <crossrefbookmark.hxx>
#include <ndtxt.hxx>
-using namespace rtl;
-
+using ::rtl::OUString;
namespace sw { namespace mark
{
CrossRefBookmark::CrossRefBookmark(const SwPaM& rPaM,
@@ -79,7 +79,7 @@ namespace sw { namespace mark
: CrossRefBookmark(rPaM, rCode, rName, rShortName, our_sNamePrefix)
{ }
- const ::rtl::OUString CrossRefHeadingBookmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__RefHeading__");
+ const ::rtl::OUString CrossRefHeadingBookmark::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__RefHeading__"));
bool CrossRefHeadingBookmark::IsLegalName(const ::rtl::OUString& rName)
{
@@ -93,10 +93,12 @@ namespace sw { namespace mark
: CrossRefBookmark(rPaM, rCode, rName, rShortName, our_sNamePrefix)
{ }
- const ::rtl::OUString CrossRefNumItemBookmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__RefNumPara__");
+ const ::rtl::OUString CrossRefNumItemBookmark::our_sNamePrefix(RTL_CONSTASCII_USTRINGPARAM("__RefNumPara__"));
bool CrossRefNumItemBookmark::IsLegalName(const ::rtl::OUString& rName)
{
return rName.match(our_sNamePrefix);
}
}}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 8e77c070d62d..7ec342cfd3bc 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,7 +133,7 @@ void CheckRange( SwCursor* pCurCrsr )
SwPaM * SwCrsrShell::CreateCrsr()
{
// Innerhalb der Tabellen-SSelection keinen neuen Crsr anlegen
- ASSERT( !IsTableMode(), "in Tabellen SSelection" );
+ OSL_ENSURE( !IsTableMode(), "in Tabellen SSelection" );
// neuen Cursor als Kopie vom akt. und in den Ring aufnehmen
// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
@@ -141,9 +142,7 @@ SwPaM * SwCrsrShell::CreateCrsr()
// hier den akt. Pam nur logisch Hiden, weil sonst die Invertierung
// vom kopierten Pam aufgehoben wird !!
- // #i75172# to be able to make a complete content swap, i moved this to a method
- // pNew->Insert( pCurCrsr, 0 );
- // pCurCrsr->Remove( 0, pCurCrsr->Count() );
+ // #i75172#
pNew->swapContent(*pCurCrsr);
pCurCrsr->DeleteMark();
@@ -159,7 +158,7 @@ SwPaM * SwCrsrShell::CreateCrsr()
sal_Bool SwCrsrShell::DestroyCrsr()
{
// Innerhalb der Tabellen-SSelection keinen neuen Crsr loeschen
- ASSERT( !IsTableMode(), "in Tabellen SSelection" );
+ OSL_ENSURE( !IsTableMode(), "in Tabellen SSelection" );
// ist ueberhaupt ein naechtser vorhanden ?
if(pCurCrsr->GetNext() == pCurCrsr)
@@ -240,16 +239,6 @@ void SwCrsrShell::StartAction()
void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
{
-/*
-//OS: Wird z.B. eine Basic-Action im Hintergrund ausgefuehrt, geht es so nicht
- if( !bHasFocus )
- {
- // hat die Shell nicht den Focus, dann nur das EndAction an
- // die ViewShell weitergeben.
- ViewShell::EndAction( bIdleEnd );
- return;
- }
-*/
sal_Bool bVis = bSVCrsrVis;
@@ -257,21 +246,6 @@ void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
if( bIdleEnd && Imp()->GetRegion() )
{
pCurCrsr->Hide();
-
-#ifdef SHOW_IDLE_REGION
-if( GetWin() )
-{
- GetWin()->Push();
- GetWin()->ChangePen( Pen( Color( COL_YELLOW )));
- for( sal_uInt16 n = 0; n < aPntReg.Count(); ++n )
- {
- SwRect aIRect( aPntReg[n] );
- GetWin()->DrawRect( aIRect.SVRect() );
- }
- GetWin()->Pop();
-}
-#endif
-
}
// vor der letzten Action alle invaliden Numerierungen updaten
@@ -297,7 +271,7 @@ if( GetWin() )
// mit der Basic-Klammerung entkoppelt; die Shells werden umgeschaltet
if( !BasicActionPend() )
{
- //JP 12.01.98: Bug #46496# - es muss innerhalb einer BasicAction
+ // es muss innerhalb einer BasicAction
// der Cursor geupdatet werden; um z.B. den
// TabellenCursor zu erzeugen. Im UpdateCrsr wird
// das jetzt beruecksichtigt!
@@ -344,18 +318,18 @@ if( GetWin() )
}
-#if defined(DBG_UTIL)
+#if OSL_DEBUG_LEVEL > 1
void SwCrsrShell::SttCrsrMove()
{
- ASSERT( nCrsrMove < USHRT_MAX, "To many nested CrsrMoves." );
+ OSL_ENSURE( nCrsrMove < USHRT_MAX, "To many nested CrsrMoves." );
++nCrsrMove;
StartAction();
}
void SwCrsrShell::EndCrsrMove( const sal_Bool bIdleEnd )
{
- ASSERT( nCrsrMove, "EndCrsrMove() ohne SttCrsrMove()." );
+ OSL_ENSURE( nCrsrMove, "EndCrsrMove() ohne SttCrsrMove()." );
EndAction( bIdleEnd );
if( !--nCrsrMove )
bInCMvVisportChgd = sal_False;
@@ -407,7 +381,7 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
else
{
const sal_Bool bSkipHidden = !GetViewOptions()->IsShowHiddenChar();
- // --> OD 2009-12-30 #i107447#
+ // #i107447#
// To avoid loop the reset of <bInFrontOfLabel> flag is no longer
// reflected in the return value <bRet>.
const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( sal_False );
@@ -418,7 +392,6 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
// undo reset of <bInFrontOfLabel> flag
SetInFrontOfLabel( sal_True );
}
- // <--
}
if( bRet )
@@ -428,7 +401,6 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
return bRet;
}
-// --> OD 2008-04-02 #refactorlists#
void SwCrsrShell::MarkListLevel( const String& sListId,
const int nListLevel )
{
@@ -463,8 +435,8 @@ void SwCrsrShell::UpdateMarkedListLevel()
{
if ( pTxtNd->IsInList() )
{
- ASSERT( pTxtNd->GetActualListLevel() >= 0 &&
- pTxtNd->GetActualListLevel() < MAXLEVEL, "Which level?")
+ OSL_ENSURE( pTxtNd->GetActualListLevel() >= 0 &&
+ pTxtNd->GetActualListLevel() < MAXLEVEL, "Which level?");
MarkListLevel( pTxtNd->GetListId(),
pTxtNd->GetActualListLevel() );
}
@@ -486,10 +458,8 @@ sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
SwShellCrsr* pTmpCrsr = getShellCrsr( true );
sal_Bool bRet = pTmpCrsr->UpDown( bUp, nCnt );
- // --> FME 2005-01-10 #i40019# UpDown should always reset the
- // bInFrontOfLabel flag:
+ // #i40019# UpDown should always reset the bInFrontOfLabel flag:
bRet = SetInFrontOfLabel(sal_False) || bRet;
- // <--
if( pBlockCrsr )
pBlockCrsr->clearPoints();
@@ -758,12 +728,11 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
*pCrsr->GetPoint() = aPos;
rAktCrsrPt = aPt;
- // --> FME 2005-01-31 #i41424# Only update the marked number levels if necessary
+ // #i41424# Only update the marked number levels if necessary
// Force update of marked number levels if necessary.
if ( bNewInFrontOfLabel || bOldInFrontOfLabel )
pCurCrsr->_SetInFrontOfLabel( !bNewInFrontOfLabel );
SetInFrontOfLabel( bNewInFrontOfLabel );
- // <--
if( !pCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
{
@@ -804,13 +773,13 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
void SwCrsrShell::TblCrsrToCursor()
{
- ASSERT( pTblCrsr, "TblCrsrToCursor: Why?" );
+ OSL_ENSURE( pTblCrsr, "TblCrsrToCursor: Why?" );
delete pTblCrsr, pTblCrsr = 0;
}
void SwCrsrShell::BlockCrsrToCrsr()
{
- ASSERT( pBlockCrsr, "BlockCrsrToCrsr: Why?" );
+ OSL_ENSURE( pBlockCrsr, "BlockCrsrToCrsr: Why?" );
if( pBlockCrsr && !HasSelection() )
{
SwPaM& rPam = pBlockCrsr->getShellCrsr();
@@ -1234,12 +1203,6 @@ void SwCrsrShell::VisPortChgd( const SwRect & rRect )
//angezeigt werden, deshalb wird der Aufruf hier geklammert.
ViewShell::VisPortChgd( rRect ); // Bereich verschieben
-/*
- SwRect aRect( rRect );
- if( VisArea().IsOver( aRect ) )
- pCurCrsr->Invalidate( aRect );
-*/
-
if( bSVCrsrVis && bVis ) // auch SV-Cursor wieder anzeigen
pVisCrsr->Show();
@@ -1296,7 +1259,7 @@ static void lcl_CheckHiddenSection( SwNodeIndex& rIdx )
#if OSL_DEBUG_LEVEL > 1
(void) pFrmNd;
- ASSERT( pFrmNd, "keinen Node mit Frames gefunden" );
+ OSL_ENSURE( pFrmNd, "keinen Node mit Frames gefunden" );
#endif
rIdx = aTmp;
}
@@ -1320,8 +1283,8 @@ static void lcl_CheckHiddenPara( SwPosition& rPos )
rPos = SwPosition( aTmp, SwIndex( pTxtNd, 0 ) );
}
-// --> OD 2005-12-14 #i27301# - helper class, which notifies the accessibility
-// about invalid text selections in its destructor
+// #i27301# - helper class, which notifies the accessibility about invalid text
+// selections in its destructor
class SwNotifyAccAboutInvalidTextSelections
{
private:
@@ -1344,10 +1307,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
ClearUpCrsrs();
- // erfrage den Count fuer die Start-/End-Actions und ob die Shell
- // ueberhaupt den Focus hat
-// if( ActionPend() /*|| !bHasFocus*/ )
- //JP 12.01.98: Bug #46496# - es muss innerhalb einer BasicAction der
+ // es muss innerhalb einer BasicAction der
// Cursor geupdatet werden; um z.B. den TabellenCursor zu
// erzeugen. Im EndAction wird jetzt das UpdateCrsr gerufen!
if( ActionPend() && BasicActionPend() )
@@ -1357,9 +1317,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
return; // wenn nicht, dann kein Update !!
}
- // --> OD 2005-12-14 #i27301#
+ // #i27301#
SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *this );
- // <--
if ( bIgnoreReadonly )
{
@@ -1402,10 +1361,10 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
SwCntntFrm *pTblFrm = pPos->nNode.GetNode().GetCntntNode()->
GetFrm( &aTmpPt, pPos );
- ASSERT( pTblFrm, "Tabelle Crsr nicht im Content ??" );
+ OSL_ENSURE( pTblFrm, "Tabelle Crsr nicht im Content ??" );
- // --> FME 2005-12-02 #126107# Make code robust. The table
- // cursor may point to a table in a currently inactive header.
+ // --> Make code robust. The table cursor may point
+ // to a table in a currently inactive header.
SwTabFrm *pTab = pTblFrm ? pTblFrm->FindTabFrm() : 0;
// <--
@@ -1418,19 +1377,18 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
if ( !bInRepeatedHeadline )
{
SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() );
- ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
+ OSL_ENSURE( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
if ( pMarkTblFrm )
{
SwTabFrm* pMarkTab = pMarkTblFrm->FindTabFrm();
- ASSERT( pMarkTab, "Tabelle Crsr nicht im Content ??" );
+ OSL_ENSURE( pMarkTab, "Tabelle Crsr nicht im Content ??" );
- // --> FME 2005-11-28 #120360# Make code robust:
+ // Make code robust:
if ( pMarkTab )
{
bInRepeatedHeadline = pMarkTab->IsFollow() && pMarkTab->IsInHeadline( *pMarkTblFrm );
}
- // <--
}
}
@@ -1479,14 +1437,13 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
Point aCentrPt( aCharRect.Center() );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
pTblFrm->GetCrsrOfst( pTblCrsr->GetPoint(), aCentrPt, &aTmpState );
-#ifndef DBG_UTIL
- pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() );
-#else
+#if OSL_DEBUG_LEVEL > 1
if ( !pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() ) )
- ASSERT( !this, "GetCharRect failed." );
+ OSL_ENSURE( !this, "GetCharRect failed." );
+#else
+ pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint() );
#endif
}
-// ALIGNRECT( aCharRect );
pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken
// Curosr in den sichtbaren Bereich scrollen
@@ -1586,7 +1543,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
UpdateCrsrPos();
- // #100722# The cursor must always point into content; there's some code
+ // The cursor must always point into content; there's some code
// that relies on this. (E.g. in SwEditShell::GetScriptType, which always
// loops _behind_ the last node in the selection, which always works if you
// are in content.) To achieve this, we'll force cursor(s) to point into
@@ -1644,7 +1601,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
} while( !pFrm );
}
else if ( Imp()->IsIdleAction() )
- //Wir stellen sicher, dass anstaendig Formatiert wurde #42224#
+ //Wir stellen sicher, dass anstaendig Formatiert wurde
pFrm->PrepareCrsr();
// im geschuetzten Fly? aber bei Rahmenselektion ignorieren
@@ -1713,7 +1670,6 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
rPt = aCharRect.Center();
pFrm->GetCrsrOfst( pShellCrsr->GetPoint(), rPt, &aTmpState );
}
-// ALIGNRECT( aCharRect );
if( !pShellCrsr->HasMark() )
aCrsrHeight = aTmpState.aRealHeight;
@@ -1738,7 +1694,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
// siehe Bug: 29658
if( !--nLoopCnt )
{
- ASSERT( !this, "Endlosschleife? CharRect != OldCharRect ");
+ OSL_ENSURE( !this, "Endlosschleife? CharRect != OldCharRect ");
break;
}
aOld = aCharRect;
@@ -1823,7 +1779,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
void SwCrsrShell::RefreshBlockCursor()
{
- ASSERT( pBlockCrsr, "Don't call me without a block cursor" );
+ OSL_ENSURE( pBlockCrsr, "Don't call me without a block cursor" );
SwShellCrsr &rBlock = pBlockCrsr->getShellCrsr();
Point aPt = rBlock.GetPtPos();
SwCntntFrm* pFrm = rBlock.GetCntntNode()->GetFrm( &aPt, rBlock.GetPoint() );
@@ -1860,7 +1816,7 @@ void SwCrsrShell::RefreshBlockCursor()
std::list<SwPaM*>::iterator pStart = aSelList.getStart();
std::list<SwPaM*>::iterator pPam = aSelList.getEnd();
- ASSERT( pPam != pStart, "FillSelection should deliver at least one PaM" )
+ OSL_ENSURE( pPam != pStart, "FillSelection should deliver at least one PaM" );
pCurCrsr->SetMark();
--pPam;
// If there is only one text portion inside the rectangle, a simple
@@ -2027,11 +1983,11 @@ void SwCrsrShell::Combine()
SwCrsrSaveState aSaveState( *pCurCrsr );
if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde
{
-#ifndef DBG_UTIL
- CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
-#else
+#if OSL_DEBUG_LEVEL > 1
if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ))
- ASSERT( !this, "StackCrsr & akt. Crsr nicht in gleicher Section." );
+ OSL_ENSURE( !this, "StackCrsr & akt. Crsr nicht in gleicher Section." );
+#else
+ CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
#endif
// kopiere das GetMark
if( !pCurCrsr->HasMark() )
@@ -2280,7 +2236,7 @@ sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount )
SwPosition* pPos = bEnd ? pCurCrsr->End() : pCurCrsr->Start();
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "kein TextNode, wie soll erweitert werden?" );
+ OSL_ENSURE( pTxtNd, "kein TextNode, wie soll erweitert werden?" );
xub_StrLen nPos = pPos->nContent.GetIndex();
if( bEnd )
@@ -2336,7 +2292,6 @@ sal_Bool SwCrsrShell::SetVisCrsr( const Point &rPt )
SwRect aTmp( aCharRect );
pFrm->GetCharRect( aCharRect, aPos, &aTmpState );
-// ALIGNRECT( aCharRect );
if( aTmp == aCharRect && // BUG 10137: bleibt der Cursor auf der
pVisCrsr->IsVisible() ) // Position nicht hidden & showen
@@ -2349,9 +2304,6 @@ sal_Bool SwCrsrShell::SetVisCrsr( const Point &rPt )
pCurCrsr->Show();
}
- // Bug 29584: bei Rahmenselektion ist der Cursor versteckt, aber den
- // D&D-Cursor will man trotzdem haben
-// if( bSVCrsrVis )
{
if( aTmpState.bRealHeight )
aCrsrHeight = aTmpState.aRealHeight;
@@ -2372,9 +2324,8 @@ sal_Bool SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const
Point aPt( rPt );
SwPaM aPam( *pCurCrsr->GetPoint() );
GetLayout()->GetCrsrOfst( aPam.GetPoint(), aPt );
- // --> FME 2004-06-29 #114856# Formular view
+ // Formular view
return aPam.HasReadonlySel( GetViewOptions()->IsFormView() );
- // <--
}
@@ -2448,8 +2399,6 @@ sal_Bool SwCrsrShell::ParkTblCrsr()
#* Methode : ParkCrsr
#* Beschreibung: Vernichtet Selektionen und zus. Crsr aller Shell der
#* verbleibende Crsr der Shell wird geparkt.
-#* Datum : MA 05. Nov. 92
-#* Update : JP 19.09.97
#***********************************************************************/
void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing )
@@ -2587,10 +2536,8 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
SwModify( 0 ), pCrsrStk( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
pBoxIdx( 0 ), pBoxPtr( 0 ), nCrsrMove( 0 ), nBasicActionCnt( 0 ),
eMvState( MV_NONE ),
- // --> OD 2008-04-02 #refactorlists#
sMarkedListId(),
nMarkedListLevel( 0 )
- // <--
{
SET_CURR_SHELL( this );
// Nur die Position vom aktuellen Cursor aus der Copy-Shell uebernehmen
@@ -2603,8 +2550,6 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = sal_True;
bSetCrsrInReadOnly = sal_True;
pVisCrsr = new SwVisCrsr( this );
-// UpdateCrsr( 0 );
- // OD 11.02.2003 #100556#
mbMacroExecAllowed = rShell.IsMacroExecAllowed();
}
@@ -2619,10 +2564,8 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin,
SwModify( 0 ), pCrsrStk( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
pBoxIdx( 0 ), pBoxPtr( 0 ), nCrsrMove( 0 ), nBasicActionCnt( 0 ),
eMvState( MV_NONE ), // state for crsr-travelling - GetCrsrOfst
- // --> OD 2008-04-02 #refactorlists#
sMarkedListId(),
nMarkedListLevel( 0 )
- // <--
{
SET_CURR_SHELL( this );
/*
@@ -2647,8 +2590,6 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin,
bSetCrsrInReadOnly = sal_True;
pVisCrsr = new SwVisCrsr( this );
-// UpdateCrsr( 0 );
- // OD 11.02.2003 #100556#
mbMacroExecAllowed = true;
}
@@ -2725,7 +2666,7 @@ sal_uInt16 SwCrsrShell::UpdateTblSelBoxes()
// zeige das akt. selektierte "Object" an
void SwCrsrShell::MakeSelVisible()
{
- ASSERT( bHasFocus, "kein Focus aber Cursor sichtbar machen?" );
+ OSL_ENSURE( bHasFocus, "kein Focus aber Cursor sichtbar machen?" );
if( aCrsrHeight.Y() < aCharRect.Height() && aCharRect.Height() > VisArea().Height() )
{
SwRect aTmp( aCharRect );
@@ -2763,7 +2704,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
{
if( pTblCrsr ) // was soll ich jetzt machen ??
{
- ASSERT( !this, "TabellenSelection nicht aufgehoben!" );
+ OSL_ENSURE( !this, "TabellenSelection nicht aufgehoben!" );
return sal_False;
}
@@ -2921,7 +2862,6 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
if( bOk )
{
pCNd = rNdIdx.GetNode().GetCntntNode();
-// 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 );
}
@@ -2951,9 +2891,8 @@ void SwCrsrShell::NewCoreSelection()
sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
if ( GetViewOptions()->IsReadonly() ||
- // --> FME 2004-06-29 #114856# Formular view
+ // Formular view
GetViewOptions()->IsFormView() )
- // <--
{
SwFrm *pFrm = GetCurrFrm( sal_False );
const SwFlyFrm* pFly;
@@ -2967,14 +2906,13 @@ sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
return sal_False;
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
else if ( pFrm && pFrm->IsInSct() &&
0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
pSection->IsEditInReadonlyFlag() )
{
return sal_False;
}
- // <--
return sal_True;
}
@@ -3005,26 +2943,17 @@ void SwCrsrShell::SetReadOnlyAvailable( sal_Bool bFlag )
sal_Bool SwCrsrShell::HasReadonlySel() const
{
sal_Bool bRet = sal_False;
- if( IsReadOnlyAvailable() ||
- // --> FME 2004-06-29 #114856# Formular view
- GetViewOptions()->IsFormView() )
- // <--
+ if( IsReadOnlyAvailable() || GetViewOptions()->IsFormView() )
{
if( pTblCrsr )
bRet = pTblCrsr->HasReadOnlyBoxSel() ||
- pTblCrsr->HasReadonlySel(
- // --> FME 2004-06-29 #114856# Formular view
- GetViewOptions()->IsFormView() );
- // <--
+ pTblCrsr->HasReadonlySel( GetViewOptions()->IsFormView() );
else
{
const SwPaM* pCrsr = pCurCrsr;
do {
- if( pCrsr->HasReadonlySel(
- // --> FME 2004-06-29 #114856# Formular view
- GetViewOptions()->IsFormView() ) )
- // <--
+ if( pCrsr->HasReadonlySel( GetViewOptions()->IsFormView() ) )
bRet = sal_True;
} while( !bRet && pCurCrsr != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
}
@@ -3114,8 +3043,6 @@ bool SwCrsrShell::SelectHiddenRange()
return bRet;
}
-/* */
-
// die Suchfunktionen
sal_uLong SwCrsrShell::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnde,
@@ -3193,7 +3120,7 @@ void SwCrsrShell::SetSelection( const SwPaM& rCrsr )
void lcl_RemoveMark( SwPaM* pPam )
{
- ASSERT( pPam->HasMark(), "Don't remove pPoint!" )
+ OSL_ENSURE( pPam->HasMark(), "Don't remove pPoint!" );
pPam->GetMark()->nContent.Assign( 0, 0 );
pPam->GetMark()->nNode = 0;
pPam->DeleteMark();
@@ -3286,7 +3213,7 @@ void SwCrsrShell::ClearUpCrsrs()
}
bool bFound = (pNode != NULL);
- ASSERT(bFound, "no content node found");
+ OSL_ENSURE(bFound, "no content node found");
if (bFound)
{
@@ -3305,7 +3232,6 @@ void SwCrsrShell::ClearUpCrsrs()
TblCrsrToCursor();
}
-// #111827#
String SwCrsrShell::GetCrsrDescr() const
{
String aResult;
@@ -3487,7 +3413,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
//no determine the rectangle in the current line
xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
//take one less than the line end - otherwise the next line would be calculated
- xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd - 1: (nBegin + nLen - nLeft - nRight);
+ xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
@@ -3499,7 +3425,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
- rContent = nWordEnd;
+ rContent = nWordEnd - 1;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
@@ -3508,3 +3434,4 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 08936c85210b..610b3f988a3a 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,7 +75,7 @@
#include <wrong.hxx>
#include <vcl/window.hxx>
-#include <docufld.hxx> // OD 2008-06-19 #i90516#
+#include <docufld.hxx>
using namespace ::com::sun::star;
@@ -315,9 +316,6 @@ sal_Bool SwCrsrShell::GotoNextTOXBase( const String* pName )
0 != ( pSectNd = pSect->GetFmt()->GetSectionNode() ) &&
pCurCrsr->GetPoint()->nNode < pSectNd->GetIndex() &&
( !pFnd || pFnd->GetIndex() > pSectNd->GetIndex() ) &&
-// JP 10.12.96: solange wir nur 3 Typen kennen und UI-seitig keine anderen
-// einstellbar sind, muss ueber den Titel gesucht werden!
-// ( !pName || *pName == ((SwTOXBaseSection*)pSect)->GetTypeName() ) &&
( !pName || *pName == ((SwTOXBaseSection*)pSect)->GetTOXName() )
)
{
@@ -365,9 +363,6 @@ sal_Bool SwCrsrShell::GotoPrevTOXBase( const String* pName )
0 != ( pSectNd = pSect->GetFmt()->GetSectionNode() ) &&
pCurCrsr->GetPoint()->nNode > pSectNd->EndOfSectionIndex() &&
( !pFnd || pFnd->GetIndex() < pSectNd->GetIndex() ) &&
-// JP 10.12.96: solange wir nur 3 Typen kennen und UI-seitig keine anderen
-// einstellbar sind, muss ueber den Titel gesucht werden!
-// ( !pName || *pName == ((SwTOXBaseSection*)pSect)->GetTypeName() ) &&
( !pName || *pName == ((SwTOXBaseSection*)pSect)->GetTOXName() )
)
{
@@ -707,7 +702,7 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
const SwPosition& rPos = *pCrsr->GetPoint();
SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
- ASSERT( pTNd, "Wo ist mein CntntNode?" );
+ OSL_ENSURE( pTNd, "Wo ist mein CntntNode?" );
SwTxtFld * pTxtFld = static_cast<SwTxtFld *>(
pTNd->GetTxtAttrForCharAt(rPos.nContent.GetIndex(),
@@ -902,7 +897,6 @@ sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
{
pNd = rNds.GetOutLineNds()[ nPos ];
- //if( ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() <= nLevel )//#outline level,zhaojianwei
if( ((SwTxtNode*)pNd)->GetAttrOutlineLevel()-1 <= nLevel )//<-end,zhaojianwei
return nPos;
@@ -924,7 +918,7 @@ sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos,
if( nSttPos > nEndPos ) // sollte jemand das vertauscht haben?
{
- ASSERT( !this, "Start- > Ende-Position im Array" );
+ OSL_ENSURE( !this, "Start- > Ende-Position im Array" );
sal_uInt16 nTmp = nSttPos;
nSttPos = nEndPos;
nEndPos = nTmp;
@@ -935,12 +929,10 @@ sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos,
if( bWithChilds )
{
- //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 ];
- //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
@@ -1103,14 +1095,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
if( bRet )
{
-// rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
-// *pTxtAttr->GetStart(),
-// *pTxtAttr->GetEnd() - *pTxtAttr->GetStart(),
-// sal_False );
-
-// rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
-// rCntntAtPos.pFndTxtAttr = pTxtAttr;
if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1359,7 +1344,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( !bRet && (
SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
|| SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
#endif
))
@@ -1371,7 +1356,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) &&
0 != ( pBox = pTblNd->GetTable().GetTblBox(
pSttNd->GetIndex() )) &&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
RES_BOXATR_FORMULA, sal_False, &pItem ) ||
SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
@@ -1405,7 +1390,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
// erzeuge aus der internen (fuer CORE)
// die externe (fuer UI) Formel
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXFML;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( RES_BOXATR_VALUE == pItem->Which() )
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE;
else
@@ -1439,7 +1424,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( !bRet && SwContentAtPos::SW_CURR_ATTRS & rCntntAtPos.eCntntAtPos )
{
xub_StrLen n = aPos.nContent.GetIndex();
@@ -1537,7 +1522,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
return bRet;
}
-// --> OD 2008-06-19 #i90516#
+// #i90516#
const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
{
const SwPostItField* pPostItFld = 0;
@@ -1560,7 +1545,6 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
return pPostItFld;
}
-// <--
// befindet sich der Node in einem geschuetzten Bereich?
sal_Bool SwContentAtPos::IsInProtectSect() const
@@ -1785,9 +1769,6 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
{
*pCurCrsr->GetPoint() = aPos;
GetDoc()->SetTxtFmtColl( *pCurCrsr, pNextFmt, false );
- //JP 04.11.97: erstmal keine Folgevorlage der
- // Folgevorlage beachten
- // pNextFmt = pNextFmt->GetNextTxtFmtColl();
}
if( n < aFPos.nColumnCnt )
{
@@ -1821,7 +1802,7 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
GetDoc()->InsertItemSet( *pCurCrsr, aSet, 0 );
}
else {
- ASSERT( !this, "wo ist mein CntntNode?" );
+ OSL_ENSURE( !this, "wo ist mein CntntNode?" );
}
break;
@@ -2216,3 +2197,4 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx
index 55c407d1f209..0c28f43c0965 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,4 @@ sal_Bool SwCrsrShell::ExpandToSentenceBorders()
return pCurCrsr->ExpandToSentenceBorders();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index b505134e4395..d0b1a455f73a 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -435,12 +436,9 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
// vorhanden, auf den Stack. Aber nur wenn es noch grosser ist
if( pCmp->nEnd > aTmp.nEnd )
{
- ASSERT( !pStackArr[ nWhch - nArrStart ].nWhich,
+ OSL_ENSURE( !pStackArr[ nWhch - nArrStart ].nWhich,
"Stack-Platz ist noch belegt" );
- // ---------
- // JP 22.08.96: nur Ende manipulieren reicht nicht. Bug 30547
- // pCmp->nStt = aTmp.nEnd;
if( aTmp.nStt <= pCmp->nStt )
pCmp->nStt = aTmp.nEnd;
else
@@ -591,12 +589,9 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
// vorhanden, auf den Stack. Aber nur wenn es noch grosser ist
if( pCmp->nStt < aTmp.nStt )
{
- ASSERT( !pStackArr[ nWhch - nArrStart ].nWhich,
+ OSL_ENSURE( !pStackArr[ nWhch - nArrStart ].nWhich,
"Stack-Platz ist noch belegt" );
-// ---------
-// JP 22.08.96: nur Ende manipulieren reicht nicht. Bug 30547
-// pCmp->nEnd = aTmp.nStt;
if( aTmp.nEnd <= pCmp->nEnd )
pCmp->nEnd = aTmp.nStt;
else
@@ -673,7 +668,7 @@ int SwAttrCheckArr::CheckStack()
{
// alle die "offen" sind, heisst ueber die Start Position ragen,
// im FndSet setzen
- ASSERT( !pFndArr[ n ].nWhich, "Array-Platz ist noch belegt" );
+ OSL_ENSURE( !pFndArr[ n ].nWhich, "Array-Platz ist noch belegt" );
pFndArr[ n ] = *pArrPtr;
pArrPtr->nWhich = 0;
nFound++;
@@ -865,10 +860,7 @@ int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, sal_Bool bNo
else
{
nWhich = pItem->Which();
-//JP 27.02.95: wenn nach defaults gesucht wird, dann muss man bis zum Pool
-// runter
-// if( SFX_ITEM_SET != rNdSet.GetItemState( nWhich, !bNoColls, &pNdItem )
-// || *pNdItem != *pItem )
+
if( !CmpAttr( rNdSet.Get( nWhich, !bNoColls ), *pItem ))
return sal_False;
}
@@ -1147,36 +1139,6 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
else if( !pSet->Count() )
return FIND_NOT_FOUND; // nur Text und nicht gefunden
-/* // --> FME 2007-4-12 #i74765 # Why should we move the position?
- Moving the position results in bugs when there are two adjacent
- portions which both have the requested attributes set. I suspect this
- should be only be an optimization. Therefore I boldly remove it now!
-
- // JP: und wieder neu aufsetzen, aber eine Position weiter
- //JP 04.11.97: Bug 44897 - aber den Mark wieder aufheben, damit
- // weiterbewegt werden kann!
- {
- 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, sal_False ))
- {
- SwCntntNode *pNd = pPos->nNode.GetNode().GetCntntNode();
- xub_StrLen nCPos;
- if( fnMove == fnMoveForward )
- nCPos = 0;
- else
- nCPos = pNd->Len();
- pPos->nContent.Assign( pNd, nCPos );
- }
- else
- bCheckRegion = sal_False;
- }
- if( !bCheckRegion || *aRegion.GetPoint() <= *pPos )
- return FIND_NOT_FOUND; // nicht gefunden
- }*/
*aRegion.GetMark() = *aSrchPam.GetPoint();
}
@@ -1225,10 +1187,6 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
{
// --- Ist die Selection noch da ??????
- // und noch die Attribute setzen
-#ifdef OLD
- pCrsr->GetDoc()->Insert( *pCrsr, *pReplSet, 0 );
-#else
//JP 13.07.95: alle gesuchten Attribute werden, wenn nicht im
// ReplaceSet angegeben, auf Default zurueck gesetzt
@@ -1257,7 +1215,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
aSet.Put( *pReplSet );
pCrsr->GetDoc()->InsertItemSet( *pCrsr, aSet, 0 );
}
-#endif
+
return FIND_NO_RING;
}
@@ -1312,3 +1270,4 @@ sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index a78b92b180a1..b3f3f39e8a97 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,3 +121,4 @@ sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index 8da8e83bd5cf..7a548c393f33 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ sal_Bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 6eb89eadfbff..f53f2ef23a98 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -162,7 +163,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
}
break;
default:
- ASSERT( false, "unknown case in lcl_CleanStr" )
+ OSL_ENSURE( false, "unknown case in lcl_CleanStr" );
break;
}
}
@@ -434,7 +435,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
bool bRemoveSoftHyphens = true;
if ( bRegSearch )
{
- const rtl::OUString a00AD( rtl::OUString::createFromAscii( "\\x00AD" ) );
+ const rtl::OUString a00AD(RTL_CONSTASCII_USTRINGPARAM("\\x00AD"));
if ( -1 != rSearchOpt.searchString.indexOf( a00AD ) )
bRemoveSoftHyphens = false;
}
@@ -586,10 +587,6 @@ int SwFindParaText::Find( SwPaM* pCrsr, SwMoveFn fnMove,
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() )
- return FIND_NOT_FOUND;
- */
if( bFnd && bReplace ) // String ersetzen ??
{
@@ -713,3 +710,4 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 48e22c79ec6b..24a51cd362e1 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,23 +39,23 @@
#include <pam.hxx>
#include <pamtyp.hxx>
#include <txtfrm.hxx>
-#include <section.hxx>
#include <fmtcntnt.hxx>
#include <frmatr.hxx>
#include <swtable.hxx>
#include <crsskip.hxx>
-// --> FME 2004-06-29 #114856# Formular view
+// Formular view
#include <flyfrm.hxx>
#include <fmteiro.hxx>
#include <section.hxx>
#include <sectfrm.hxx>
-// <--
-#include <ndtxt.hxx> // #111827#
+#include <ndtxt.hxx>
#include <IMark.hxx>
#include <hints.hxx>
+#include <xmloff/odffields.hxx>
+
// fuer den dummen ?MSC-? Compiler
inline xub_StrLen GetSttOrEnd( sal_Bool bCondition, const SwCntntNode& rNd )
{
@@ -66,8 +67,6 @@ inline xub_StrLen GetSttOrEnd( sal_Bool bCondition, const SwCntntNode& rNd )
|* SwPosition
|*
|* Beschreibung PAM.DOC
-|* Ersterstellung VB 4.3.91
-|* Letzte Aenderung VB 4.3.91
|*
*************************************************************************/
@@ -387,8 +386,6 @@ SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool bChk )
|* SwPointAndMark
|*
|* Beschreibung PAM.DOC
-|* Ersterstellung VB 4.3.91
-|* Letzte Aenderung JP 6.5.91
|*
*************************************************************************/
@@ -548,7 +545,7 @@ void SwPaM::SetMark()
(*m_pMark) = (*m_pPoint);
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwPaM::Exchange()
{
@@ -588,9 +585,6 @@ sal_Bool SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo )
|* const SwPaM& der enventuell vorgegeben Bereich
|* Return-Werte SwPaM* der entsprehend neu gesetzte Bereich
|*
-|* Ersterstellung JP 26.04.91
-|* Letzte Aenderung JP 26.04.91
-|*
*************************************************************************/
@@ -646,8 +640,7 @@ sal_uInt16 SwPaM::GetPageNum( sal_Bool bAtPoint, const Point* pLayPos )
return 0;
}
-// --> FME 2004-06-29 #114856# Formular view
-// See also SwCrsrShell::IsCrsrReadonly()
+// Formular view - See also SwCrsrShell::IsCrsrReadonly()
const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm )
{
const SwFrm* pRet = 0;
@@ -671,7 +664,6 @@ const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm )
return pRet;
}
-// <--
// steht in etwas geschuetztem oder in die Selektion umspannt
// etwas geschuetztes.
@@ -687,24 +679,18 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
else
pFrm = 0;
- // --> FME 2004-06-29 #114856# Formular view
// Will be set if point/mark are inside edit-in-readonly environment
const SwFrm* pSttEIRFrm = 0;
const SwFrm* pEndEIRFrm = 0;
if( pFrm && ( pFrm->IsProtected() ||
- // --> FME 2004-06-29 #114856# Formular view
- ( bFormView &&
- 0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
- // <--
+ ( bFormView && 0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
bRet = sal_True;
else if( pNd )
{
const SwSectionNode* pSNd = pNd->GetSectionNode();
if( pSNd && ( pSNd->GetSection().IsProtectFlag() ||
- // --> FME 2004-06-29 #114856# Formular view
(bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
- // <--
bRet = sal_True;
}
@@ -716,22 +702,16 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
pFrm = 0;
if( pFrm && ( pFrm->IsProtected() ||
- // --> FME 2004-06-29 #114856# Formular view
- ( bFormView &&
- 0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
- // <--
+ ( bFormView && 0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) )
bRet = sal_True;
else if( pNd )
{
const SwSectionNode* pSNd = pNd->GetSectionNode();
if( pSNd && ( pSNd->GetSection().IsProtectFlag() ||
- // --> FME 2004-06-29 #114856# Formular view
(bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) )
- // <--
bRet = sal_True;
}
- // --> FME 2004-06-29 #114856# Formular view
if ( !bRet && bFormView )
{
// Check if start and end frame are inside the _same_
@@ -739,7 +719,6 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
if ( pSttEIRFrm != pEndEIRFrm )
bRet = sal_True;
}
- // <--
// oder sollte eine geschuetzte Section innerhalb der
// Selektion liegen?
@@ -766,7 +745,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
if( pFmt->GetProtect().IsCntntProtected() )
{
const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False);
- ASSERT( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex();
if( nSttIdx <= nIdx && nEndIdx >= nIdx &&
rCntnt.GetCntntIdx()->GetNode().GetNodes().IsDocNodes() )
@@ -785,60 +764,45 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
}
}
}
-
-#ifdef CHECK_CELL_READONLY
-//JP 22.01.99: bisher wurden Tabelle, die in der Text-Selektion standen
-// nicht beachtet. Wollte man das haben, dann muss dieser
-// Code freigeschaltet werden
-
- if( !bRet )
- {
- // dann noch ueber alle Tabellen
- const SwFrmFmts& rFmts = *GetDoc()->GetTblFrmFmts();
- for( n = rFmts.Count(); n ; )
- {
- SwFrmFmt* pFmt = (SwFrmFmt*)rFmts[ --n ];
- const SwTable* pTbl = SwTable::FindTable( pFmt );
- 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( sal_uInt16 i = rBoxes.Count(); i; )
- if( rBoxes[ --i ]->GetFrmFmt()->GetProtect().
- IsCntntProtected() )
- {
- bRet = sal_True;
- break;
- }
-
- if( bRet )
- break;
- }
- }
- }
-#endif
}
}
}
//FIXME FieldBk
// TODO: Form Protection when Enhanced Fields are enabled
- if (!bRet) {
- const SwDoc *pDoc = GetDoc();
- sw::mark::IMark* pA = NULL;
- sw::mark::IMark* pB = NULL;
- if ( pDoc )
+ const SwDoc *pDoc = GetDoc();
+ sw::mark::IMark* pA = NULL;
+ sw::mark::IMark* pB = NULL;
+ bool bUnhandledMark = false;
+ if ( pDoc )
+ {
+ const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
+ pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
+ pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
+
+ sw::mark::IFieldmark* pFieldmark = pMarksAccess->getFieldmarkFor( *GetPoint() );
+ if ( pFieldmark )
+ bUnhandledMark = pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) );
+ }
+
+ if (!bRet)
+ {
+ // Unhandled fieldmarks case shouldn't be edited manually to avoid breaking anything
+ if ( ( pA == pB ) && bUnhandledMark )
+ bRet = sal_True;
+ else
{
- const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
- pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
- pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
- bRet = ( pA != pB );
+ // Form protection case
+ bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
+ bool bAtStartB = pB != NULL && pB->GetMarkStart() == *GetMark();
+ bRet = ( pA != pB ) || bAtStartA || bAtStartB;
+ bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
+ if ( bProtectForm )
+ bRet |= ( pA == NULL || pB == NULL );
}
- bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
- if ( bProtectForm )
- bRet |= ( pA == NULL || pB == NULL );
+ }
+ else
+ {
+ bRet = !( pA == pB && pA != NULL );
}
return bRet;
}
@@ -909,12 +873,6 @@ SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove,
( !bInReadOnly && pFrm->IsProtected() ) ||
( pFrm->IsTxtFrm() &&
((SwTxtFrm*)pFrm)->IsHiddenNow() ) )
-
-// rNodes[ rNodes.EndOfAutotext ]->StartOfSection().GetIndex()
-// < aPos.nNode.GetIndex() && aPos.nNode.GetIndex()
-// < rNodes.EndOfAutotext.GetIndex() &&
-// 0 == ( pFrm = pNd->GetFrm()) &&
-// pFrm->IsProtected() )
{
pNd = 0;
continue; // suche weiter
@@ -1172,7 +1130,6 @@ sal_Bool GoPrevSection( SwPaM & rPam, SwMoveFn fnMove )
return sal_True;
}
-// #111827#
String SwPaM::GetTxt() const
{
String aResult;
@@ -1244,3 +1201,5 @@ sal_Bool SwPaM::LessThan(const SwPaM & a, const SwPaM & b)
{
return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End());
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx
index 37bd63fe224d..726c7fbbe8ac 100644
--- a/sw/source/core/crsr/paminit.cxx
+++ b/sw/source/core/crsr/paminit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -129,3 +130,5 @@ SwPosTable GetfnTableEnd()
{
return fnTableEnd;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b7106ade751c..68571ba25b20 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -169,13 +170,9 @@ sal_Bool SwCursor::IsSkipOverProtectSections() const
}
-// Sicher die aktuelle Position, damit ggfs. auf diese zurueck
-// gefallen werden kann. Die SavePos Objekte werden als Stack verwaltet,
-// damit das auch alles bei verschachtelten Aufrufen funktioniert.
// Das CreateNewSavePos ist virtual, damit abgeleitete Klassen vom Cursor
// gegebenenfalls eigene SaveObjecte anlegen und in den virtuellen
// Check-Routinen verwenden koennen.
-
void SwCursor::SaveState()
{
_SwCursor_SavePos* pNew = CreateNewSavePos();
@@ -326,7 +323,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
if( rProtect.IsCntntProtected() )
{
const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False);
- ASSERT( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" );
sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex();
if( nSttIdx <= nIdx && nEndIdx >= nIdx )
{
@@ -536,7 +533,7 @@ sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr )
// Check for convered cell:
bool bInCoveredCell = false;
const SwStartNode* pTmpSttNode = pCNd->FindTableBoxStartNode();
- ASSERT( pTmpSttNode, "In table, therefore I expect to get a SwTableBoxStartNode" )
+ OSL_ENSURE( pTmpSttNode, "In table, therefore I expect to get a SwTableBoxStartNode" );
const SwTableBox* pBox = pTmpSttNode ? pTableNode->GetTable().GetTblBox( pTmpSttNode->GetIndex() ) : 0; //Robust #151355
if ( pBox && pBox->getRowSpan() < 1 ) // Robust #151270
bInCoveredCell = true;
@@ -1002,6 +999,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else
DeleteMark();
+ delete pSav;
return 0;
}
@@ -1056,6 +1054,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else
DeleteMark();
+ delete pSav;
return 0;
}
// es wurde ein- bis mehrmals gefunden. Das steht alles
@@ -1372,22 +1371,46 @@ sal_Bool SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
{
- xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
- Boundary aBndry( pBreakIt->GetBreakIter()->getWordBoundary(
- pTxtNd->GetTxt(), nPtPos,
- pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
- nWordType,
- bForward ));
-
- if( aBndry.startPos != aBndry.endPos )
+ // Should we select the whole fieldmark?
+ const IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
+ sw::mark::IMark* pMark = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
+ if ( pMark )
{
- GetPoint()->nContent = (xub_StrLen)aBndry.endPos;
- if( !IsSelOvr() )
+ const SwPosition rStart = pMark->GetMarkStart();
+ GetPoint()->nNode = rStart.nNode;
+ GetPoint()->nContent = rStart.nContent;
+ GetPoint()->nContent++; // Don't select the start delimiter
+
+ const SwPosition rEnd = pMark->GetMarkEnd();
+
+ if ( rStart != rEnd )
{
SetMark();
- GetMark()->nContent = (xub_StrLen)aBndry.startPos;
+ GetMark()->nNode = rEnd.nNode;
+ GetMark()->nContent = rEnd.nContent;
+ GetMark()->nContent--; //Don't select the end delimiter
+ }
+ bRet = sal_True;
+ }
+ else
+ {
+ xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
+ Boundary aBndry( pBreakIt->GetBreakIter()->getWordBoundary(
+ pTxtNd->GetTxt(), nPtPos,
+ pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
+ nWordType,
+ bForward ));
+
+ if( aBndry.startPos != aBndry.endPos )
+ {
+ GetPoint()->nContent = (xub_StrLen)aBndry.endPos;
if( !IsSelOvr() )
- bRet = sal_True;
+ {
+ SetMark();
+ GetMark()->nContent = (xub_StrLen)aBndry.startPos;
+ if( !IsSelOvr() )
+ bRet = sal_True;
+ }
}
}
}
@@ -1618,7 +1641,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
else
fnGo = CRSR_SKIP_CELLS == nMode ? fnGoCntntCells : fnGoCntnt;
- // ASSERT( not in covered cell )
+ // OSL_ENSURE( not in covered cell )
while( nCnt )
{
@@ -1812,7 +1835,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
// 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( sal_True )->FindTableBoxStartNode();
- ASSERT( pTblNd, "pTblCrsr without SwTableNode?" )
+ OSL_ENSURE( pTblNd, "pTblCrsr without SwTableNode?" );
if ( pTblNd ) // safety first
{
@@ -2024,7 +2047,7 @@ sal_Bool SwCursor::GotoTblBox( const String& rName )
sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
{
- //JP 28.8.2001: for optimization test something before
+ //for optimization test something before
const SwNode* pNd = &GetPoint()->nNode.GetNode();
bool bShortCut = false;
if ( fnWhichPara == fnParaCurr )
@@ -2073,13 +2096,7 @@ sal_Bool SwCursor::MoveSection( SwWhichSection fnWhichSect,
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
-/*
- sal_Bool MoveTable( SwWhichTable, SwPosTable );
- sal_Bool MoveColumn( SwWhichColumn, SwPosColumn );
- sal_Bool MoveRegion( SwWhichRegion, SwPosRegion );
-*/
-
-void SwCursor::RestoreSavePos() // Point auf die SavePos setzen
+void SwCursor::RestoreSavePos()
{
if( pSavePos )
{
@@ -2107,13 +2124,14 @@ sal_Bool lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, sal_uI
{
sal_uLong nIdx = pSrch->GetIndex();
- sal_uInt16 nO = rTmp.Count(), nM, nU = 0;
+ sal_uInt16 nO = rTmp.Count();
if( nO > 0 )
{
nO--;
+ sal_uInt16 nU = 0;
while( nU <= nO )
{
- nM = nU + ( nO - nU ) / 2;
+ sal_uInt16 nM = nU + ( nO - nU ) / 2;
if( rTmp[ nM ]->GetSttNd() == pSrch )
{
rFndPos = nM;
@@ -2194,19 +2212,6 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
if( bDel )
{
SwPaM* pDel = (SwPaM*)pCur->GetPrev();
-/*
-JP 20.07.98: der alte Code geht mit dem UNO-TableCrsr nicht
- if( pDel == pAktCrsr )
- {
- if( pAktCrsr->GetNext() == pAktCrsr )
- {
- pAktCrsr->DeleteMark();
- break; // es gibt nichts mehr zu loeschen!
- }
- pAktCrsr = (SwCursor*)pDel->GetPrev();
- }
- delete pDel;
-*/
if( pDel == pAktCrsr )
pAktCrsr->DeleteMark();
@@ -2358,3 +2363,4 @@ sal_Bool SwTableCursor::HasReadOnlyBoxSel() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx
index 92cd87889875..855b2d26b495 100644
--- a/sw/source/core/crsr/trvlcol.cxx
+++ b/sw/source/core/crsr/trvlcol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,3 +132,4 @@ sal_Bool SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index e20724fe157d..c2ead9272ea0 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -357,3 +358,4 @@ sal_Bool SwCrsrShell::GotoFlyAnchor()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx
index 0dbc6013e465..25550b03958a 100644
--- a/sw/source/core/crsr/trvlreg.cxx
+++ b/sw/source/core/crsr/trvlreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -289,3 +290,4 @@ sal_Bool SwCrsrShell::GotoRegion( const String& rName )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 0c6a659f2eb0..2734a6ab3d8c 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -98,7 +99,7 @@ sal_Bool SwCrsrShell::GoNextCell( sal_Bool bAppendLine )
pCrsr->GetPoint()->nNode.GetNode().
StartOfSectionIndex() );
- ASSERT( pTableBox, "Box steht nicht in dieser Tabelle" );
+ OSL_ENSURE( pTableBox, "Box steht nicht in dieser Tabelle" );
SwSelBoxes aBoxes;
//Das Dokument veraendert sich evtl. ohne Action wuerden die Sichten
@@ -119,8 +120,7 @@ sal_Bool SwCrsrShell::GoNextCell( sal_Bool bAppendLine )
sal_Bool SwCrsrShell::GoPrevCell()
{
sal_Bool bRet = sal_False;
- const SwTableNode* pTblNd;
- if( IsTableMode() || 0 != ( pTblNd = IsCrsrInTbl() ))
+ if( IsTableMode() || IsCrsrInTbl() )
{
SwCursor* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr;
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -304,7 +304,7 @@ sal_Bool SwCrsrShell::SelTblBox()
const SwStartNode* pStartNode =
pCurCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// the old code checks whether we're in a table by asking the
// frame. This should yield the same result as searching for the
// table box start node, right?
@@ -364,7 +364,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
if ( !pTblNd )
{
- ASSERT( false, "lcl_FindNextCell not celled with table start node!" )
+ OSL_ENSURE( false, "lcl_FindNextCell not celled with table start node!" );
return false;
}
@@ -442,7 +442,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
if ( !pTblNd )
{
- ASSERT( false, "lcl_FindPrevCell not celled with table start node!" )
+ OSL_ENSURE( false, "lcl_FindPrevCell not celled with table start node!" );
return false;
}
@@ -755,7 +755,7 @@ String SwCrsrShell::GetBoxNms() const
pFrm = pFrm->GetUpper();
} while ( pFrm && !pFrm->IsCellFrm() );
- ASSERT( pFrm, "kein Frame zur Box" );
+ OSL_ENSURE( pFrm, "kein Frame zur Box" );
sNm = ((SwCellFrm*)pFrm)->GetTabBox()->GetName();
sNm += ':';
pPos = pTblCrsr->End();
@@ -929,3 +929,4 @@ sal_Bool SwCrsrShell::EndAllTblBoxEdit()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index b57e423623a2..48bb4b1f2cf4 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,7 @@ SwUnoCrsr::~SwUnoCrsr()
if( USHRT_MAX != nDelPos )
rTbl.Remove( nDelPos );
else {
- ASSERT( !this, "UNO Cursor nicht mehr im Array" );
+ OSL_ENSURE( !this, "UNO Cursor nicht mehr im Array" );
}
}
@@ -226,14 +227,6 @@ SwUnoTableCrsr::~SwUnoTableCrsr()
delete aTblSel.GetNext(); // und loeschen
}
-
-/*
-SwCursor* SwUnoTableCrsr::Create( SwPaM* pRing ) const
-{
- return SwUnoCrsr::Create( pRing );
-}
-*/
-
sal_Bool SwUnoTableCrsr::IsSelOvr( int eFlags )
{
sal_Bool bRet = SwUnoCrsr::IsSelOvr( eFlags );
@@ -278,3 +271,4 @@ void SwUnoTableCrsr::MakeBoxSels()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 53cd935289de..251e4d7fc23b 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,15 +47,13 @@
#include <viewimp.hxx>
#include <dview.hxx>
#include <rootfrm.hxx>
-#include <txtfrm.hxx> // SwTxtFrm
+#include <txtfrm.hxx> // SwTxtFrm
#include <docary.hxx>
#include <extinput.hxx>
#include <ndtxt.hxx>
#include <scriptinfo.hxx>
-#include <mdiexp.hxx> // GetSearchDialog
-#ifndef _COMCORE_HRC
-#include <comcore.hrc> // ResId fuer Abfrage wenn zu Search & Replaces
-#endif
+#include <mdiexp.hxx> // GetSearchDialog
+#include <comcore.hrc> // ResId for query when (switching to?) Search & Replace
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpaintwindow.hxx>
@@ -63,253 +62,15 @@
extern void SwCalcPixStatics( OutputDevice *pOut );
-//Damit beim ShowCrsr nicht immer wieder die gleiche Size teuer ermittelt
-//werden muss, hier statische Member, die beim Wechsel des MapModes
-// angepasst werden
+// Here static members are defined. They will get changed on alteration of the
+// MapMode. This is done so that on ShowCrsr the same size does not have to be
+// expensively determined again and again.
long SwSelPaintRects::nPixPtX = 0;
long SwSelPaintRects::nPixPtY = 0;
MapMode* SwSelPaintRects::pMapMode = 0;
-
-#ifdef SHOW_BOOKMARKS
-// #include <IMark.hxx>
-//
-// class SwBookmarkRects : public SwSelPaintRects
-// {
-// virtual void Paint( const Rectangle& rRect );
-// virtual void FillRects();
-//
-// public:
-// SwBookmarkRects( const SwCrsrShell& rSh ) : SwSelPaintRects( rSh ) {}
-// };
-//
-// void SwBookmarkRects::Paint( const Rectangle& rRect )
-// {
-// Window* pWin = GetShell()->GetWin();
-//
-// RasterOp eOld( pWin->GetRasterOp() );
-// sal_Bool bLCol = pWin->IsLineColor();
-// Color aLCol( pWin->GetLineColor() );
-// sal_Bool bFCol = pWin->IsFillColor();
-// Color aFCol( pWin->GetFillColor() );
-//
-// pWin->SetRasterOp( ROP_XOR );
-// Color aCol( RGB_COLORDATA( 0xF0, 0xC8, 0xF0 ) ^ COL_WHITE );
-// pWin->SetFillColor( aCol );
-// pWin->SetLineColor( aCol );
-//
-// pWin->DrawRect( rRect );
-//
-// if( bLCol ) pWin->SetLineColor( aLCol ); else pWin->SetLineColor();
-// if( bFCol ) pWin->SetFillColor( aFCol ); else pWin->SetFillColor();
-// pWin->SetRasterOp( eOld );
-// }
-//
-// void SwBookmarkRects::FillRects()
-// {
-// SwRegionRects aReg( GetShell()->VisArea() );
-//
-// const SwBookmarks& rBkmkTbl = GetShell()->getIDocumentMarkAccess()->getBookmarks();
-// SwShellCrsr* pCrsr = 0;
-// for( sal_uInt16 n = 0; n < rBkmkTbl.Count(); ++n )
-// {
-// const SwBookmark& rBkmk = *rBkmkTbl[ n ];
-// if( rBkmk.IsBookMark() && rBkmk.GetOtherPos() )
-// {
-// if( !pCrsr )
-// {
-// pCrsr = new SwShellCrsr( *GetShell(), rBkmk.GetPos() );
-// pCrsr->SetMark();
-// }
-// else
-// *pCrsr->GetPoint() = rBkmk.GetPos();
-// *pCrsr->GetMark() = *rBkmk.GetOtherPos();
-// pCrsr->FillRects();
-// for( sal_uInt16 i = 0; i < pCrsr->Count(); ++i )
-// aReg -= (*pCrsr)[ i ];
-//
-// pCrsr->Remove( 0, i );
-// }
-// }
-// if( pCrsr ) delete pCrsr;
-//
-// aReg.Invert();
-// SwRects::Insert( &aReg, 0 );
-// }
-//
-// SwBookmarkRects* pBookMarkRects = 0;
-//
-// void ShowBookmarks( const SwCrsrShell* pSh, int nAction, const SwRect* pRect = 0 )
-// {
-// if( !pBookMarkRects && pSh->getIDocumentMarkAccess()->getBookmarks().Count() )
-// pBookMarkRects = new SwBookmarkRects( *pSh );
-//
-// if( pBookMarkRects )
-// {
-// switch( nAction )
-// {
-// case 1: pBookMarkRects->Show(); break;
-// case 2: pBookMarkRects->Hide(); break;
-// case 3: pBookMarkRects->Invalidate( *pRect ); break;
-// }
-//
-// if( !pBookMarkRects->Count() )
-// delete pBookMarkRects, pBookMarkRects = 0;
-// }
-// }
-//
-// #define SHOWBOOKMARKS1( nAct ) ShowBookmarks( GetShell(),nAct );
-// #define SHOWBOOKMARKS2( nAct, pRect ) ShowBookmarks( GetShell(),nAct, pRect );
-
-#else
-
-#define SHOWBOOKMARKS1( nAct )
-#define SHOWBOOKMARKS2( nAct, pRect )
-
-#endif
-
-#ifdef SHOW_REDLINES
-#include <redline.hxx>
-
-class SwRedlineRects : public SwSelPaintRects
-{
- sal_uInt16 nMode;
- sal_uInt16 nNm;
-
- virtual void Paint( const Rectangle& rRect );
- virtual void FillRects();
-
-public:
- SwRedlineRects( const SwCrsrShell& rSh, sal_uInt16 nName, sal_uInt16 n )
- : SwSelPaintRects( rSh ), nMode( n ), nNm( nName )
- {}
-};
-
-void SwRedlineRects::Paint( const Rectangle& rRect )
-{
- Window* pWin = GetShell()->GetWin();
-
- RasterOp eOld( pWin->GetRasterOp() );
- sal_Bool bLCol = pWin->IsLineColor();
- Color aLCol( pWin->GetLineColor() );
- sal_Bool bFCol = pWin->IsFillColor();
- Color aFCol( pWin->GetFillColor() );
-
- pWin->SetRasterOp( ROP_XOR );
- Color aCol;
-
- sal_uInt8 nVal = 0xc8 - ( (nMode / 4) * 16 );
- switch( nMode % 4 )
- {
- case 0: aCol = RGB_COLORDATA( nVal, nVal, 0xFF ); break;
- case 1: aCol = RGB_COLORDATA( 0xFF, 0xc8, nVal ); break;
- case 2: aCol = RGB_COLORDATA( nVal, 0xFF, nVal ); break;
- case 3: aCol = RGB_COLORDATA( 0xFF, nVal, nVal ); break;
- }
- aCol = aCol.GetColor() ^ COL_WHITE;
-
- pWin->SetFillColor( aCol );
- pWin->SetLineColor( aCol );
-
- pWin->DrawRect( rRect );
-
- if( bLCol ) pWin->SetLineColor( aLCol ); else pWin->SetLineColor();
- if( bFCol ) pWin->SetFillColor( aFCol ); else pWin->SetFillColor();
- pWin->SetRasterOp( eOld );
-}
-
-void SwRedlineRects::FillRects()
-{
- SwRegionRects aReg( GetShell()->VisArea() );
-
- const SwRedlineTbl& rTbl = GetShell()->GetDoc()->GetRedlineTbl();
- SwShellCrsr* pCrsr = 0;
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
- {
- const SwRedline& rRed = *rTbl[ n ];
- if( rRed.HasMark() && (nMode % 4 ) == rRed.GetType() &&
- nNm == rRed.GetAuthor() )
- {
- if( !pCrsr )
- {
- pCrsr = new SwShellCrsr( *GetShell(), *rRed.GetPoint() );
- pCrsr->SetMark();
- }
- else
- *pCrsr->GetPoint() = *rRed.GetPoint();
- *pCrsr->GetMark() = *rRed.GetMark();
- pCrsr->FillRects();
- for( sal_uInt16 i = 0; i < pCrsr->Count(); ++i )
- aReg -= (*pCrsr)[ i ];
-
- pCrsr->Remove( 0, i );
- }
- }
- if( pCrsr ) delete pCrsr;
-
- aReg.Invert();
- SwRects::Insert( &aReg, 0 );
-}
-
-SwRedlineRects* aRedlines[ 10 * 4 ];
-static int bFirstCall = sal_True;
-
-void ShowRedlines( const SwCrsrShell* pSh, int nAction, const SwRect* pRect = 0 )
-{
- if( bFirstCall )
- {
- memset( aRedlines, 0, sizeof(aRedlines));
- bFirstCall = sal_False;
- }
-
- const SwRedlineTbl& rTbl = pSh->GetDoc()->GetRedlineTbl();
- const SwRedlineAuthorTbl& rAuthorTbl = pSh->GetDoc()->GetRedlineAuthorTbl();
-
- for( sal_uInt16 n = 0; n < rAuthorTbl.Count(); ++n )
- {
- for( int i = 0; i < 4; ++i )
- {
- SwRedlineRects** ppRedRect = &aRedlines[ n * 4 + i ];
- if( rTbl.Count() && !*ppRedRect )
- *ppRedRect = new SwRedlineRects( *pSh, n, n * 4 + i );
-
- if( *ppRedRect )
- {
- switch( nAction )
- {
- case 1: (*ppRedRect)->Show(); break;
- case 2: (*ppRedRect)->Hide(); break;
- case 3: (*ppRedRect)->Invalidate( *pRect ); break;
- }
-
- if( !(*ppRedRect)->Count() )
- delete *ppRedRect, *ppRedRect = 0;
- }
- }
- }
-}
-
-#define SHOWREDLINES1( nAct ) ShowRedlines( GetShell(),nAct );
-#define SHOWREDLINES2( nAct, pRect ) ShowRedlines( GetShell(),nAct, pRect );
-
-#else
-
-#define SHOWREDLINES1( nAct )
-#define SHOWREDLINES2( nAct, pRect )
-
-#endif
-
-#ifdef JP_REDLINE
- if( GetDoc()->GetRedlineTbl().Count() )
- {
- SwRedlineTbl& rRedlineTbl = (SwRedlineTbl&)GetDoc()->GetRedlineTbl();
- for( sal_uInt16 i = 0; i < rRedlineTbl.Count(); ++i )
- rRedlineTbl[ i ]->HideRects( *GetShell() );
- }
-#endif
-
-// -------- Ab hier Klassen / Methoden fuer den nicht Text-Cursor ------
+// ----- Starting from here: classes / methods for the non-text-cursor -----
SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell )
: pCrsrShell( pCShell )
@@ -321,7 +82,7 @@ SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell )
#ifdef SW_CRSR_TIMER
bTimerOn = sal_True;
- SetTimeout( 50 ); // 50msec Verzoegerung
+ SetTimeout( 50 ); // 50 millisecond delay
#endif
}
@@ -331,7 +92,7 @@ SwVisCrsr::~SwVisCrsr()
{
#ifdef SW_CRSR_TIMER
if( bTimerOn )
- Stop(); // Timer stoppen
+ Stop(); // stop timer
#endif
if( bIsVisible && aTxtCrsr.IsVisible() )
@@ -349,16 +110,16 @@ void SwVisCrsr::Show()
{
bIsVisible = sal_True;
- // muss ueberhaupt angezeigt werden ?
+ // display at all?
if( pCrsrShell->VisArea().IsOver( pCrsrShell->aCharRect ) )
#ifdef SW_CRSR_TIMER
{
if( bTimerOn )
- Start(); // Timer aufsetzen
+ Start(); // start timer
else
{
if( IsActive() )
- Stop(); // Timer Stoppen
+ Stop(); // stop timer
_SetPosAndShow();
}
@@ -379,22 +140,22 @@ void SwVisCrsr::Hide()
#ifdef SW_CRSR_TIMER
if( IsActive() )
- Stop(); // Timer Stoppen
+ Stop(); // stop timer
#endif
- if( aTxtCrsr.IsVisible() ) // sollten die Flags nicht gueltig sein?
+ if( aTxtCrsr.IsVisible() ) // Shouldn't the flags be in effect?
aTxtCrsr.Hide();
}
}
#ifdef SW_CRSR_TIMER
-void __EXPORT SwVisCrsr::Timeout()
+void SwVisCrsr::Timeout()
{
- ASSERT( !bIsDragCrsr, "Timer vorher abschalten" );
+ OSL_ENSURE( !bIsDragCrsr, "Timer vorher abschalten" );
if( bIsVisible )
{
- if ( !pCrsrShell->GetWin() ) //SwFrmFmt::GetGraphic setzt das Win temp aus!
+ if ( !pCrsrShell->GetWin() ) // SwFrmFmt::GetGraphic suspends Win temporarily!
Start();
else
_SetPosAndShow();
@@ -412,7 +173,7 @@ sal_Bool SwVisCrsr::ChgTimerFlag( sal_Bool bFlag )
bOld = bTimerOn;
if( !bFlag && bIsVisible && IsActive() )
{
- Stop(); // Timer Stoppen
+ Stop(); // stop timer
_SetPosAndShow();
}
bTimerOn = bFlag;
@@ -595,9 +356,9 @@ void SwSelPaintRects::Show()
if(pTargetOverlay)
{
- // #i97672# get the system's hilight color and limit it to the maximum
- // allowed luminance. This is needed to react on too bright hilight colors
- // which would otherwise vive a bad visualisation
+ // #i97672# get the system's highlight color and limit it to the maximum
+ // allowed luminance. This is needed to react on too bright highlight colors
+ // which would otherwise vive a bad visualisation.
const OutputDevice *pOut = Application::GetDefaultDevice();
Color aHighlight(pOut->GetSettings().GetStyleSettings().GetHighlightColor());
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
@@ -643,9 +404,10 @@ void SwSelPaintRects::Invalidate( const SwRect& rRect )
SwRects::Insert( &aReg, 0 );
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // Liegt die Selection rechts oder unten ausserhalb des sichtbaren
- // Bereiches, so ist diese nie auf eine Pixel rechts/unten aligned.
- // Das muss hier erkannt und ggf. das Rechteckt erweitert werden.
+ // If the selection is to the right or at the bottom, outside the
+ // visible area, it is never aligned on one pixel at the right/bottom.
+ // This has to be determined here and if that is the case the
+ // rectangle has to be expanded.
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if( GetShell()->bVisPortChgd && 0 != ( nSz = Count()) )
{
@@ -732,7 +494,7 @@ void SwShellCrsr::SetMark()
void SwShellCrsr::FillRects()
{
- // die neuen Rechtecke berechnen
+ // calculate the new rectangles
if( HasMark() &&
GetPoint()->nNode.GetNode().IsCntntNode() &&
GetPoint()->nNode.GetNode().GetCntntNode()->GetFrm() &&
@@ -749,14 +511,11 @@ void SwShellCrsr::Show()
do {
pTmp->SwSelPaintRects::Show();
} while( this != ( pTmp = dynamic_cast<SwShellCrsr*>(pTmp->GetNext()) ) );
-
- SHOWBOOKMARKS1( 1 )
- SHOWREDLINES1( 1 )
}
- // Dieses Rechteck wird neu gepaintet, also ist die SSelection in
- // dem Bereich ungueltig
+ // This rectangle gets painted anew, therefore the SSelection in this
+ // area is invalid.
void SwShellCrsr::Invalidate( const SwRect& rRect )
{
SwShellCrsr * pTmp = this;
@@ -765,10 +524,8 @@ void SwShellCrsr::Invalidate( const SwRect& rRect )
{
pTmp->SwSelPaintRects::Invalidate( rRect );
- // --> FME 2005-08-18 #125102#
// skip any non SwShellCrsr objects in the ring
// (see:SwAutoFormat::DeleteSel()
- // <--
Ring* pTmpRing = pTmp;
pTmp = 0;
do
@@ -779,9 +536,6 @@ void SwShellCrsr::Invalidate( const SwRect& rRect )
while ( !pTmp );
}
while( this != pTmp );
-
- SHOWBOOKMARKS2( 3, &rRect )
- SHOWREDLINES2( 3, &rRect )
}
@@ -791,9 +545,6 @@ void SwShellCrsr::Hide()
do {
pTmp->SwSelPaintRects::Hide();
} while( this != ( pTmp = dynamic_cast<SwShellCrsr*>(pTmp->GetNext()) ) );
-
- SHOWBOOKMARKS1( 2 )
- SHOWREDLINES1( 2 )
}
SwCursor* SwShellCrsr::Create( SwPaM* pRing ) const
@@ -808,8 +559,8 @@ short SwShellCrsr::MaxReplaceArived()
Window* pDlg = LAYOUT_THIS_WINDOW (::GetSearchDialog());
if( pDlg )
{
- // alte Actions beenden; die Tabellen-Frames werden angelegt und
- // eine SSelection kann erzeugt werden
+ // Terminate old actions. The table-frames get constructed and
+ // a SSelection can be created.
SvUShorts aArr;
sal_uInt16 nActCnt;
ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(),
@@ -832,7 +583,7 @@ short SwShellCrsr::MaxReplaceArived()
}
}
else
- // ansonsten aus dem Basic, und dann auf RET_YES schalten
+ // otherwise from the Basic, and than switch to RET_YES
nRet = RET_YES;
return nRet;
@@ -849,10 +600,10 @@ sal_Bool SwShellCrsr::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
&GetPtPos(), GetShell()->GetUpDownX() );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
-// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
-// am sichtbaren Cursor
+// JP 05.03.98: To test the UNO-Crsr behavior here the implementation on the
+// visible cursor.
sal_Bool SwShellCrsr::IsSelOvr( int eFlags )
{
@@ -861,7 +612,7 @@ sal_Bool SwShellCrsr::IsSelOvr( int eFlags )
#endif
-// sal_True: an die Position kann der Cursor gesetzt werden
+// TRUE: The cursor can be set to the position.
sal_Bool SwShellCrsr::IsAtValidPos( sal_Bool bPoint ) const
{
if( GetShell() && ( GetShell()->IsAllProtect() ||
@@ -912,8 +663,8 @@ void SwShellTableCrsr::SaveTblBoxCntnt( const SwPosition* pPos )
void SwShellTableCrsr::FillRects()
{
- // die neuen Rechtecke berechnen
- // JP 16.01.98: wenn der Cursor noch "geparkt" ist nichts machen!!
+ // Calculate the new rectangles.
+ // JP 16.01.98: If the cursor is still "parked" do nothing!!
if( !aSelBoxes.Count() || bParked ||
!GetPoint()->nNode.GetIndex() )
return;
@@ -946,7 +697,7 @@ void SwShellTableCrsr::FillRects()
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
- ASSERT( pFrm, "Node nicht in einer Tabelle" );
+ OSL_ENSURE( pFrm, "Node nicht in einer Tabelle" );
while ( pFrm )
{
@@ -961,11 +712,11 @@ void SwShellTableCrsr::FillRects()
}
-// Pruefe, ob sich der SPoint innerhalb der Tabellen-SSelection befindet
+// Check if the SPoint is within the Table-SSelection.
sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const
{
- // die neuen Rechtecke berechnen
- // JP 16.01.98: wenn der Cursor noch "geparkt" ist nichts machen!!
+ // Calculate the new rectangles.
+ // JP 16.01.98: If the cursor is still "parked" do nothing!!
if( !aSelBoxes.Count() || bParked ||
!GetPoint()->nNode.GetIndex() )
return sal_False;
@@ -981,17 +732,17 @@ sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const
SwFrm* pFrm = pCNd->GetFrm( &GetPtPos() );
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
- ASSERT( pFrm, "Node nicht in einer Tabelle" );
+ OSL_ENSURE( pFrm, "Node nicht in einer Tabelle" );
if( pFrm && pFrm->Frm().IsInside( rPt ) )
return sal_True;
}
return sal_False;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
-// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
-// am sichtbaren Cursor
+// JP 05.03.98: To test the UNO-Crsr behavior here the implementation on the
+// visible cursor.
sal_Bool SwShellTableCrsr::IsSelOvr( int eFlags )
{
return SwShellCrsr::IsSelOvr( eFlags );
@@ -1004,3 +755,4 @@ sal_Bool SwShellTableCrsr::IsAtValidPos( sal_Bool bPoint ) const
return SwShellCrsr::IsAtValidPos( bPoint );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index d25c7d8417cb..eb653789da52 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,12 @@
#include <svl/svstdarr.hxx>
#include <tools/resmgr.hxx>
#include <poolfmt.hxx>
-#ifndef _RDIC_HRC
#include <rcid.hrc>
-#endif
#include <tools/debug.hxx>
+#ifdef _NEED_TO_DEBUG_MAPPING
+#include <stdlib.h>
+#endif
+
extern ResMgr* pSwResMgr;
// Initialise UI names to 0
SvStringsDtor *SwStyleNameMapper::pTextUINameArray = 0,
@@ -485,7 +488,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_LISTS_BEGIN ; nId < RES_POOLCOLL_LISTS_END ; nId++,nIndex++ )
{
@@ -497,7 +500,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_EXTRA_BEGIN ; nId < RES_POOLCOLL_EXTRA_END ; nId++,nIndex++ )
{
@@ -509,7 +512,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_REGISTER_BEGIN ; nId < RES_POOLCOLL_REGISTER_END ; nId++,nIndex++ )
{
@@ -521,7 +524,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_DOC_BEGIN ; nId < RES_POOLCOLL_DOC_END ; nId++,nIndex++ )
{
@@ -533,7 +536,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCOLL_HTML_BEGIN ; nId < RES_POOLCOLL_HTML_END ; nId++,nIndex++ )
{
@@ -545,7 +548,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -559,7 +562,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
for ( nIndex = 0, nId = RES_POOLCHR_HTML_BEGIN ; nId < RES_POOLCHR_HTML_END ; nId++,nIndex++ )
{
@@ -571,7 +574,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -585,7 +588,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -599,7 +602,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
{
@@ -613,7 +616,7 @@ const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlag
bString = GetUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
nNewId = GetPoolIdFromUIName ( aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL );
if ( nNewId != nId )
- *((sal_Int32*)0) = 42;
+ abort();
}
}
}
@@ -1140,3 +1143,4 @@ const String SwStyleNameMapper::GetSpecialExtraUIName( const String& rExtraProgN
return aRes;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index e53679d8d92e..dd4219417214 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,14 +50,12 @@
#include <docsh.hxx>
#include <vector>
-/* -----------------------------05.08.2002 12:43------------------------------
- ---------------------------------------------------------------------------*/
class SwAutoCompleteClient : public SwClient
{
SwAutoCompleteWord* pAutoCompleteWord;
SwDoc* pDoc;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong nSwAutoCompleteClientCount;
#endif
public:
@@ -68,13 +67,11 @@ public:
virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
const SwDoc& GetDoc(){return *pDoc;}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
};
-/* -----------------------------05.08.2002 12:48------------------------------
- ---------------------------------------------------------------------------*/
typedef std::vector<SwAutoCompleteClient> SwAutoCompleteClientVector;
class SwAutoCompleteWord_Impl
@@ -88,14 +85,11 @@ public:
void RemoveDocument(const SwDoc& rDoc);
};
-/* -----------------------------05.08.2002 14:11------------------------------
-
- ---------------------------------------------------------------------------*/
typedef const SwDoc* SwDocPtr;
typedef std::vector<SwDocPtr> SwDocPtrVector;
class SwAutoCompleteString : public String
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong nSwAutoCompleteStringCount;
#endif
SwDocPtrVector aSourceDocs;
@@ -106,51 +100,43 @@ class SwAutoCompleteString : public String
void AddDocument(const SwDoc& rDoc);
//returns true if last document reference has been removed
sal_Bool RemoveDocument(const SwDoc& rDoc);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_uLong GetElementCount() {return nSwAutoCompleteStringCount;}
#endif
};
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uLong SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
sal_uLong SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
#endif
-/* -----------------------------06.08.2002 08:57------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::SwAutoCompleteClient(SwAutoCompleteWord& rToTell, SwDoc& rSwDoc) :
pAutoCompleteWord(&rToTell),
pDoc(&rSwDoc)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteClientCount;
#endif
}
-/* -----------------------------05.08.2002 14:07------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::SwAutoCompleteClient(const SwAutoCompleteClient& rClient) :
SwClient(),
pAutoCompleteWord(rClient.pAutoCompleteWord),
pDoc(rClient.pDoc)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteClientCount;
#endif
}
-/* -----------------------------05.08.2002 14:10------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteClient::~SwAutoCompleteClient()
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
--nSwAutoCompleteClientCount;
#endif
}
-/* -----------------06.03.2003 15:30-----------------
- --------------------------------------------------*/
SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient& rClient)
{
pAutoCompleteWord = rClient.pAutoCompleteWord;
@@ -161,9 +147,7 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient
pRegisteredIn->Remove(this);
return *this;
}
-/* -----------------------------05.08.2002 12:49------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *)
{
switch( pOld ? pOld->Which() : 0 )
@@ -177,26 +161,22 @@ void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *)
}
}
-/* -----------------------------05.08.2002 13:03------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord_Impl::AddDocument(SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
return;
}
aClientVector.push_back(SwAutoCompleteClient(rAutoCompleteWord, rDoc));
}
-/* -----------------------------05.08.2002 14:33------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc)
{
SwAutoCompleteClientVector::iterator aIt;
- for(aIt = aClientVector.begin(); aIt != aClientVector.end(); aIt++)
+ for(aIt = aClientVector.begin(); aIt != aClientVector.end(); ++aIt)
{
if(&aIt->GetDoc() == &rDoc)
{
@@ -205,32 +185,26 @@ void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc)
}
}
}
-/* -----------------------------06.08.2002 08:54------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteString::SwAutoCompleteString(const String& rStr, xub_StrLen nPos, xub_StrLen nLen) :
String( rStr, nPos, nLen )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nSwAutoCompleteStringCount;
#endif
}
-/* -----------------------------05.08.2002 14:22------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteString::~SwAutoCompleteString()
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
--nSwAutoCompleteStringCount;
#endif
}
-/* -----------------------------05.08.2002 14:17------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
return;
@@ -238,13 +212,11 @@ void SwAutoCompleteString::AddDocument(const SwDoc& rDoc)
SwDocPtr pNew = &rDoc;
aSourceDocs.push_back(pNew);
}
-/* -----------------------------05.08.2002 14:36------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
{
SwDocPtrVector::iterator aIt;
- for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); aIt++)
+ for(aIt = aSourceDocs.begin(); aIt != aSourceDocs.end(); ++aIt)
{
if(*aIt == &rDoc)
{
@@ -254,9 +226,7 @@ sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
}
return sal_False;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwAutoCompleteWord::SwAutoCompleteWord( sal_uInt16 nWords, sal_uInt16 nMWrdLen )
: aWordLst( 0, 255 ), aLRULst( 0, 255 ),
pImpl(new SwAutoCompleteWord_Impl(*this)),
@@ -275,7 +245,7 @@ SwAutoCompleteWord::~SwAutoCompleteWord()
delete pCurrent;
}
delete pImpl;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uLong nStrings = SwAutoCompleteString::GetElementCount();
sal_uLong nClients = SwAutoCompleteClient::GetElementCount();
DBG_ASSERT(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
@@ -340,7 +310,7 @@ sal_Bool SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
pCurrent->AddDocument(rDoc);
nInsPos = aLRULst.GetPos( (void*)pNew );
- ASSERT( USHRT_MAX != nInsPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nInsPos, "String nicht gefunden" );
if( nInsPos )
{
void** ppData = (void**)aLRULst.GetData();
@@ -361,7 +331,7 @@ void SwAutoCompleteWord::SetMaxCount( sal_uInt16 nNewMax )
while( nNewMax < aWordLst.Count() && nLRUIndex < aLRULst.Count())
{
sal_uInt16 nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
void * pDel = aWordLst[nPos];
aWordLst.Remove(nPos);
delete (SwAutoCompleteString*)pDel;
@@ -387,7 +357,7 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
aWordLst.Remove(nPos);
sal_uInt16 nDelPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nDelPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nDelPos, "String nicht gefunden" );
aLRULst.Remove( nDelPos );
--nPos;
delete (SwAutoCompleteString*)pDel;
@@ -425,7 +395,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
aWordLst.Remove(nMyPos);
sal_uInt16 nPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
if( nMyPos >= --nMyLen )
@@ -440,7 +410,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
{
void* pDel = aWordLst[ nNewPos ];
sal_uInt16 nPos = aLRULst.GetPos( pDel );
- ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
+ OSL_ENSURE( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
}
@@ -448,9 +418,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
aWordLst.Remove( nMyPos, nMyLen - nMyPos );
}
}
-/* -----------------------------05.08.2002 12:54------------------------------
- ---------------------------------------------------------------------------*/
void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
{
pImpl->RemoveDocument(rDoc);
@@ -471,3 +439,4 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 08dab4aff359..2bf98e0576ba 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,7 +113,8 @@ SW_DLLPUBLIC const char * dbg_out(const String & aStr)
SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
{
- return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr();
+ aDbgOutResult = ByteString( rtl::OUStringToOString( aStr, RTL_TEXTENCODING_ASCII_US ) );
+ return aDbgOutResult.GetBuffer();
}
@@ -550,7 +552,7 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String::CreateFromInt32(rNode.GetIndex());
aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aTmpStr += String(" serial=\"", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String::CreateFromInt32(rNode.GetSerial());
aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US);
@@ -638,7 +640,6 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String::CreateFromInt32
- //(static_cast<SwTxtFmtColl *>(pColl)->GetOutlineLevel());//#outline level,zhaojianwei
(static_cast<SwTxtFmtColl *>(pColl)->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
const SwNumRuleItem & rItem =
@@ -977,7 +978,7 @@ String lcl_TokenType2Str(FormTokenType nType)
return String("??", RTL_TEXTENCODING_ASCII_US);
}
- ASSERT(false, "should not be reached");
+ OSL_ENSURE(false, "should not be reached");
return String("??", RTL_TEXTENCODING_ASCII_US);
}
@@ -998,7 +999,7 @@ String lcl_dbg_out(const SwFormTokens & rTokens)
SwFormTokens::const_iterator aIt;
- for (aIt = rTokens.begin(); aIt != rTokens.end(); aIt++)
+ for (aIt = rTokens.begin(); aIt != rTokens.end(); ++aIt)
{
if (aIt != rTokens.begin())
aStr += String(", ", RTL_TEXTENCODING_ASCII_US);
@@ -1038,3 +1039,4 @@ SW_DLLPUBLIC const char * dbg_out(const SwNodeRange & rRange)
#endif // DEBUG
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 47dc02014aa7..43cbc83ec773 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,7 +76,6 @@
#include <txtrfmrk.hxx>
#include <frmatr.hxx>
#include <linkenum.hxx>
-#include <errhdl.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <swtable.hxx>
@@ -86,7 +86,7 @@
#include <UndoInsert.hxx>
#include <UndoSplitMove.hxx>
#include <UndoTable.hxx>
-#include <pagedesc.hxx> //DTor
+#include <pagedesc.hxx> //DTor
#include <breakit.hxx>
#include <ndole.hxx>
#include <ndgrf.hxx>
@@ -130,14 +130,11 @@
/* @@@MAINTAINABILITY-HORROR@@@
Probably unwanted dependency on SwDocShell
*/
-// --> OD 2005-08-29 #125370#
#include <layouter.hxx>
-// <--
using namespace ::com::sun::star;
using ::rtl::OUString;
-
// Seiten-Deskriptoren
SV_IMPL_PTRARR(SwPageDescs,SwPageDescPtr);
// Verzeichnisse
@@ -145,11 +142,10 @@ SV_IMPL_PTRARR( SwTOXTypes, SwTOXTypePtr )
// FeldTypen
SV_IMPL_PTRARR( SwFldTypes, SwFldTypePtr)
-/** IInterface
-*/
+/* IInterface */
sal_Int32 SwDoc::acquire()
{
- OSL_ASSERT(mReferenceCount >= 0 && "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
+ OSL_ENSURE(mReferenceCount >= 0, "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
return osl_incrementInterlockedCount(&mReferenceCount);
}
@@ -161,12 +157,11 @@ sal_Int32 SwDoc::release()
sal_Int32 SwDoc::getReferenceCount() const
{
- OSL_ASSERT(mReferenceCount >= 0 && "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
+ OSL_ENSURE(mReferenceCount >= 0, "Negative reference count detected! This is a sign for unbalanced acquire/release calls.");
return mReferenceCount;
}
-/** IDocumentSettingAccess
-*/
+/* IDocumentSettingAccess */
bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
{
switch (id)
@@ -191,17 +186,16 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case TABLE_ROW_KEEP: return mbTableRowKeep;
case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
- // --> OD 2006-08-25 #i68949#
+ // #i68949#
case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
- // <--
case UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading;
case USE_OLD_PRINTER_METRICS: return mbOldPrinterMetrics;
case TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent;
case PROTECT_FORM: return mbProtectForm;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList;
- // <--
- // COMPATIBILITY FLAGS END
+ case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
+ case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
case BROWSE_MODE: return mbBrowseMode;
case HTML_MODE: return mbHTMLMode;
@@ -213,7 +207,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
default:
- ASSERT(false, "Invalid setting id");
+ OSL_ENSURE(false, "Invalid setting id");
}
return false;
}
@@ -258,9 +252,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
if (pOutlineRule)
{
pOutlineRule->Validate();
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !mbOldNumbering );
- // <--
}
}
break;
@@ -302,52 +295,67 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbDoNotCaptureDrawObjsOnPage = value;
break;
- // --> OD 2006-08-25 #i68949#
+ // #i68949#
case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
mbClipAsCharacterAnchoredWriterFlyFrames = value;
break;
- // <--
+
case UNIX_FORCE_ZERO_EXT_LEADING:
mbUnixForceZeroExtLeading = value;
break;
+
case PROTECT_FORM:
- mbProtectForm = value;
- break;
+ mbProtectForm = value;
+ break;
case USE_OLD_PRINTER_METRICS:
mbOldPrinterMetrics = value;
break;
case TABS_RELATIVE_TO_INDENT:
mbTabRelativeToIndent = value;
- break;
- // --> OD 2008-06-05 #i89181#
+ break;
+ // #i89181#
case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
mbTabAtLeftIndentForParagraphsInList = value;
- break;
- // <--
+ break;
+
+ case INVERT_BORDER_SPACING:
+ mbInvertBorderSpacing = value;
+ break;
+
+ case COLLAPSE_EMPTY_CELL_PARA:
+ mbCollapseEmptyCellPara = value;
+ break;
// COMPATIBILITY FLAGS END
case BROWSE_MODE:
mbBrowseMode = value;
break;
+
case HTML_MODE:
mbHTMLMode = value;
break;
+
case GLOBAL_DOCUMENT:
mbIsGlobalDoc = value;
break;
+
case GLOBAL_DOCUMENT_SAVE_LINKS:
mbGlblDocSaveLinks = value;
break;
+
case LABEL_DOCUMENT:
mbIsLabelDoc = value;
break;
+
case PURGE_OLE:
mbPurgeOLE = value;
break;
+
case KERN_ASIAN_PUNCTUATION:
mbKernAsianPunctuation = value;
break;
+
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
mbDoNotResetParaAttrsForNumFont = value;
break;
@@ -355,7 +363,7 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbMathBaselineAlignment = value;
break;
default:
- ASSERT(false, "Invalid setting id");
+ OSL_ENSURE(false, "Invalid setting id");
}
}
@@ -363,7 +371,7 @@ const i18n::ForbiddenCharacters*
SwDoc::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
{
const i18n::ForbiddenCharacters* pRet = 0;
- if( xForbiddenCharsTable.isValid() )
+ if( xForbiddenCharsTable.is() )
pRet = xForbiddenCharsTable->GetForbiddenCharacters( nLang, sal_False );
if( bLocaleData && !pRet && pBreakIt )
pRet = &pBreakIt->GetForbidden( (LanguageType)nLang );
@@ -373,7 +381,7 @@ const i18n::ForbiddenCharacters*
void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
/*[in]*/ const i18n::ForbiddenCharacters& rFChars )
{
- if( !xForbiddenCharsTable.isValid() )
+ if( !xForbiddenCharsTable.is() )
{
uno::Reference<
lang::XMultiServiceFactory > xMSF =
@@ -397,9 +405,9 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
SetModified();
}
-vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
+rtl::Reference<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
{
- if( !xForbiddenCharsTable.isValid() )
+ if( !xForbiddenCharsTable.is() )
{
uno::Reference<
lang::XMultiServiceFactory > xMSF =
@@ -409,7 +417,7 @@ vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable()
return xForbiddenCharsTable;
}
-const vos::ORef<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable() const
+const rtl::Reference<SvxForbiddenCharactersTable>& SwDoc::getForbiddenCharacterTable() const
{
return xForbiddenCharsTable;
}
@@ -467,8 +475,7 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
}
}
-/** IDocumentDeviceAccess
-*/
+/* IDocumentDeviceAccess */
SfxPrinter* SwDoc::getPrinter(/*[in]*/ bool bCreate ) const
{
SfxPrinter* pRet = 0;
@@ -503,10 +510,9 @@ void SwDoc::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/
}
if ( bCallPrtDataChanged &&
- // --> FME 2005-01-21 #i41075# Do not call PrtDataChanged() if we do not
+ // #i41075# Do not call PrtDataChanged() if we do not
// use the printer for formatting:
!get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) )
- // <--
PrtDataChanged();
}
@@ -572,14 +578,13 @@ void SwDoc::setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewH
}
else
{
- // --> FME 2005-01-21 #i41075#
+ // #i41075#
// We have to take care that a printer exists before calling
// PrtDataChanged() in order to prevent that PrtDataChanged()
// triggers this funny situation:
// getReferenceDevice()->getPrinter()->CreatePrinter_()
// ->setPrinter()-> PrtDataChanged()
SfxPrinter* pPrinter = getPrinter( true );
- // <--
if( pDrawModel )
pDrawModel->SetRefDevice( pPrinter );
}
@@ -663,8 +668,7 @@ void SwDoc::setPrintData(/*[in]*/ const SwPrintData& rPrtData )
*pPrtData = rPrtData;
}
-/** Implementations the next Interface here
-*/
+/* Implementations the next Interface here */
/*
* Dokumenteditieren (Doc-SS) zum Fuellen des Dokuments
@@ -687,7 +691,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
return false;
{
- // Bug 26675: DataChanged vorm loeschen verschicken, dann bekommt
+ // BUG 26675: DataChanged vorm loeschen verschicken, dann bekommt
// man noch mit, welche Objecte sich im Bereich befinden.
// Danach koennen sie vor/hinter der Position befinden.
SwDataChanged aTmp( this, rPos, 0 );
@@ -782,7 +786,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
_SaveCntntIdx( this, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(),
aBkmkArr, SAVEFLY_SPLIT );
// FIXME: only SwTxtNode has a valid implementation of SplitCntntNode!
- ASSERT(pNode->IsTxtNode(), "splitting non-text node?");
+ OSL_ENSURE(pNode->IsTxtNode(), "splitting non-text node?");
pNode = pNode->SplitCntntNode( rPos );
if (pNode)
{
@@ -884,11 +888,10 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
}
else
{ // ist Undo und Gruppierung eingeschaltet, ist alles anders !
- SwUndoInsert * pUndo = NULL; // #111827#
+ SwUndoInsert * pUndo = NULL;
// don't group the start if hints at the start should be expanded
if (!(nInsertMode & IDocumentContentOperations::INS_FORCEHINTEXPAND))
- // -> #111827#
{
SwUndo *const pLastUndo = GetUndoManager().GetLastUndo();
SwUndoInsert *const pUndoInsert(
@@ -898,7 +901,6 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
pUndo = pUndoInsert;
}
}
- // <- #111827#
CharClass const& rCC = GetAppCharClass();
xub_StrLen nInsPos = rPos.nContent.GetIndex();
@@ -976,6 +978,7 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg,
pDfltGrfFmtColl ),
pFlyAttrSet, pGrfAttrSet, pFrmFmt );
}
+
SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj,
const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet,
@@ -1035,7 +1038,6 @@ SwFlyFrmFmt* SwDoc::InsertOLE(const SwPaM &rRg, const String& rObjName,
|* SwDoc::GetFldType()
|* Beschreibung: liefert den am Doc eingerichteten Feldtypen zurueck
*************************************************************************/
-
SwFieldType *SwDoc::GetSysFldType( const sal_uInt16 eWhich ) const
{
for( sal_uInt16 i = 0; i < INIT_FLDTYPES; ++i )
@@ -1043,10 +1045,10 @@ SwFieldType *SwDoc::GetSysFldType( const sal_uInt16 eWhich ) const
return (*pFldTypes)[i];
return 0;
}
+
/*************************************************************************
* void SetDocStat( const SwDocStat& rStat );
*************************************************************************/
-
void SwDoc::SetDocStat( const SwDocStat& rStat )
{
*pDocStat = rStat;
@@ -1057,9 +1059,6 @@ const SwDocStat& SwDoc::GetDocStat() const
return *pDocStat;
}
-/*************************************************************************/
-
-
struct _PostItFld : public _SetGetExpFld
{
_PostItFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, const SwIndex* pIdx = 0 )
@@ -1075,7 +1074,6 @@ struct _PostItFld : public _SetGetExpFld
}
};
-
sal_uInt16 _PostItFld::GetPageNo(
const StringRangeEnumerator &rRangeEnum,
const std::set< sal_Int32 > &rPossiblePages,
@@ -1108,7 +1106,6 @@ sal_uInt16 _PostItFld::GetPageNo(
return 0;
}
-
bool lcl_GetPostIts(
IDocumentFieldsAccess* pIDFA,
_SetGetExpFlds * pSrtLst )
@@ -1146,7 +1143,6 @@ bool lcl_GetPostIts(
return bHasPostIts;
}
-
static void lcl_FormatPostIt(
IDocumentContentOperations* pIDCO,
SwPaM& aPam,
@@ -1154,7 +1150,7 @@ static void lcl_FormatPostIt(
bool bNewPage, bool bIsFirstPostIt,
sal_uInt16 nPageNo, sal_uInt16 nLineNo )
{
- static char __READONLY_DATA sTmp[] = " : ";
+ static char const sTmp[] = " : ";
DBG_ASSERT( ViewShell::GetShellRes(), "missing ShellRes" );
@@ -1199,7 +1195,6 @@ static void lcl_FormatPostIt(
pIDCO->InsertString( aPam, aStr );
}
-
// provide the paper tray to use according to the page style in use,
// but do that only if the respective item is NOT just the default item
static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
@@ -1216,7 +1211,6 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
return nRes;
}
-
void SwDoc::CalculatePagesForPrinting(
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
@@ -1248,7 +1242,6 @@ void SwDoc::CalculatePagesForPrinting(
sal_uInt16 nFirstPageNo = 0;
sal_uInt16 nLastPageNo = 0;
- sal_uInt16 nPageNo = 1;
for( sal_uInt16 i = 1; i <= (sal_uInt16)aPages.Max(); ++i )
{
@@ -1295,7 +1288,7 @@ void SwDoc::CalculatePagesForPrinting(
aMulti = aTmpMulti;
// Ende des HACKs
- nPageNo = nFirstPageNo;
+ sal_uInt16 nPageNo = nFirstPageNo;
std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays();
std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet();
@@ -1309,9 +1302,8 @@ void SwDoc::CalculatePagesForPrinting(
( (bRightPg && bPrintRightPages) ||
(!bRightPg && bPrintLeftPages) ) )
{
- // --> FME 2005-12-12 #b6354161# Feature - Print empty pages
+ // Feature - Print empty pages
if ( bPrintEmptyPages || pStPage->Frm().Height() )
- // <--
{
rValidPages.insert( nPageNo );
rValidStartFrms[ nPageNo ] = pStPage;
@@ -1341,14 +1333,8 @@ void SwDoc::CalculatePagesForPrinting(
// get PageRange value to use
OUString aPageRange;
- // --> PL, OD #i116085# - adjusting fix for i113919
-// if (bIsPDFExport)
-// {
-// aPageRange = rOptions.getStringValue( "PageRange", OUString() );
-// }
-// else
+ // #i116085# - adjusting fix for i113919
if ( !bIsPDFExport )
- // <--
{
// PageContent :
// 0 -> print all pages (default if aPageRange is empty)
@@ -1383,7 +1369,6 @@ void SwDoc::CalculatePagesForPrinting(
1, nDocPageCount, 0, &rData.GetValidPagesSet() );
}
-
void SwDoc::UpdatePagesForPrintingWithPostItData(
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
@@ -1567,7 +1552,6 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
}
}
-
void SwDoc::CalculatePagePairsForProspectPrinting(
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
@@ -1714,7 +1698,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// thus we are done here.
}
-
sal_uInt16 SwDoc::GetPageCount() const
{
return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
@@ -1745,11 +1728,9 @@ const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
return aSize;
}
-
/*************************************************************************
* void UpdateDocStat( const SwDocStat& rStat );
*************************************************************************/
-
void SwDoc::UpdateDocStat( SwDocStat& rStat )
{
if( rStat.bModified )
@@ -1796,22 +1777,22 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aStat( rStat.nPage ? 7 : 6);
sal_Int32 n=0;
- aStat[n].Name = ::rtl::OUString::createFromAscii("TableCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nTbl;
- aStat[n].Name = ::rtl::OUString::createFromAscii("ImageCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nGrf;
- aStat[n].Name = ::rtl::OUString::createFromAscii("ObjectCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ObjectCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nOLE;
if ( rStat.nPage )
{
- aStat[n].Name = ::rtl::OUString::createFromAscii("PageCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nPage;
}
- aStat[n].Name = ::rtl::OUString::createFromAscii("ParagraphCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParagraphCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nPara;
- aStat[n].Name = ::rtl::OUString::createFromAscii("WordCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nWord;
- aStat[n].Name = ::rtl::OUString::createFromAscii("CharacterCount");
+ aStat[n].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharacterCount"));
aStat[n++].Value <<= (sal_Int32)rStat.nChar;
// For e.g. autotext documents there is no pSwgInfo (#i79945)
@@ -1838,9 +1819,7 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
-
// Dokument - Info
-
void SwDoc::DocInfoChgd( )
{
GetSysFldType( RES_DOCINFOFLD )->UpdateFlds();
@@ -1848,7 +1827,7 @@ void SwDoc::DocInfoChgd( )
SetModified();
}
- // returne zum Namen die im Doc gesetzte Referenz
+// returne zum Namen die im Doc gesetzte Referenz
const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const
{
const SfxPoolItem* pItem;
@@ -1867,7 +1846,7 @@ const SwFmtRefMark* SwDoc::GetRefMark( const String& rName ) const
return 0;
}
- // returne die RefMark per Index - fuer Uno
+// returne die RefMark per Index - fuer Uno
const SwFmtRefMark* SwDoc::GetRefMark( sal_uInt16 nIndex ) const
{
const SfxPoolItem* pItem;
@@ -1891,10 +1870,10 @@ const SwFmtRefMark* SwDoc::GetRefMark( sal_uInt16 nIndex ) const
return pRet;
}
- // returne die Namen aller im Doc gesetzten Referenzen
- //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
+// returne die Namen aller im Doc gesetzten Referenzen
+//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
sal_uInt16 SwDoc::GetRefMarks( SvStringsDtor* pNames ) const
{
const SfxPoolItem* pItem;
@@ -1965,14 +1944,11 @@ bool SwDoc::IsModified() const
void SwDoc::SetModified()
{
- // --> OD 2005-08-29 #125370#
SwLayouter::ClearMovedFwdFrms( *this );
SwLayouter::ClearObjsTmpConsiderWrapInfluence( *this );
SwLayouter::ClearFrmsNotToWrap( *this );
- // <--
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
SwLayouter::ClearMoveBwdLayoutInfo( *this );
- // <--
// dem Link wird der Status returnt, wie die Flags waren und werden
// Bit 0: -> alter Zustand
// Bit 1: -> neuer Zustand
@@ -2010,7 +1986,6 @@ void SwDoc::ResetModified()
}
}
-
void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
const String& rFltName, const Graphic* pGraphic,
const GraphicObject* pGrafObj )
@@ -2082,7 +2057,6 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
return sal_True;
}
-
/*************************************************************************
* SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong )
*
@@ -2093,10 +2067,9 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
* Mit bOnlyWrong kann man dann steuern, ob nur die Bereiche mit falschen
* Woertern oder die kompletten Bereiche neu ueberprueft werden muessen.
************************************************************************/
-
void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags )
{
- ASSERT( GetRootFrm(), "SpellAgain: Where's my RootFrm?" );
+ OSL_ENSURE( GetRootFrm(), "SpellAgain: Where's my RootFrm?" );
if( bInvalid )
{
SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
@@ -2170,8 +2143,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
{
::SetProgressState( i, GetDocShell() );
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;
@@ -2210,7 +2182,7 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
if( bImpress )
{
SwTxtFmtColl* pMyColl = pNd->GetTxtColl();
- //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
@@ -2232,8 +2204,8 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool
}
}
- // loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
- // versteckte Bereiche, versteckte Absaetze
+// loesche den nicht sichtbaren Content aus dem Document, wie z.B.:
+// versteckte Bereiche, versteckte Absaetze
bool SwDoc::RemoveInvisibleContent()
{
sal_Bool bRet = sal_False;
@@ -2313,12 +2285,10 @@ bool SwDoc::RemoveInvisibleContent()
SwScriptInfo::DeleteHiddenRanges( *pTxtNd );
}
- // --> FME 2006-01-11 #120473#
// Footnotes/Frames may have been removed, therefore we have
// to reset n:
if ( bRemoved )
n = aPam.GetPoint()->nNode.GetIndex();
- // <--
}
}
@@ -2467,9 +2437,7 @@ bool SwDoc::RestoreInvisibleContent()
return bRet;
}
-/*-- 11.06.2004 08:34:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwDoc::ConvertFieldsToText()
{
sal_Bool bRet = sal_False;
@@ -2580,7 +2548,7 @@ bool SwDoc::LinksUpdated() const
return mbLinksUpdated;
}
- // embedded alle lokalen Links (Bereiche/Grafiken)
+// embedded alle lokalen Links (Bereiche/Grafiken)
::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr )
{
for( sal_uInt16 n = 0; n < rLinks.Count(); ++n )
@@ -2633,10 +2601,6 @@ bool SwDoc::EmbedAllLinks()
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsInsTblFormatNum() const
{
return SW_MOD()->IsInsTblFormatNum(get(IDocumentSettingAccess::HTML_MODE));
@@ -2647,16 +2611,12 @@ sal_Bool SwDoc::IsInsTblChangeNumFormat() const
return SW_MOD()->IsInsTblChangeNumFormat(get(IDocumentSettingAccess::HTML_MODE));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsInsTblAlignNum() const
{
return SW_MOD()->IsInsTblAlignNum(get(IDocumentSettingAccess::HTML_MODE));
}
- // setze das InsertDB als Tabelle Undo auf:
+// setze das InsertDB als Tabelle Undo auf:
void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable )
{
if( bIsTable )
@@ -2697,7 +2657,6 @@ void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew)
}
}
-// #111827#
String SwDoc::GetPaMDescr(const SwPaM & rPam) const
{
String aResult;
@@ -2736,7 +2695,6 @@ String SwDoc::GetPaMDescr(const SwPaM & rPam) const
return aResult;
}
-// -> #111840#
SwField * SwDoc::GetField(const SwPosition & rPos)
{
SwTxtFld * const pAttr = GetTxtFld(rPos);
@@ -2753,7 +2711,6 @@ SwTxtFld * SwDoc::GetTxtFld(const SwPosition & rPos)
rPos.nContent.GetIndex(), RES_TXTATR_FIELD) )
: 0;
}
-// <- #111840#
bool SwDoc::ContainsHiddenChars() const
{
@@ -2803,7 +2760,6 @@ void SwDoc::ChkCondColls()
}
}
-#ifdef FUTURE_VBA
uno::Reference< script::vba::XVBAEventProcessor >
SwDoc::GetVbaEventProcessor()
{
@@ -2822,7 +2778,6 @@ SwDoc::GetVbaEventProcessor()
}
return mxVbaEvents;
}
-#endif
void SwDoc::setExternalData(::sw::tExternalDataType eType,
::sw::tExternalDataPointer pPayload)
@@ -2834,3 +2789,5 @@ void SwDoc::setExternalData(::sw::tExternalDataType eType,
{
return m_externalData[eType];
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index 77665e55fbce..00c6d40b5d91 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-#ifndef _RTL_USTRING_HXX //autogen
#include <rtl/ustring.hxx>
-#endif
#include <svtools/imap.hxx>
#include <svtools/imapobj.hxx>
#include <basic/sbx.hxx>
@@ -43,9 +42,7 @@
#include <frmatr.hxx>
#include <docary.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swevent.hxx>
using namespace ::com::sun::star::uno;
@@ -137,12 +134,6 @@ sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs
eErr = pDocShell->CallXScript(
rMacro.GetMacName(), *pUnoArgs, aRet, aOutArgsIndex, aOutArgs);
- //*pRet = pRetValue->GetString();
- // use the AnyConverter to return a String if appropriate?
-
- // need to call something like lcl_translateUno2Basic
- // pArgs = lcl_translateUno2Basic( pUnoArgs );
-
delete pUnoArgs;
break;
}
@@ -257,12 +248,6 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
nRet += 0 == pDocShell->CallXScript(
rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0;
- //*pRet = pRetValue->GetString();
- // use the AnyConverter to return a String if appropriate?
-
- // need to call something like lcl_translateUno2Basic
- // pArgs = lcl_translateUno2Basic( pUnoArgs );
-
delete pUnoArgs;
}
// JavaScript calls are ignored
@@ -274,3 +259,4 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 50fb0e7b98f7..30f65bd3b311 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <docary.hxx>
#include <xmloff/odffields.hxx>
#include <editsh.hxx>
-#include <errhdl.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <functional>
@@ -351,28 +351,28 @@ namespace sw { namespace mark
switch(eType)
{
case IDocumentMarkAccess::TEXT_FIELDMARK:
- pMark = shared_ptr<IMark>(new TextFieldmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new TextFieldmark(rPaM));
break;
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- pMark = shared_ptr<IMark>(new CheckboxFieldmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new CheckboxFieldmark(rPaM));
break;
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
- pMark = shared_ptr<IMark>(new NavigatorReminder(rPaM));
+ pMark = boost::shared_ptr<IMark>(new NavigatorReminder(rPaM));
break;
case IDocumentMarkAccess::BOOKMARK:
- pMark = shared_ptr<IMark>(new Bookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new Bookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::DDE_BOOKMARK:
- pMark = shared_ptr<IMark>(new DdeBookmark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new DdeBookmark(rPaM));
break;
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- pMark = shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
- pMark = shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
+ pMark = boost::shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, KeyCode(), rName, ::rtl::OUString()));
break;
case IDocumentMarkAccess::UNO_BOOKMARK:
- pMark = shared_ptr<IMark>(new UnoMark(rPaM));
+ pMark = boost::shared_ptr<IMark>(new UnoMark(rPaM));
break;
}
OSL_ENSURE(pMark.get(),
@@ -394,12 +394,10 @@ namespace sw { namespace mark
case IDocumentMarkAccess::BOOKMARK:
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- // if(dynamic_cast<IBookmark*>)
lcl_InsertMarkSorted(m_vBookmarks, pMark);
break;
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- // if(dynamic_cast<IFieldmark*>
lcl_InsertMarkSorted(m_vFieldmarks, pMark);
break;
case IDocumentMarkAccess::NAVIGATOR_REMINDER:
@@ -418,6 +416,7 @@ namespace sw { namespace mark
OSL_TRACE("Fieldmarks");
lcl_DebugMarks(m_vFieldmarks);
#endif
+
return pMark.get();
}
@@ -609,7 +608,7 @@ namespace sw { namespace mark
{
// completely in range
- // --> OD 2009-08-07 #i92125#
+ // #i92125#
bool bKeepCrossRefBkmk( false );
{
if ( rStt == rEnd &&
@@ -627,7 +626,6 @@ namespace sw { namespace mark
pSaveBkmk->push_back(SaveBookmark(true, true, *pMark, rStt, pSttIdx));
vMarksToDelete.push_back(ppMark);
}
- // <--
}
else if(isPosInRange ^ isOtherPosInRange)
{
@@ -644,7 +642,7 @@ namespace sw { namespace mark
rEnd,
isPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos());
- // --> OD 2009-08-06 #i92125#
+ // #i92125#
// no move of position for cross-reference bookmarks,
// if move occurs inside a certain node
if ( ( IDocumentMarkAccess::GetType(*pMark) !=
@@ -661,17 +659,16 @@ namespace sw { namespace mark
// illegal selection? collapse the mark and restore sorting later
isSortingNeeded |= lcl_FixCorrectedMark(isPosInRange, isOtherPosInRange, pMark);
}
- // <--
}
}
// we just remembered the iterators to delete, so we do not need to search
- // for the shared_ptr<> (the entry in m_vMarks) again
+ // for the boost::shared_ptr<> (the entry in m_vMarks) again
// reverse iteration, since erasing an entry invalidates iterators
// behind it (the iterators in vMarksToDelete are sorted)
for(vector<const_iterator_t>::reverse_iterator pppMark = vMarksToDelete.rbegin();
pppMark != vMarksToDelete.rend();
- pppMark++)
+ ++pppMark)
{
deleteMark(*pppMark);
}
@@ -703,7 +700,6 @@ namespace sw { namespace mark
}
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- // if(dynamic_cast<IFieldmark*>
{
IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, *ppMark);
OSL_ENSURE(ppFieldmark != m_vFieldmarks.end(),
@@ -746,7 +742,7 @@ namespace sw { namespace mark
iterator_t pMarkHigh = m_vMarks.end();
iterator_t pMarkFound = find_if(
pMarkLow, pMarkHigh,
- bind(equal_to<const IMark*>(), bind(&shared_ptr<IMark>::get, _1), pMark));
+ bind(equal_to<const IMark*>(), bind(&boost::shared_ptr<IMark>::get, _1), pMark));
if(pMarkFound != pMarkHigh)
deleteMark(pMarkFound);
}
@@ -810,6 +806,7 @@ namespace sw { namespace mark
IFieldmark* MarkManager::getFieldmarkBefore(const SwPosition& rPos) const
{ return dynamic_cast<IFieldmark*>(lcl_getMarkBefore(m_vFieldmarks, rPos)); }
+
::rtl::OUString MarkManager::getUniqueMarkName(const ::rtl::OUString& rName) const
{
OSL_ENSURE(rName.getLength(),
@@ -836,10 +833,6 @@ namespace sw { namespace mark
}} // namespace ::sw::mark
-// old implementation
-
-//SV_IMPL_OP_PTRARR_SORT(SwBookmarks, SwBookmarkPtr)
-
#define PCURCRSR (_pCurrCrsr)
#define FOREACHPAM_START(pSttCrsr) \
{\
@@ -1496,10 +1489,10 @@ void _RestoreCntntIdx(SwDoc* pDoc,
case 0x0800:
case 0x0801:
{
- sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1656,10 +1649,10 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
case 0x0800:
case 0x0801:
{
- sal_uInt16 nCnt = 0;
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1744,3 +1737,5 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 1d1890521acf..78fafdf4d15d 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,6 @@
#include <ndindex.hxx>
#include <swtable.hxx>
#include <ndtxt.hxx>
-#include <ndole.hxx>
#include <calc.hxx>
#include <frmfmt.hxx>
#include <cellfml.hxx>
@@ -52,7 +52,7 @@
#include <swtblfmt.hxx>
#include <tblsel.hxx>
#include <cellatr.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unochart.hxx>
@@ -78,7 +78,7 @@ sal_Bool SwTable::IsTblComplexForChart( const String& rSelection,
if( '>' == sBox.GetChar( sBox.Len()-1 ) ) sBox.Erase( sBox.Len()-1 );
xub_StrLen nTrenner = sBox.Search( ':' );
- ASSERT( STRING_NOTFOUND != nTrenner, "keine gueltige Selektion" );
+ OSL_ENSURE( STRING_NOTFOUND != nTrenner, "keine gueltige Selektion" );
pSttBox = GetTblBox( sBox.Copy( 0, nTrenner ));
pEndBox = GetTblBox( sBox.Copy( nTrenner+1 ));
@@ -224,7 +224,7 @@ SwChartDataProvider * SwDoc::GetChartDataProvider( bool bCreate ) const
{
// since there must be only one instance of this object per document
// we need a mutex here
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bCreate && !aChartDataProviderImplRef.get())
{
@@ -275,3 +275,4 @@ SwChartLockController_Helper & SwDoc::GetChartControllerHelper()
return *pChartControllerHelper;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index e0c550dff020..69c070ab3d20 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <vcl/vclenum.hxx>
#include <editeng/crsditem.hxx>
#include <editeng/colritem.hxx>
@@ -50,8 +49,11 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <vector>
+
using namespace ::com::sun::star;
+using ::std::vector;
class CompareLine
{
@@ -63,15 +65,13 @@ public:
virtual sal_Bool Compare( const CompareLine& rLine ) const = 0;
};
-DECLARE_LIST( CompareList, CompareLine* )
-
class CompareData
{
- sal_uLong* pIndex;
- sal_Bool* pChangedFlag;
+ size_t* pIndex;
+ bool* pChangedFlag;
protected:
- CompareList aLines;
+ vector< CompareLine* > aLines;
sal_uLong nSttLineNum;
// Anfang und Ende beschneiden und alle anderen in das
@@ -103,25 +103,25 @@ public:
// Eindeutigen Index fuer eine Line setzen. Gleiche Lines haben den
// selben Index; auch in den anderen CompareData!
- void SetIndex( sal_uLong nLine, sal_uLong nIndex );
- sal_uLong GetIndex( sal_uLong nLine ) const
- { return nLine < aLines.Count() ? pIndex[ nLine ] : 0; }
+ void SetIndex( size_t nLine, size_t nIndex );
+ size_t GetIndex( size_t nLine ) const
+ { return nLine < aLines.size() ? pIndex[ nLine ] : 0; }
// setze/erfrage ob eine Zeile veraendert ist
- void SetChanged( sal_uLong nLine, sal_Bool bFlag = sal_True );
- sal_Bool GetChanged( sal_uLong nLine ) const
+ void SetChanged( size_t nLine, bool bFlag = true );
+ bool GetChanged( size_t nLine ) const
{
- return (pChangedFlag && nLine < aLines.Count())
+ return (pChangedFlag && nLine < aLines.size())
? pChangedFlag[ nLine ]
: 0;
}
- sal_uLong GetLineCount() const { return aLines.Count(); }
+ size_t GetLineCount() const { return aLines.size(); }
sal_uLong GetLineOffset() const { return nSttLineNum; }
- const CompareLine* GetLine( sal_uLong nLine ) const
- { return aLines.GetObject( nLine ); }
+ const CompareLine* GetLine( size_t nLine ) const
+ { return aLines[ nLine ]; }
void InsertLine( CompareLine* pLine )
- { aLines.Insert( pLine, LIST_APPEND ); }
+ { aLines.push_back( pLine ); }
};
class Hash
@@ -195,12 +195,8 @@ public:
Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 );
};
-// ====================================================================
-
CompareLine::~CompareLine() {}
-// ----------------------------------------------------------------------
-
CompareData::CompareData()
: pIndex( 0 ), pChangedFlag( 0 ), nSttLineNum( 0 )
{
@@ -212,25 +208,25 @@ CompareData::~CompareData()
delete[] pChangedFlag;
}
-void CompareData::SetIndex( sal_uLong nLine, sal_uLong nIndex )
+void CompareData::SetIndex( size_t nLine, size_t nIndex )
{
if( !pIndex )
{
- pIndex = new sal_uLong[ aLines.Count() ];
- memset( pIndex, 0, aLines.Count() * sizeof( sal_uLong ) );
+ pIndex = new size_t[ aLines.size() ];
+ memset( pIndex, 0, aLines.size() * sizeof( size_t ) );
}
- if( nLine < aLines.Count() )
+ if( nLine < aLines.size() )
pIndex[ nLine ] = nIndex;
}
-void CompareData::SetChanged( sal_uLong nLine, sal_Bool bFlag )
+void CompareData::SetChanged( size_t nLine, bool bFlag )
{
if( !pChangedFlag )
{
- pChangedFlag = new sal_Bool[ aLines.Count() +1 ];
- memset( pChangedFlag, 0, aLines.Count() +1 * sizeof( sal_Bool ) );
+ pChangedFlag = new bool[ aLines.size() +1 ];
+ memset( pChangedFlag, 0, (aLines.size() +1) * sizeof( bool ) );
}
- if( nLine < aLines.Count() )
+ if( nLine < aLines.size() )
pChangedFlag[ nLine ] = bFlag;
}
@@ -312,8 +308,6 @@ void CompareData::CheckForChangesInLine( const CompareData& ,
{
}
-// ----------------------------------------------------------------------
-
Hash::Hash( sal_uLong nSize )
: nCount( 1 )
{
@@ -373,14 +367,14 @@ void Hash::CalcHashValue( CompareData& rData )
{
if( pHashArr )
{
- for( sal_uLong n = 0; n < rData.GetLineCount(); ++n )
+ for( size_t n = 0; n < rData.GetLineCount(); ++n )
{
const CompareLine* pLine = rData.GetLine( n );
- ASSERT( pLine, "wo ist die Line?" );
+ OSL_ENSURE( pLine, "wo ist die Line?" );
sal_uLong nH = pLine->GetHashValue();
sal_uLong* pFound = &pHashArr[ nH % nPrime ];
- sal_uLong i;
+ size_t i;
for( i = *pFound; ; i = pDataArr[i].nNext )
if( !i )
{
@@ -400,8 +394,6 @@ void Hash::CalcHashValue( CompareData& rData )
}
}
-// ----------------------------------------------------------------------
-
Compare::Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 )
{
MovedData *pMD1, *pMD2;
@@ -448,8 +440,6 @@ Compare::Compare( sal_uLong nDiff, CompareData& rData1, CompareData& rData2 )
delete pMD2;
}
-
-
void Compare::CountDifference( const CompareData& rData, sal_uLong* pCounts )
{
sal_uLong nLen = rData.GetLineCount();
@@ -588,8 +578,6 @@ void Compare::CheckDiscard( sal_uLong nLen, sal_Char* pDiscard )
}
}
-// ----------------------------------------------------------------------
-
Compare::MovedData::MovedData( CompareData& rData, sal_Char* pDiscard )
: pIndex( 0 ), pLineNum( 0 ), nCount( 0 )
{
@@ -622,9 +610,7 @@ Compare::MovedData::~MovedData()
delete pLineNum;
}
-// ----------------------------------------------------------------------
-
- // Suche die verschobenen Lines
+// Suche die verschobenen Lines
Compare::CompareSequence::CompareSequence(
CompareData& rD1, CompareData& rD2,
const MovedData& rMD1, const MovedData& rMD2 )
@@ -708,26 +694,22 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
for (c = 1;; ++c)
{
long d; /* Active diagonal. */
- long big_snake = 0;
/* Extend the top-down search by an edit step in each diagonal. */
fmin > dmin ? pFDiag[--fmin - 1] = -1 : ++fmin;
fmax < dmax ? pFDiag[++fmax + 1] = -1 : --fmax;
for (d = fmax; d >= fmin; d -= 2)
{
- long x, y, oldx, tlo = pFDiag[d - 1], thi = pFDiag[d + 1];
+ long x, y, tlo = pFDiag[d - 1], thi = pFDiag[d + 1];
if (tlo >= thi)
x = tlo + 1;
else
x = thi;
- oldx = x;
y = x - d;
while( sal_uLong(x) < nEnd1 && sal_uLong(y) < nEnd2 &&
rMoved1.GetIndex( x ) == rMoved2.GetIndex( y ))
++x, ++y;
- if (x - oldx > 20)
- big_snake = 1;
pFDiag[d] = x;
if( odd && bmin <= d && d <= bmax && pBDiag[d] <= pFDiag[d] )
{
@@ -741,19 +723,16 @@ sal_uLong Compare::CompareSequence::CheckDiag( sal_uLong nStt1, sal_uLong nEnd1,
bmax < dmax ? pBDiag[++bmax + 1] = INT_MAX : --bmax;
for (d = bmax; d >= bmin; d -= 2)
{
- long x, y, oldx, tlo = pBDiag[d - 1], thi = pBDiag[d + 1];
+ long x, y, tlo = pBDiag[d - 1], thi = pBDiag[d + 1];
if (tlo < thi)
x = tlo;
else
x = thi - 1;
- oldx = x;
y = x - d;
while( sal_uLong(x) > nStt1 && sal_uLong(y) > nStt2 &&
rMoved1.GetIndex( x - 1 ) == rMoved2.GetIndex( y - 1 ))
--x, --y;
- if (oldx - x > 20)
- big_snake = 1;
pBDiag[d] = x;
if (!odd && fmin <= d && d <= fmax && pBDiag[d] <= pFDiag[d])
{
@@ -840,8 +819,6 @@ void Compare::ShiftBoundaries( CompareData& rData1, CompareData& rData2 )
}
}
-/* */
-
class SwCompareLine : public CompareLine
{
const SwNode& rNode;
@@ -892,8 +869,6 @@ public:
void SetRedlinesToDoc( sal_Bool bUseDocInfo );
};
-// ----------------------------------------------------------------
-
SwCompareLine::SwCompareLine( const SwNode& rNd )
: rNode( rNd )
{
@@ -1245,8 +1220,6 @@ sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
return bRet;
}
-// ----------------------------------------------------------------
-
SwCompareData::~SwCompareData()
{
if( pDelRing )
@@ -1291,7 +1264,6 @@ sal_uLong SwCompareData::PrevIdx( const SwNode* pNd )
return pNd->GetIndex() - 1;
}
-
void SwCompareData::CheckRanges( CompareData& rData )
{
const SwNodes& rSrcNds = ((SwCompareData&)rData).rDoc.GetNodes();
@@ -1345,7 +1317,6 @@ void SwCompareData::CheckRanges( CompareData& rData )
}
}
-
void SwCompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd )
{
SwPaM* pTmp = new SwPaM( ((SwCompareLine*)GetLine( nStt ))->GetNode(), 0,
@@ -1436,8 +1407,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
{
SwPaM* pTmp = pDelRing;
- // Bug #83296#: get the Author / TimeStamp from the "other"
- // document info
+ // get the Author / TimeStamp from the "other" document info
sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
DateTime aTimeStamp;
SwDocShell *pDocShell(rDoc.GetDocShell());
@@ -1571,11 +1541,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
}
}
-/* */
-
-
-
- // returnt (?die Anzahl der Unterschiede?) ob etwas unterschiedlich ist
+// returnt (?die Anzahl der Unterschiede?) ob etwas unterschiedlich ist
long SwDoc::CompareDoc( const SwDoc& rDoc )
{
if( &rDoc == this )
@@ -1619,7 +1585,6 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
return nRet;
}
-
class _SaveMergeRedlines : public Ring
{
const SwRedline* pSrcRedl;
@@ -1880,4 +1845,4 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
return nRet;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 3477619fba33..d13affa1c536 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -358,3 +359,4 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
return GetEditShell(0);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index bef9ea1f254f..10892ca2a611 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <stdlib.h>
-#ifndef _APP_HXX
#include <vcl/svapp.hxx>
-#endif
#include <tools/urlobj.hxx>
#define _SVSTDARR_STRINGS
@@ -416,3 +415,4 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 463e15bf6b6e..30adf7eb721a 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,8 +97,8 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
//Raender haben eine defaultmaessige Mindestgroesse.
//wenn der Drucker einen groesseren Rand vorgibt, so
//ist mir dass auch recht.
- // MIB 06/25/2002, #99397#: The HTML page desc had A4 as page size
- // always. This has been changed to take the page size from the printer.
+ // The HTML page desc had A4 as page size always.
+ // This has been changed to take the page size from the printer.
// Unfortunately, the margins of the HTML page desc are smaller than
// the margins used here in general, so one extra case is required.
// In the long term, this needs to be changed to always keep the
@@ -140,9 +141,6 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
|*
|* SwDoc::ChgPageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 01. Mar. 95
-|*
|*************************************************************************/
void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
@@ -154,7 +152,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!!
//Die interressanten Attribute uebernehmen.
- sal_uInt16 __READONLY_DATA aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
+ sal_uInt16 const aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
RES_COL, RES_COL,
RES_FRAMEDIR, RES_FRAMEDIR,
@@ -198,7 +196,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{
- ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
+ OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
@@ -438,8 +436,6 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
|*
|* Beschreibung Alle Descriptoren, deren Follow auf den zu loeschenden
|* zeigen muessen angepasst werden.
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung JP 04.09.95
|*
|*************************************************************************/
@@ -484,7 +480,7 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
((SwFmt*)pMod)->SetFmtAttr( aDfltDesc );
else
{
- ASSERT( !this, "was ist das fuer ein Mofify-Obj?" );
+ OSL_ENSURE( !this, "was ist das fuer ein Mofify-Obj?" );
aPageDescs[0]->Add( pLast );
}
}
@@ -532,7 +528,6 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
}
}
-// #116530#
void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
sal_uInt16 nOp)
{
@@ -553,18 +548,16 @@ void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
{
- ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
- ASSERT( i != 0, "Default Pagedesc loeschen is nicht." );
+ OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
+ OSL_ENSURE( i != 0, "Default Pagedesc loeschen is nicht." );
if ( i == 0 )
return;
SwPageDesc *pDel = aPageDescs[i];
- // -> #116530#
if (bBroadcast)
BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_PAGE,
SFX_STYLESHEET_ERASED);
- // <- #116530#
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -585,9 +578,6 @@ void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
|*
|* SwDoc::MakePageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 20. Aug. 93
-|*
|*************************************************************************/
sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
@@ -620,11 +610,9 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
}
aPageDescs.Insert( pNew, aPageDescs.Count() );
- // -> #116530#
if (bBroadcast)
BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PAGE,
SFX_STYLESHEET_CREATED);
- // <- #116530#
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -655,8 +643,6 @@ SwPageDesc* SwDoc::FindPageDescByName( const String& rName, sal_uInt16* pPos ) c
/******************************************************************************
* Methode : void SwDoc::PrtDataChanged()
* Beschreibung:
- * Erstellt : OK 27.10.94 10:20
- * Aenderung : MA 26. Mar. 98
******************************************************************************/
void SwDoc::PrtDataChanged()
@@ -664,8 +650,8 @@ void SwDoc::PrtDataChanged()
//!!!!!!!! Bei Aenderungen hier bitte ggf. InJobSetup im Sw3io mitpflegen
// --> FME 2005-01-21 #i41075#
- ASSERT( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
- 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" )
+ OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
+ 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" );
// <--
SwWait *pWait = 0;
@@ -825,19 +811,6 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
//Wenn es keine Benachrichtigung wuenscht
if ( xObj.is() )
{
- //TODO/LATER: needs MiscStatus for ResizeOnPrinterChange
- /*
- if ( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xRef->GetMiscStatus())
- {
- if ( pOLENd->GetFrm() )
- {
- xObj->OnDocumentPrinterChanged( pPrt );
- pShell->CalcAndSetScale( xObj );//Client erzeugen lassen.
- }
- else
- pOLENd->SetOLESizeInvalid( sal_True );
- }
- else */
pGlobalOLEExcludeList->Insert(
new SvGlobalName( aName ),
pGlobalOLEExcludeList->Count() );
@@ -888,20 +861,6 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
//Wenn es keine Benachrichtigung wuenscht
if( pOLENd->GetOLEObj().GetOleRef().is() ) //Kaputt?
{
- //TODO/LATER: needs MiscStatus for ResizeOnPrinterChange
- /*
- if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE &
- xRef->GetMiscStatus() )
- {
- if( pOLENd->GetFrm() )
- {
- xRef->OnDocumentPrinterChanged( pPrt );
- pSh->CalcAndSetScale( xRef );//Client erzeugen lassen.
- }
- else
- pOLENd->SetOLESizeInvalid( sal_True );
- }*/
- // repaint it
pOLENd->Modify( &aMsgHint, &aMsgHint );
}
}
@@ -941,12 +900,12 @@ SwPageDesc * SwDoc::GetPageDesc( const String & rName )
return aResult;
}
-void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast ) // #116530#
+void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast )
{
sal_uInt16 nI;
if (FindPageDesc(rName, &nI))
- DelPageDesc(nI, bBroadcast); // #116530#
+ DelPageDesc(nI, bBroadcast);
}
void SwDoc::ChgPageDesc( const String & rName, const SwPageDesc & rDesc)
@@ -1016,3 +975,5 @@ sal_Bool SwDoc::IsSquaredPageMode() const
(const SwTextGridItem&)GetDefault( RES_TEXTGRID );
return rGrid.IsSquaredMode();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 91d99221e1fd..6c4fb754e305 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,20 +67,15 @@
#include <svx/svdetc.hxx>
#include <editeng/fhgtitem.hxx>
-// OD 26.06.2003 #108784#
#include <svx/svdpagv.hxx>
-// OD 2004-04-01 #i26791#
-#include <dcontact.hxx>
+
#include <txtfrm.hxx>
-#include <frmfmt.hxx>
#include <editeng/frmdiritem.hxx>
#include <fmtornt.hxx>
-// --> OD 2006-03-14 #i62875#
+
#include <svx/svditer.hxx>
-// <--
-// --> OD 2006-11-01 #130889#
+
#include <vector>
-// <--
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -91,11 +87,8 @@ SV_IMPL_VARARR_SORT( _ZSortFlys, _ZSortFly )
|*
|* SwDoc::GroupSelection / SwDoc::UnGroupSelection
|*
-|* Ersterstellung JP 21.08.95
-|* Letzte Aenderung JP 21.08.95
-|*
|*************************************************************************/
-// OD 2004-04-01 #i26791# - local method to determine positioning and
+// local method to determine positioning and
// alignment attributes for a drawing object, which is newly connected to
// the layout. Used for a newly formed group object <SwDoc::GroupSelection(..)>
// and the members of a destroyed group <SwDoc::UnGroupSelection(..)>
@@ -103,35 +96,32 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
const SdrObject& _rSdrObj )
{
const SwContact* pContact = GetUserCall( &_rSdrObj );
- ASSERT( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
+ OSL_ENSURE( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
// determine position of new group object relative to its anchor frame position
SwTwips nHoriRelPos = 0;
SwTwips nVertRelPos = 0;
{
const SwFrm* pAnchorFrm = pContact->GetAnchoredObj( &_rSdrObj )->GetAnchorFrm();
- ASSERT( !pAnchorFrm ||
+ OSL_ENSURE( !pAnchorFrm ||
!pAnchorFrm->IsTxtFrm() ||
!static_cast<const SwTxtFrm*>(pAnchorFrm)->IsFollow(),
"<lcl_AdjustPositioningAttr(..)> - anchor frame is a follow. Please inform OD." );
bool bVert = false;
bool bR2L = false;
- // --> OD 2005-05-10 #i45952# - use anchor position of
- // anchor frame, if it exist.
+ // #i45952# - use anchor position of anchor frame, if it exist.
Point aAnchorPos;
if ( pAnchorFrm )
{
- // --> OD 2005-05-10 #i45952#
+ // #i45952#
aAnchorPos = pAnchorFrm->GetFrmAnchorPos( ::HasWrap( &_rSdrObj ) );
- // <--
bVert = pAnchorFrm->IsVertical();
bR2L = pAnchorFrm->IsRightToLeft();
}
else
{
- // --> OD 2005-05-10 #i45952#
+ // #i45952#
aAnchorPos = _rSdrObj.GetAnchorPos();
- // <--
// If no anchor frame exist - e.g. because no layout exists - the
// default layout direction is taken.
const SvxFrameDirectionItem* pDirItem =
@@ -143,9 +133,8 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
// vertical from left-to-right - Badaa: supported now!
bVert = true;
bR2L = true;
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- //ASSERT( false, "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
- //End
+ OSL_ENSURE( false,
+ "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
}
break;
case FRMDIR_VERT_TOP_RIGHT:
@@ -202,10 +191,9 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
_pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
_pFrmFmt->SetFmtAttr( SwFmtVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
- // --> OD 2005-03-11 #i44334#, #i44681# - positioning attributes already set
+ // #i44334#, #i44681# - positioning attributes already set
_pFrmFmt->PosAttrSet();
- // <--
- // --> OD 2004-10-01 #i34750# - keep current object rectangle for drawing
+ // #i34750# - keep current object rectangle for drawing
// objects. The object rectangle is used on events from the drawing layer
// to adjust the positioning attributes - see <SwDrawContact::_Changed(..)>.
{
@@ -219,13 +207,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
->SetLastObjRect( aObjRect.SVRect() );
}
}
- // <--
}
SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
{
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
+ // replace marked 'virtual' drawing objects by the corresponding 'master'
+ // drawing objects.
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
@@ -243,28 +230,26 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
? 0
: new SwUndoDrawGroup( (sal_uInt16)rMrkList.GetMarkCount() );
- // --> OD 2005-08-16 #i53320#
+ // #i53320#
bool bGroupMembersNotPositioned( false );
{
SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<SwAnchoredDrawObject*>(pMyContact->GetAnchoredObj( pObj ));
bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned();
}
- // <--
//ContactObjekte und Formate vernichten.
for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- // --> OD 2005-08-16 #i53320#
-#ifdef DBG_UTIL
+ // #i53320#
+#if OSL_DEBUG_LEVEL > 1
SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ));
- ASSERT( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
+ OSL_ENSURE( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
"<SwDoc::GroupSelection(..)> - group members have different positioning status!" );
#endif
- // <--
pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
//loescht sich selbst!
@@ -276,41 +261,37 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
else
DelFrmFmt( pFmt );
- // --> OD 2005-05-10 #i45952# - re-introduce position
- // normalization of group member objects, because its anchor position
- // is cleared, when they are grouped.
+ // #i45952# - re-introduce position normalization of group member
+ // objects, because its anchor position is cleared, when they are
+ // grouped.
Point aAnchorPos( pObj->GetAnchorPos() );
pObj->NbcSetAnchorPos( Point( 0, 0 ) );
pObj->NbcMove( Size( aAnchorPos.X(), aAnchorPos.Y() ) );
- // <--
}
pFmt = MakeDrawFrmFmt( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "DrawObject" )),
GetDfltFrmFmt() );
pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
SdrObject* pNewGroupObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
pNewContact = new SwDrawContact( pFmt, pNewGroupObj );
- // --> OD 2004-11-22 #i35635#
+ // #i35635#
pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
- // <--
pNewContact->ConnectToLayout();
- // --> OD 2005-08-16 #i53320# - No adjustment of the positioning and
- // alignment attributes, if group members aren't positioned yet.
+ // #i53320# - No adjustment of the positioning and alignment
+ // attributes, if group members aren't positioned yet.
if ( !bGroupMembersNotPositioned )
{
- // OD 2004-04-01 #i26791# - Adjust positioning and alignment attributes.
+ // #i26791# - Adjust positioning and alignment attributes.
lcl_AdjustPositioningAttr( pFmt, *pNewGroupObj );
}
- // <--
if( pUndo )
{
@@ -326,7 +307,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
}
rDrawView.GroupMarked();
- ASSERT( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
+ OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
}
return pNewContact;
@@ -341,20 +322,16 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
GetIDocumentUndoRedo().ClearRedo();
}
- // OD 30.06.2003 #108784# - replace marked 'virtual' drawing objects by
- // the corresponding 'master' drawing objects.
+ // replace marked 'virtual' drawing objects by the corresponding 'master'
+ // drawing objects.
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- // --> OD 2006-11-01 #130889#
std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() );
- // <--
if ( nMarkCount )
{
- // --> OD 2006-11-01 #130889#
pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount];
- // <--
SdrObject *pMyObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pMyObj->GetUpGroup() )
{
@@ -382,24 +359,10 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
GetDfltFrmFmt() );
pFmt->SetFmtAttr( aAnch );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
- // --> OD 2006-11-01 #130889#
- // creation of <SwDrawContact> instances for the group
- // members and its connection to the Writer layout is
- // done after intrinsic ungrouping.
-// SwDrawContact* pContact = new SwDrawContact( pFmt, pSubObj );
-// // --> OD 2004-11-22 #i35635#
-// pContact->MoveObjToVisibleLayer( pSubObj );
-// // <--
-// pContact->ConnectToLayout();
-// // OD 2004-04-07 #i26791# - Adjust positioning and
-// // alignment attributes.
-// lcl_AdjustPositioningAttr( pFmt, *pSubObj );
pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
- // <--
if( bUndo )
pUndo->AddObj( i2, pFmt );
@@ -409,7 +372,6 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
}
}
rDrawView.UnGroupMarked();
- // --> OD 2006-11-01 #130889#
// creation of <SwDrawContact> instances for the former group members and
// its connection to the Writer layout.
for ( sal_uInt32 i = 0; i < nMarkCount; ++i )
@@ -439,16 +401,12 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
}
}
delete [] pFmtsAndObjs;
- // <--
}
/*************************************************************************
|*
|* SwDoc::DeleteSelection()
|*
-|* Ersterstellung MA 14. Nov. 95
-|* Letzte Aenderung MA 14. Nov. 95
-|*
|*************************************************************************/
sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
@@ -512,13 +470,13 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
if( pContact ) // natuerlich nicht bei gruppierten Objekten
{
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- // OD 18.06.2003 #108784# - before delete of selection
- // is performed, marked <SwDrawVirtObj>-objects have to
- // be replaced by its reference objects.
- // Thus, assert, if a <SwDrawVirt>-object is found in the mark list.
+ // before delete of selection is performed, marked
+ // <SwDrawVirtObj>-objects have to be replaced by its
+ // reference objects. Thus, assert, if a
+ // <SwDrawVirt>-object is found in the mark list.
if ( pObj->ISA(SwDrawVirtObj) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawVirtObj> is still marked for delete. application will crash!" );
}
//loescht sich selbst!
@@ -551,9 +509,6 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
|*
|* SwDoc::DeleteSelection()
|*
-|* Ersterstellung JP 11.01.96
-|* Letzte Aenderung JP 11.01.96
-|*
|*************************************************************************/
_ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
@@ -587,7 +542,7 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum();
}
else {
- ASSERT( !this, "was ist das fuer ein Format?" );
+ OSL_ENSURE( !this, "was ist das fuer ein Format?" );
}
}
@@ -596,7 +551,6 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// des Drawing Layers auftrat. In diesem Fall wird der Layer komplett
// neu aufgebaut.
-// #75371#
#include <svx/sxenditm.hxx>
void SwDoc::InitDrawModel()
@@ -611,11 +565,9 @@ void SwDoc::InitDrawModel()
//DrawPool und EditEnginePool anlegen, diese gehoeren uns und werden
//dem Drawing nur mitgegeben. Im ReleaseDrawModel werden die Pools wieder
//zerstoert.
- // 17.2.99: for Bug 73110 - for loading the drawing items. This must
- // be loaded without RefCounts!
+ // for loading the drawing items. This must be loaded without RefCounts!
SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
- // #75371# change DefaultItems for the SdrEdgeObj distance items
- // to TWIPS.
+ // change DefaultItems for the SdrEdgeObj distance items to TWIPS.
if(pSdrPool)
{
const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
@@ -636,7 +588,7 @@ void SwDoc::InitDrawModel()
else
pSdrPool->FreezeIdRanges();
- // SJ: #95129# set FontHeight pool defaults without changing static SdrEngineDefaults
+ // set FontHeight pool defaults without changing static SdrEngineDefaults
GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create DrawDocument" );
@@ -656,8 +608,7 @@ void SwDoc::InitDrawModel()
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
nControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
- // OD 25.06.2003 #108784# - add invisible layers corresponding to the
- // visible ones.
+ // add invisible layers corresponding to the visible ones.
{
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
nInvisibleHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
@@ -701,12 +652,7 @@ void SwDoc::InitDrawModel()
}
}
-/** method to notify drawing page view about the invisible layers
-
- OD 26.06.2003 #108784#
-
- @author OD
-*/
+/** method to notify drawing page view about the invisible layers */
void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
{
String sLayerNm;
@@ -722,10 +668,7 @@ void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
/** method to determine, if a layer ID belongs to the visible ones.
- OD 25.06.2003 #108784#
Note: If given layer ID is unknown, method asserts and returns <false>.
-
- @author OD
*/
bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
{
@@ -745,7 +688,7 @@ bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
}
else
{
- ASSERT( false, "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." );
+ OSL_ENSURE( false, "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." );
bRetVal = false;
}
@@ -754,11 +697,8 @@ bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
/** method to determine, if the corresponding visible layer ID for a invisible one.
- OD 25.06.2003 #108784#
Note: If given layer ID is a visible one, method returns given layer ID.
Note: If given layer ID is unknown, method returns given layer ID.
-
- @author OD
*/
SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId )
{
@@ -780,12 +720,12 @@ SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisible
_nInvisibleLayerId == GetHellId() ||
_nInvisibleLayerId == GetControlsId() )
{
- ASSERT( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." );
+ OSL_ENSURE( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." );
nVisibleLayerId = _nInvisibleLayerId;
}
else
{
- ASSERT( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." );
+ OSL_ENSURE( false, "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." );
nVisibleLayerId = _nInvisibleLayerId;
}
@@ -794,11 +734,8 @@ SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisible
/** method to determine, if the corresponding invisible layer ID for a visible one.
- OD 25.06.2003 #108784#
Note: If given layer ID is a invisible one, method returns given layer ID.
Note: If given layer ID is unknown, method returns given layer ID.
-
- @author OD
*/
SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId )
{
@@ -820,12 +757,12 @@ SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLa
_nVisibleLayerId == GetInvisibleHellId() ||
_nVisibleLayerId == GetInvisibleControlsId() )
{
- ASSERT( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." );
+ OSL_ENSURE( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." );
nInvisibleLayerId = _nVisibleLayerId;
}
else
{
- ASSERT( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." );
+ OSL_ENSURE( false, "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." );
nInvisibleLayerId = _nVisibleLayerId;
}
@@ -844,9 +781,9 @@ void SwDoc::ReleaseDrawModel()
delete pDrawModel; pDrawModel = 0;
SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
- ASSERT( pSdrPool, "missing Pool" );
+ OSL_ENSURE( pSdrPool, "missing Pool" );
SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
- ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
+ OSL_ENSURE( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
pSdrPool->Delete(); //Erst die Items vernichten lassen,
//dann erst die Verkettung loesen
GetAttrPool().SetSecondaryPool( 0 ); //Der ist ein muss!
@@ -861,7 +798,7 @@ void SwDoc::ReleaseDrawModel()
SdrModel* SwDoc::_MakeDrawModel()
{
- ASSERT( !pDrawModel, "_MakeDrawModel: Why?" );
+ OSL_ENSURE( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
if ( pLayout && pLayout->GetCurrShell() )
{
@@ -979,7 +916,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
}
else
{
- DBG_ERROR("unbekannter Feldbefehl");
+ OSL_FAIL("unbekannter Feldbefehl");
pInfo->SetRepresentation( String( '?' ) );
}
}
@@ -999,7 +936,7 @@ SdrLayerID SwDoc::GetInvisibleHellId() const { return nInvisibleHell; }
SdrLayerID SwDoc::GetInvisibleControlsId() const { return nInvisibleControls; }
SdrModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
-// --> OD 2006-03-14 #i62875#
+// #i62875#
namespace docfunc
{
bool ExistsDrawObjs( SwDoc& p_rDoc )
@@ -1054,7 +991,7 @@ namespace docfunc
{
if ( !pAnchoredDrawObj )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<docfunc::AllDrawObjsOnPage() - missing anchored draw object" );
bAllDrawObjsOnPage = false;
break;
@@ -1089,5 +1026,5 @@ namespace docfunc
return bAllDrawObjsOnPage;
}
}
-// <--
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 6e5c259a9d04..ba43772dcaa0 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,6 @@
#include <UndoDelete.hxx>
#include <breakit.hxx>
#include <hhcwrp.hxx>
-#include <breakit.hxx>
#include <vcl/msgbox.hxx>
#include "comcore.hrc"
#include "editsh.hxx"
@@ -86,7 +86,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
using namespace ::com::sun::star::i18n;
-//using namespace ::utl;
#ifndef S2U
#define S2U(rString) OUString::createFromAscii(rString)
#endif
@@ -190,8 +189,6 @@ void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rStart )
}
}
-// -----------------------------------------------------------------
-
void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
const SwNodeIndex* pInsertPos )
{
@@ -291,7 +288,6 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
SwFmtAnchor aAnchor( *pAnchor );
aAnchor.SetAnchor( &aPos );
pFmt->SetFmtAttr( aAnchor );
-// ((SwFmtAnchor*)pAnchor)->SetAnchor( &aPos );
}
}
else if( ( rSttNdIdx.GetIndex() + nSttOff <= pAPos->nNode.GetIndex()
@@ -309,11 +305,8 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
}
}
-// -----------------------------------------------------------------
-
// loesche und verschiebe alle "Fly's am Absatz", die in der SSelection
// liegen. Steht am SPoint ein Fly, wird dieser auf den Mark verschoben.
-
void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
const SwNodeIndex& rPtNdIdx )
{
@@ -360,17 +353,14 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
pDoc->DelLayoutFmt( pFmt );
- // --> FME 2004-10-06 #117913# DelLayoutFmt can also
- // trigger the deletion of objects.
+ // DelLayoutFmt can also trigger the deletion of objects.
if( i > rTbl.Count() )
i = rTbl.Count();
- // <--
}
}
}
}
-
bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
const SwNodeIndex& rInsPos,
SwFtnIdxs& rFtnArr, SwFtnIdxs& rSaveArr,
@@ -569,7 +559,6 @@ void lcl_RestoreRedlines( SwDoc* pDoc, const SwPosition& rPos, _SaveRedlines& rA
pDoc->SetRedlineMode_intern( eOld );
}
-
void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
{
SwDoc* pDoc = rRg.aStart.GetNode().GetDoc();
@@ -605,7 +594,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
pTmpPos->nNode.GetNode().GetCntntNode(), 0 );
_SaveRedline* pSave = new _SaveRedline( pNewRedl, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
pTmpPos = pTmp->End();
@@ -629,7 +617,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
{
// gesamt verschieben
_SaveRedline* pSave = new _SaveRedline( pTmp, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
}
else
@@ -642,7 +629,6 @@ void lcl_SaveRedlines( const SwNodeRange& rRg, _SaveRedlines& rArr )
pTmpPos->nNode.GetNode().GetCntntNode(), 0 );
_SaveRedline* pSave = new _SaveRedline( pNewRedl, rRg.aStart );
-// rArr.Insert( pSave, rArr.Count() );
rArr.C40_INSERT( _SaveRedline, pSave, rArr.Count() );
pTmpPos = pTmp->Start();
@@ -674,12 +660,10 @@ void lcl_RestoreRedlines( SwDoc* pDoc, sal_uInt32 nInsPos, _SaveRedlines& rArr )
pDoc->SetRedlineMode_intern( eOld );
}
-// ------------------------------------------------------------------------
// #i59534: Redo of insertion of multiple text nodes runs into trouble
// because of unnecessary expanded redlines
// From now on this class saves the redline positions of all redlines which ends exact at the
// insert position (node _and_ content index)
-
_SaveRedlEndPosForRestore::_SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx, xub_StrLen nCnt )
: pSavArr( 0 ), pSavIdx( 0 ), nSavCntnt( nCnt )
{
@@ -728,14 +712,11 @@ void _SaveRedlEndPosForRestore::_Restore()
}
}
-
-// ------------------------------------------------------------------------
-
// Loeschen einer vollstaendigen Section des NodesArray.
// Der uebergebene Node steht irgendwo in der gewuenschten Section
void SwDoc::DeleteSection( SwNode *pNode )
{
- ASSERT( pNode, "Kein Node uebergeben." );
+ OSL_ENSURE( pNode, "Kein Node uebergeben." );
SwStartNode* pSttNd = pNode->IsStartNode() ? (SwStartNode*)pNode
: pNode->StartOfSectionNode();
SwNodeIndex aSttIdx( *pSttNd ), aEndIdx( *pNode->EndOfSectionNode() );
@@ -754,7 +735,6 @@ void SwDoc::DeleteSection( SwNode *pNode )
GetNodes().DelNodes( aSttIdx, aEndIdx.GetIndex() - aSttIdx.GetIndex() + 1 );
}
-
void SwDoc::SetModified(SwPaM &rPaM)
{
SwDataChanged aTmp( rPaM, 0 );
@@ -764,7 +744,6 @@ void SwDoc::SetModified(SwPaM &rPaM)
/*************************************************************************
* SwDoc::Overwrite()
************************************************************************/
-
bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
{
SwPosition& rPt = *(SwPosition*)rRg.GetPoint();
@@ -873,7 +852,6 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
return sal_True;
}
-
bool SwDoc::MoveAndJoin( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
{
SwNodeIndex aIdx( rPaM.Start()->nNode );
@@ -1031,7 +1009,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
else
rPaM.DeleteMark();
- ASSERT( *aSavePam.GetMark() == rPos ||
+ OSL_ENSURE( *aSavePam.GetMark() == rPos ||
( aSavePam.GetMark()->nNode.GetNode().GetCntntNode() == NULL ),
"PaM wurde nicht verschoben, am Anfang/Ende keine ContentNodes?" );
*aSavePam.GetMark() = rPos;
@@ -1073,7 +1051,6 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
}
bJoin = sal_False;
}
-// else if( !bCorrSavePam && !pSavePam->Move( fnMoveForward, fnGoCntnt ))
else if ( !aSavePam.Move( fnMoveForward, fnGoCntnt ) )
{
aSavePam.GetPoint()->nNode++;
@@ -1092,11 +1069,9 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
{
if( pTNd->CanJoinNext())
{
- // --> OD 2009-08-20 #i100466#
// Always join next, because <pTNd> has to stay as it is.
// A join previous from its next would more or less delete <pTNd>
pTNd->JoinNext();
- // <--
bRemove = false;
}
}
@@ -1285,8 +1260,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
return sal_True;
}
-/* #107318# Convert list of ranges of whichIds to a corresponding list
- of whichIds*/
+// Convert list of ranges of whichIds to a corresponding list of whichIds
SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
{
SvUShorts * pResult = new SvUShorts();
@@ -1294,7 +1268,7 @@ SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
int i = 0;
while (pRanges[i] != 0)
{
- ASSERT(pRanges[i+1] != 0, "malformed ranges");
+ OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges");
for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
pResult->Insert(j, pResult->Count());
@@ -1346,7 +1320,7 @@ void lcl_GetJoinFlags( SwPaM& rPam, sal_Bool& rJoinTxt, sal_Bool& rJoinPrev )
if( bExchange )
rPam.Exchange();
rJoinPrev = rPam.GetPoint() == pStt;
- ASSERT( !pStt->nContent.GetIndex() &&
+ OSL_ENSURE( !pStt->nContent.GetIndex() &&
pEndNd->GetTxt().Len() != pEnd->nContent.GetIndex()
? rPam.GetPoint()->nNode < rPam.GetMark()->nNode
: rPam.GetPoint()->nNode > rPam.GetMark()->nNode,
@@ -1444,7 +1418,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
pDelNd->FmtToTxtAttr( pTxtNd );
else
{
- /* #107318# This case was missed:
+ /* This case was missed:
<something></something> <-- pTxtNd
<other>ccc</other> <-- pDelNd
@@ -1470,8 +1444,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
}
pDoc->CorrRel( aIdx, *rPam.GetPoint(), 0, sal_True );
- // --> OD 2009-08-20 #i100466#
- // adjust given <rPam>, if it does not belong to the cursors
+ // #i100466# adjust given <rPam>, if it does not belong to the cursors
if ( pDelNd == rPam.GetBound( sal_True ).nContent.GetIdxReg() )
{
rPam.GetBound( sal_True ) = SwPosition( SwNodeIndex( *pTxtNd ), SwIndex( pTxtNd ) );
@@ -1480,7 +1453,6 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
{
rPam.GetBound( sal_False ) = SwPosition( SwNodeIndex( *pTxtNd ), SwIndex( pTxtNd ) );
}
- // <--
pTxtNd->JoinNext();
}
}
@@ -1507,7 +1479,7 @@ lcl_CalcBreaks( ::std::vector<xub_StrLen> & rBreaks, SwPaM const & rPam )
SwTxtAttr const * const pAttr( pTxtNode->GetTxtAttrForCharAt(i) );
if (pAttr && pAttr->GetEnd() && (*pAttr->GetEnd() > nEnd))
{
- ASSERT(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
+ OSL_ENSURE(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
rBreaks.push_back(i);
}
}
@@ -1560,10 +1532,9 @@ bool lcl_DoWithBreaks(SwDoc & rDoc, SwPaM & rPam,
return bRet;
}
-
bool SwDoc::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool )
{
- ASSERT( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
+ OSL_ENSURE( IsRedlineOn(), "DeleteAndJoinWithRedline: redline off" );
{
SwUndoRedlineDelete* pUndo = 0;
@@ -1622,12 +1593,12 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
{
sal_Bool bJoinTxt, bJoinPrev;
lcl_GetJoinFlags( rPam, bJoinTxt, bJoinPrev );
- // --> OD 2009-08-20 #i100466#
+ // #i100466#
if ( bForceJoinNext )
{
bJoinPrev = sal_False;
}
- // <--
+
{
bool const bSuccess( DeleteRangeImpl( rPam ) );
if (!bSuccess)
@@ -1841,8 +1812,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
return true;
}
-// OD 2009-08-20 #i100466#
-// Add handling of new optional parameter <bForceJoinNext>
+// #i100466# Add handling of new optional parameter <bForceJoinNext>
bool SwDoc::DeleteAndJoin( SwPaM & rPam,
const bool bForceJoinNext )
{
@@ -1886,7 +1856,6 @@ void lcl_syncGrammarError( SwTxtNode &rTxtNode, linguistic2::ProofreadingResult&
rResult.aErrors.realloc( j );
}
-
uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< XSpellChecker1 > &xSpeller,
sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
@@ -2003,12 +1972,11 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
uno::Reference< text::XFlatParagraph > xFlatPara = new SwXFlatParagraph( *((SwTxtNode*)pNd), aExpandText, pConversionMap );
// get error position of cursor in XFlatParagraph
- sal_Int32 nGrammarErrorPosInText;
linguistic2::ProofreadingResult aResult;
sal_Int32 nGrammarErrors;
do
{
- nGrammarErrorPosInText = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nBeginGrammarCheck );
+ ModelToViewHelper::ConvertToViewPosition( pConversionMap, nBeginGrammarCheck );
aResult = xGCIterator->checkSentenceAtPosition(
xDoc, xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 );
@@ -2103,8 +2071,8 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos,
// Folgende Bedingungen muessen eingehalten werden:
// 1) es gibt mindestens eine Selektion
// 2) SPoint() == Start()
- ASSERT( pPam->HasMark(), "SwDoc::Hyphenate: blowing in the wind");
- ASSERT( *pPam->GetPoint() <= *pPam->GetMark(),
+ OSL_ENSURE( pPam->HasMark(), "SwDoc::Hyphenate: blowing in the wind");
+ OSL_ENSURE( *pPam->GetPoint() <= *pPam->GetMark(),
"SwDoc::Hyphenate: New York, New York");
const SwPosition *pPoint = pPam->GetPoint();
@@ -2139,7 +2107,7 @@ void SwHyphArgs::SetPam( SwPaM *pPam ) const
pPam->GetMark()->nNode = nNode;
pPam->GetMark()->nContent.Assign( pNode->GetCntntNode(),
nWordStart + nWordLen );
- ASSERT( nNode == pNode->GetIndex(),
+ OSL_ENSURE( nNode == pNode->GetIndex(),
"SwHyphArgs::SetPam: Pam desaster" );
}
}
@@ -2187,7 +2155,7 @@ uno::Reference< XHyphenatedWord > SwDoc::Hyphenate(
SwPaM *pPam, const Point &rCrsrPos,
sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
{
- ASSERT(this == pPam->GetDoc(), "SwDoc::Hyphenate: strangers in the night");
+ OSL_ENSURE(this == pPam->GetDoc(), "SwDoc::Hyphenate: strangers in the night");
if( *pPam->GetPoint() > *pPam->GetMark() )
pPam->Exchange();
@@ -2200,7 +2168,6 @@ uno::Reference< XHyphenatedWord > SwDoc::Hyphenate(
return aHyphArg.GetHyphWord(); // will be set by lcl_HyphenateNode
}
-
sal_Bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, sal_Bool bRegExpRplc )
{
sal_Bool bRet = sal_False;
@@ -2248,7 +2215,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
{
aPam.Move(fnMoveBackward);
}
- ASSERT((aPam.GetPoint()->nNode == aPam.GetMark()->nNode), "invalid pam?");
+ OSL_ENSURE((aPam.GetPoint()->nNode == aPam.GetMark()->nNode), "invalid pam?");
lcl_CalcBreaks(Breaks, aPam);
@@ -2274,7 +2241,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
bool bRet( true );
// iterate from end to start, to avoid invalidating the offsets!
::std::vector<xub_StrLen>::reverse_iterator iter( Breaks.rbegin() );
- ASSERT(aPam.GetPoint() == aPam.End(), "wrong!");
+ OSL_ENSURE(aPam.GetPoint() == aPam.End(), "wrong!");
SwPosition & rEnd( *aPam.End() );
SwPosition & rStart( *aPam.Start() );
@@ -2296,7 +2263,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
}
rStart = *rPam.Start(); // set to original start
- ASSERT(rEnd.nContent > rStart.nContent, "replace part empty!");
+ OSL_ENSURE(rEnd.nContent > rStart.nContent, "replace part empty!");
if (rEnd.nContent > rStart.nContent) // check if part is empty
{
bRet &= ReplaceRangeImpl(aPam, rStr, bRegExReplace);
@@ -2327,7 +2294,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
SwPosition *pStt = (SwPosition*)aDelPam.Start(),
*pEnd = (SwPosition*)aDelPam.End();
- ASSERT( pStt->nNode == pEnd->nNode ||
+ OSL_ENSURE( pStt->nNode == pEnd->nNode ||
( pStt->nNode.GetIndex() + 1 == pEnd->nNode.GetIndex() &&
!pEnd->nContent.GetIndex() ),
"invalid range: Point and Mark on different nodes" );
@@ -2538,8 +2505,8 @@ SetRedlineMode( eOld );
return true;
}
- // speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
- // in die Autokorrektur
+// speicher die akt. Werte fuer die automatische Aufnahme von Ausnahmen
+// in die Autokorrektur
void SwDoc::SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew )
{
if( pACEWord && pNew != pACEWord )
@@ -2573,11 +2540,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
if( pTblNd && pNd->IsCntntNode() )
{
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
-//JP 24.08.98: will man wirklich den PageDesc/Break vom
-// nachfolgen Absatz ueberbuegeln?
-// const SwAttrSet& rAttrSet = pTableFmt->GetAttrSet();
-// if( SFX_ITEM_SET != rAttrSet.GetItemState( RES_PAGEDESC ) &&
-// SFX_ITEM_SET != rAttrSet.GetItemState( RES_BREAK ))
+
{
const SfxPoolItem *pItem;
const SfxItemSet* pSet = ((SwCntntNode*)pNd)->GetpSwAttrSet();
@@ -2644,7 +2607,7 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
rPam.Exchange();
if( !rPam.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_ENSURE( sal_False, "kein Node mehr vorhanden" );
return sal_False;
}
}
@@ -2682,7 +2645,6 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
return sal_True;
}
-
void SwDoc::TransliterateText(
const SwPaM& rPaM,
utl::TransliterationWrapper& rTrans )
@@ -2755,9 +2717,8 @@ void SwDoc::TransliterateText(
SetModified();
}
-
#define MAX_REDLINE_COUNT 250
-// -----------------------------------------------------------------------------
+
void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
{
const SwRedlineTbl& rRedlineTbl = GetRedlineTbl();
@@ -2777,7 +2738,6 @@ void SwDoc::checkRedlining(RedlineMode_t& _rReadlineMode)
}
}
}
-// -----------------------------------------------------------------------------
void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const
{
@@ -2843,3 +2803,5 @@ void SwDoc::RemoveLeadingWhiteSpace(const SwPosition & rPos )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 28d41e9e5364..8b246e37b254 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <svl/svarray.hxx>
#endif
#include <vcl/svapp.hxx>
-#include <vcl/svapp.hxx>
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <doc.hxx>
@@ -81,7 +81,6 @@ extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
-
/*--------------------------------------------------------------------
Beschreibung: Feldtypen einfuegen
--------------------------------------------------------------------*/
@@ -90,7 +89,6 @@ SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
* Return immer einen gueltigen Pointer auf den Typ. Wenn er also neu
* zugefuegt oder schon vorhanden ist.
*/
-
SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp)
{
sal_uInt16 nSize = pFldTypes->Count(),
@@ -176,7 +174,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
sal_uInt16 nSize = pFldTypes->Count(), nFldWhich = rFldTyp.Which();
sal_uInt16 i = INIT_FLDTYPES;
- ASSERT( RES_SETEXPFLD == nFldWhich ||
+ OSL_ENSURE( RES_SETEXPFLD == nFldWhich ||
RES_USERFLD == nFldWhich ||
RES_DDEFLD == nFldWhich, "Falscher FeldTyp" );
@@ -227,10 +225,9 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp )
/*--------------------------------------------------------------------
Beschreibung: Feldtypen loeschen
--------------------------------------------------------------------*/
-
void SwDoc::RemoveFldType(sal_uInt16 nFld)
{
- ASSERT( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" );
+ OSL_ENSURE( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" );
/*
* Abheangige Felder vorhanden -> ErrRaise
*/
@@ -263,7 +260,7 @@ void SwDoc::RemoveFldType(sal_uInt16 nFld)
if( nWhich )
{
- ASSERT( !pTmp->GetDepends(), "Abhaengige vorh.!" );
+ OSL_ENSURE( !pTmp->GetDepends(), "Abhaengige vorh.!" );
// Feldtype loschen
delete pTmp;
}
@@ -280,7 +277,6 @@ const SwFldTypes* SwDoc::GetFldTypes() const
/*--------------------------------------------------------------------
Beschreibung: Den ersten Typen mit ResId und Namen finden
--------------------------------------------------------------------*/
-
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
@@ -328,7 +324,6 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
return pRet;
}
-
/*************************************************************************
|* SwDoc::UpdateFlds()
|* Beschreibung Felder updaten
@@ -336,7 +331,6 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName,
/*
* Alle sollen neu evaluiert werden.
*/
-
void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
{
// Modify() fuer jeden Feldtypen rufen,
@@ -397,7 +391,6 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
/******************************************************************************
* void SwDoc::UpdateUsrFlds()
******************************************************************************/
-
void SwDoc::UpdateUsrFlds()
{
SwCalc* pCalc = 0;
@@ -420,7 +413,6 @@ void SwDoc::UpdateUsrFlds()
/*--------------------------------------------------------------------
Beschreibung: Referenzfelder und TableFelder erneuern
--------------------------------------------------------------------*/
-
void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
{
SwFieldType* pFldType;
@@ -431,7 +423,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
- ASSERT( !pHt || RES_TABLEFML_UPDATE == pHt->Which(),
+ OSL_ENSURE( !pHt || RES_TABLEFML_UPDATE == pHt->Which(),
"Was ist das fuer ein MessageItem?" );
SwFieldType* pFldType(0);
@@ -593,11 +585,11 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
if( aPara.CalcWithStackOverflow() )
pFld->CalcField( aPara );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
// mind. ein ASSERT
- ASSERT( !this, "die Kettenformel konnte nicht errechnet werden" );
+ OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" );
}
#endif
}
@@ -662,11 +654,11 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
if( aPara.CalcWithStackOverflow() )
pFml->Calc( aPara, nValue );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
// mind. ein ASSERT
- ASSERT( !this, "die Kettenformel konnte nicht errechnet werden" );
+ OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" );
}
#endif
}
@@ -711,10 +703,6 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
SetNewFldLst(true);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
// ---- Loesche alle nicht referenzierten FeldTypen eines Dokumentes --
void SwDoc::GCFieldTypes()
{
@@ -754,12 +742,8 @@ void SwDoc::SetNewFldLst(bool bFlag)
mbNewFldLst = bFlag;
}
-
-//----------------------------------------------------------------------
-
// der StartIndex kann optional mit angegeben werden (z.B. wenn dieser
// zuvor schon mal erfragt wurde - ist sonst eine virtuelle Methode !!)
-
_SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld,
const SwIndex* pIdx )
{
@@ -786,9 +770,9 @@ _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx,
nCntnt = *rINet.GetStart();
}
- //Erweiterung fuer Sections:
- // diese haben immer als Content-Position 0xffff !!
- // Auf dieser steht nie ein Feld, maximal bis STRING_MAXLEN moeglich
+// Erweiterung fuer Sections:
+// diese haben immer als Content-Position 0xffff !!
+// Auf dieser steht nie ein Feld, maximal bis STRING_MAXLEN moeglich
_SetGetExpFld::_SetGetExpFld( const SwSectionNode& rSectNd,
const SwPosition* pPos )
{
@@ -901,8 +885,8 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm )
SwNodeIndex aIdx( *rFrm.GetNode() );
SwDoc& rDoc = *aIdx.GetNodes().GetDoc();
SwPosition aPos( aIdx );
-#ifdef DBG_UTIL
- ASSERT( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" );
#else
::GetBodyTxtNode( rDoc, aPos, rFrm );
#endif
@@ -1046,10 +1030,6 @@ void LookString( SwHash** ppTbl, sal_uInt16 nSize, const String& rName,
rRet.Erase();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld )
{
SwDBData aDBData( rDBFld.GetDBData( &rDoc ));
@@ -1068,10 +1048,6 @@ String lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld )
return sDBNumNm;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld,
SwNewDBMgr* pMgr )
{
@@ -1219,8 +1195,8 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
if( !aNew.Len() ) // nichts gefunden, dann ist
aNew = pSFld->GetFormula(); // die Formel der neue Wert
- // OD 11.02.2003 #i3141# - update expression of field as in
- // method <SwDoc::UpdateExpFlds(..)> for string/text fields
+ // #i3141# - update expression of field as in method
+ // <SwDoc::UpdateExpFlds(..)> for string/text fields
pSFld->ChgExpStr( aNew );
// suche den Namen vom Feld
@@ -1261,7 +1237,6 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
}
}
-
void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
{
if( IsExpFldsLocked() || IsInReading() )
@@ -1327,15 +1302,6 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// aktuelle Datensatznummer schon vorher einstellen
SwNewDBMgr* pMgr = GetNewDBMgr();
pMgr->CloseAll(sal_False);
-/*
- if(pMgr && pMgr->OpenDB(DBMGR_STD, GetDBDesc(), sal_False))
- {
- if(!pMgr->IsInMerge() )
- pMgr->ToFirstSelectedRecord(DBMGR_STD);
-
- aCalc.VarChange( sDBNumNm, pMgr->GetCurSelectedRecordId(DBMGR_STD));
- }
-*/
String aNew;
const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
@@ -1344,9 +1310,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwSection* pSect = (SwSection*)(*ppSortLst)->GetSection();
if( pSect )
{
- //!SECTION
-// if( pGFld->IsInBodyTxt() )
SwSbxValue aValue = aCalc.Calculate(
pSect->GetCondition() );
if(!aValue.IsVoidValue())
@@ -1357,7 +1321,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
SwTxtFld* pTxtFld = (SwTxtFld*)(*ppSortLst)->GetFld();
if( !pTxtFld )
{
- ASSERT( !this, "was ist es denn nun" );
+ OSL_ENSURE( !this, "was ist es denn nun" );
continue;
}
@@ -1568,10 +1532,6 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
pUpdtFlds->SetFieldsDirty( sal_False );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
{
SwNewDBMgr* pMgr = GetNewDBMgr();
@@ -1601,14 +1561,10 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc )
}
else
{
- DBG_ERROR("TODO: what should happen with unnamed DBFields?");
+ OSL_FAIL("TODO: what should happen with unnamed DBFields?");
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!!
{
// Feldtypen
@@ -1655,7 +1611,7 @@ void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!!
pFldTypes->Insert( new SwSetExpFieldType(this,
SW_RESSTR(STR_POOLCOLL_LABEL_DRAWING), nsSwGetSetExpType::GSE_SEQ),nFldType++);
- ASSERT( nFldType == INIT_FLDTYPES, "Bad initsize: SwFldTypes" );
+ OSL_ENSURE( nFldType == INIT_FLDTYPES, "Bad initsize: SwFldTypes" );
}
void SwDoc::InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld )
@@ -1731,6 +1687,7 @@ String lcl_DBDataToString(const SwDBData& rData)
sRet += String::CreateFromInt32(rData.nCommandType);
return sRet;
}
+
void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList,
const SvStringsDtor* pAllDBNames )
{
@@ -1807,10 +1764,6 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList,
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames )
{
SwNewDBMgr* pMgr = GetNewDBMgr();
@@ -1826,10 +1779,6 @@ void SwDoc::GetAllDBNames( SvStringsDtor& rAllDBNames )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
const String& rFormel,
SvStringsDtor& rUsedDBNames )
@@ -1864,10 +1813,6 @@ SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames,
return rUsedDBNames;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList,
const SvStringsDtor& rUsedDBNames )
{
@@ -1875,10 +1820,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList,
AddUsedDBToList( rDBNameList, *rUsedDBNames.GetObject(i) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName)
{
if( !rDBName.Len() )
@@ -1904,10 +1845,6 @@ void SwDoc::AddUsedDBToList( SvStringsDtor& rDBNameList, const String& rDBName)
rDBNameList.Insert( pNew, rDBNameList.Count() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
const String& rNewName )
{
@@ -2010,10 +1947,6 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
SetModified();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
const String& rNewName, String& rFormel )
{
@@ -2055,10 +1988,6 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_Bool SwDoc::IsNameInArray( const SvStringsDtor& rArr, const String& rName )
{
#ifdef UNX
@@ -2201,9 +2130,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen )
const SwTxtNode* pTNd = rNds[ nStt++ ]->GetTxtNode();
if( pTNd )
{
- if( //pTNd->GetFmtColl() && //#outline level,zhaojianwei
- // MAXLEVEL > pTNd->GetTxtColl()->GetOutlineLevel() )
- pTNd->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
+ if( pTNd->GetAttrOutlineLevel() != 0 )
// Kapitelfelder aktualisieren
b = sal_True;
else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() )
@@ -2227,9 +2154,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen )
GetUpdtFlds().SetFieldsDirty( b );
return bFldsFnd;
}
-/* -----------------------------21.12.99 12:55--------------------------------
- ---------------------------------------------------------------------------*/
void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
{
const sal_uInt16 nSize = pFldTypes->Count();
@@ -2246,9 +2171,6 @@ void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld )
{
@@ -2305,7 +2227,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
delete pFldSortLst;
pFldSortLst = new _SetGetExpFlds( 64, 16 );
- /// OD 09.08.2002 [#101207#,#101216#,#101778#] - consider and unhide sections
+ /// consider and unhide sections
/// with hide condition, only in mode GETFLD_ALL (<eGetMode == GETFLD_ALL>)
/// notes by OD:
/// eGetMode == GETFLD_CALC in call from methods SwDoc::FldsToCalc
@@ -2353,13 +2275,13 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
for (sal_uInt16 n = nArrStt; n < aTmpArr.Count(); ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
- ASSERT( pSectNd, "Wo ist mein SectionNode" );
+ OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" );
pSectNd->GetSection().SetCondHidden( sal_False );
}
for (sal_uInt16 n = 0; n < nArrStt; ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
- ASSERT( pSectNd, "Wo ist mein SectionNode" );
+ OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" );
pSectNd->GetSection().SetCondHidden( sal_False );
}
@@ -2405,18 +2327,6 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
break;
case RES_SETEXPFLD:
- /// OD 04.10.2002 #102894#
- /// fields of subtype <string> have also been add
- /// for calculation (eGetMode == GETFLD_CALC).
- /// Thus, add fields of subtype <string> in all modes
- /// (eGetMode == GETFLD_EXPAND||GETFLD_CALC||GETFLD_ALL)
- /// and fields of other subtypes only in the modes
- /// (eGetMode == GETFLD_CALC||GETFLD_ALL)
- /* "old" if construct - not deleted for history and code review
- if( ( nsSwGetSetExpType::GSE_STRING & pFld->GetSubType()
- ? GETFLD_EXPAND : GETFLD_CALC )
- & eGetMode )
- */
if ( !(eGetMode == GETFLD_EXPAND) ||
(nsSwGetSetExpType::GSE_STRING & pFld->GetSubType()) )
{
@@ -2497,36 +2407,8 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
}
nFldLstGetMode = static_cast<sal_uInt8>( eGetMode );
nNodes = rDoc.GetNodes().Count();
-
-#ifdef JP_DEBUG
- {
- SvFileStream sOut( "f:\\x.x", STREAM_STD_WRITE );
- sOut.Seek( STREAM_SEEK_TO_END );
- sOut << "------------------" << endl;
- const _SetGetExpFldPtr* pSortLst = pFldSortLst->GetData();
- for( sal_uInt16 n = pFldSortLst->Count(); n; --n, ++pSortLst )
- {
- String sStr( (*pSortLst)->GetNode() );
- sStr += "\t, ";
- sStr += (*pSortLst)->GetCntnt();
- sStr += "\tNode: ";
- sStr += (*pSortLst)->GetFld()->GetTxtNode().StartOfSectionIndex();
- sStr += "\tPos: ";
- sStr += *(*pSortLst)->GetFld()->GetStart();
- sStr += "\tType: ";
- sStr += (*pSortLst)->GetFld()->GetFld().GetFld()->GetTyp()->Which();
-
- sOut << sStr.GetStr() << endl;
- }
- }
-#endif
- // JP_DEBUG
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
{
const SwTxtNode& rTxtNd = rTFld.GetTxtNode();
@@ -2545,7 +2427,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
SwNodeIndex aIdx( rTxtNd );
bIsInBody = rDoc.GetNodes().GetEndOfExtras().GetIndex() < aIdx.GetIndex();
- // #104291# dvo: We don't want to update fields in redlines, or those
+ // We don't want to update fields in redlines, or those
// in frames whose anchor is in redline. However, we do want to update
// fields in hidden sections. So: In order to be updated, a field 1)
// must have a frame, or 2) it must be in the document body.
@@ -2556,8 +2438,8 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
{
// einen Index fuers bestimmen vom TextNode anlegen
SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() );
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
#else
GetBodyTxtNode( rDoc, aPos, *pFrm );
#endif
@@ -2604,8 +2486,8 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
if( !pFrm )
break;
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" );
#else
GetBodyTxtNode( rDoc, aPos, *pFrm );
#endif
@@ -2633,7 +2515,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType )
sFldName = ((SwSetExpFieldType&)rType).GetName();
break;
default:
- ASSERT( !this, "kein gueltiger FeldTyp" );
+ OSL_ENSURE( !this, "kein gueltiger FeldTyp" );
}
if( sFldName.Len() )
@@ -2707,12 +2589,11 @@ SwDocUpdtFld::~SwDocUpdtFld()
delete aFldTypeTable[n];
}
-// #111840#
bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
SwMsgPoolItem * pMsgHnt,
bool bUpdateFlds)
{
- ASSERT(pDstTxtFld, "no field to update!");
+ OSL_ENSURE(pDstTxtFld, "no field to update!");
sal_Bool bTblSelBreak = sal_False;
@@ -2734,10 +2615,6 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // Das gefundene Feld wird angepasst ...
- //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
- //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
-
SwField * pNewFld = rSrcFld.CopyField();
pDstFmtFld->SetFld(pNewFld);
@@ -2827,3 +2704,5 @@ bool SwDoc::PutValueToField(const SwPosition & rPos,
return pField->PutValue(rVal, nWhich);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index fb0ccdd97a80..68e93ed41542 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,18 +67,12 @@
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
-// --> OD 2009-07-20 #i73249#
#include <undoflystrattr.hxx>
-// <--
extern sal_uInt16 GetHtmlMode( const SwDocShell* );
-
using namespace ::com::sun::star;
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
{
const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
@@ -119,9 +114,6 @@ sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
return nCount;
}
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
// If you change this, also update SwXFrameEnumeration in unocoll.
SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
{
@@ -162,16 +154,11 @@ SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
return pRetFmt;
}
-/* */
-
/***********************************************************************
#* Class : SwDoc
#* Methode : SetFlyFrmAnchor
#* Beschreibung: Das Ankerattribut des FlyFrms aendert sich.
-#* Datum : MA 01. Feb. 94
-#* Update : JP 09.03.98
#***********************************************************************/
-
Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
const SwFrmFmt* pFlyFmt )
{
@@ -272,13 +259,13 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
//Verbindung zwischen Attribut und Format.
const SwPosition *pPos = rOldAnch.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == &rFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == &rFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -302,7 +289,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
{
const SwPosition *pPos = aNewAnch.GetCntntAnchor();
SwTxtNode *pNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "Crsr steht nicht auf TxtNode." );
+ OSL_ENSURE( pNd, "Crsr steht nicht auf TxtNode." );
SwFmtFlyCnt aFmt( static_cast<SwFlyFrmFmt*>(&rFmt) );
pNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 );
@@ -362,8 +349,8 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew
pItem = 0;
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
- // OD 2004-05-14 #i28922# - correction: compare <aOldV.GetVertOrient()
- // with <text::VertOrientation::NONE>
+ // #i28922# - correction: compare <aOldV.GetVertOrient() with
+ // <text::VertOrientation::NONE>
if( text::VertOrientation::NONE == aOldV.GetVertOrient() && (!pItem ||
aOldV.GetPos() == ((SwFmtVertOrient*)pItem)->GetPos() ) )
{
@@ -419,7 +406,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
case RES_PAGEDESC:
case RES_CNTNT:
case RES_FOOTER:
- OSL_ENSURE(false, ":-) unknown Attribute for Fly.");
+ OSL_ENSURE( !this, ":-) Unbekanntes Attribut fuer Fly." );
// kein break;
case RES_CHAIN:
rSet.ClearItem( nWhich );
@@ -479,7 +466,7 @@ sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
return bRet;
}
-// --> OD 2009-07-20 #i73249#
+// #i73249#
void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
const String& sNewTitle )
{
@@ -525,15 +512,11 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
SetModified();
}
-// <--
/***************************************************************************
* 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 )
{
@@ -596,9 +579,9 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
//Hori und Vert nur dann resetten, wenn in der Vorlage eine
//automatische Ausrichtung eingestellt ist, anderfalls den alten Wert
//wieder hineinstopfen.
- //JP 09.06.98: beim Update der RahmenVorlage sollte der Fly NICHT
+ // beim Update der RahmenVorlage sollte der Fly NICHT
// seine Orientierng verlieren (diese wird nicht geupdatet!)
- //OS: #96584# text::HoriOrientation::NONE and text::VertOrientation::NONE are allowed now
+ // text::HoriOrientation::NONE and text::VertOrientation::NONE are allowed now
if (!bKeepOrient)
{
rFmt.ResetFmtAttr(RES_VERT_ORIENT);
@@ -637,17 +620,13 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
|*
|* SwDoc::ChgAnchor()
|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung JP 08.07.98
-|*
*************************************************************************/
-
sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
- ASSERT( GetRootFrm(), "Ohne Layout geht gar nichts" );
+ OSL_ENSURE( GetRootFrm(), "Ohne Layout geht gar nichts" );
if ( !_rMrkList.GetMarkCount() ||
_rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -665,38 +644,36 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
{
SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
- // OD 27.06.2003 #108784# - consider, that drawing object has
+ // consider, that drawing object has
// no user call. E.g.: a 'virtual' drawing object is disconnected by
// the anchor type change of the 'master' drawing object.
// Continue with next selected object and assert, if this isn't excepted.
if ( !pContact )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bool bNoUserCallExcepted =
pObj->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawVirtObj*>(pObj)->IsConnected();
- ASSERT( bNoUserCallExcepted, "SwDoc::ChgAnchor(..) - no contact at selected drawing object" );
+ OSL_ENSURE( bNoUserCallExcepted, "SwDoc::ChgAnchor(..) - no contact at selected drawing object" );
#endif
continue;
}
- // OD 2004-03-29 #i26791#
+ // #i26791#
const SwFrm* pOldAnchorFrm = pContact->GetAnchorFrm( pObj );
const SwFrm* pNewAnchorFrm = pOldAnchorFrm;
- // --> OD 2006-03-01 #i54336#
+ // #i54336#
// Instead of only keeping the index position for an as-character
// anchored object the complete <SwPosition> is kept, because the
// anchor index position could be moved, if the object again is
// anchored as character.
-// xub_StrLen nIndx = STRING_NOTFOUND;
const SwPosition* pOldAsCharAnchorPos( 0L );
const RndStdIds eOldAnchorType = pContact->GetAnchorId();
if ( !_bSameOnly && eOldAnchorType == FLY_AS_CHAR )
{
pOldAsCharAnchorPos = new SwPosition( pContact->GetCntntAnchor() );
}
- // <--
if ( _bSameOnly )
_eAnchorType = eOldAnchorType;
@@ -716,7 +693,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
? aObjRect.TopRight()
: aPt;
- // OD 18.06.2003 #108784# - allow drawing objects in header/footer
+ // allow drawing objects in header/footer
pNewAnchorFrm = ::FindAnchor( pOldAnchorFrm, aNewPoint, false );
if ( pNewAnchorFrm->IsTxtFrm() && ((SwTxtFrm*)pNewAnchorFrm)->IsFollow() )
{
@@ -746,8 +723,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
Point aPoint( aPt );
aPoint.X() -= 1;
GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
- // OD 20.06.2003 #108784# - consider that drawing objects
- // can be in header/footer. Thus, <GetFrm()> by left-top-corner
+ // consider that drawing objects can be in
+ // header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
GetCntntNode()->GetFrm( &aPt, 0, sal_False );
}
@@ -788,7 +765,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
else // Ankerwechsel
{
- // OD 18.06.2003 #108784# - allow drawing objects in header/footer
+ // allow drawing objects in header/footer
pNewAnchorFrm = ::FindAnchor( pOldAnchorFrm, aPt, false );
if( pNewAnchorFrm->IsProtected() )
{
@@ -819,32 +796,32 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
aNewAnch.SetAnchor( &aPos );
SetAttr( aNewAnch, *pContact->GetFmt() );
- // OD 2004-04-13 #i26791# - adjust vertical positioning to
- // 'center to baseline'
+ // #i26791# - adjust vertical positioning to 'center to
+ // baseline'
SetAttr( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ), *pContact->GetFmt() );
SwTxtNode *pNd = aPos.nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "Cursor not positioned at TxtNode." );
+ OSL_ENSURE( pNd, "Cursor not positioned at TxtNode." );
SwFmtFlyCnt aFmt( pContact->GetFmt() );
pNd->InsertItem( aFmt, aPos.nContent.GetIndex(), 0 );
}
break;
default:
- ASSERT( !this, "unexpected AnchorId." );
+ OSL_ENSURE( !this, "unexpected AnchorId." );
}
if ( (FLY_AS_CHAR != _eAnchorType) &&
pNewAnchorFrm &&
( !_bSameOnly || pNewAnchorFrm != pOldAnchorFrm ) )
{
- // OD 2004-04-06 #i26791# - Direct object positioning no longer
- // needed. Apply of attributes (method call <SetAttr(..)>) takes
- // care of the invalidation of the object position.
+ // #i26791# - Direct object positioning no longer needed. Apply
+ // of attributes (method call <SetAttr(..)>) takes care of the
+ // invalidation of the object position.
SetAttr( aNewAnch, *pContact->GetFmt() );
if ( _bPosCorr )
{
- // --> OD 2004-08-24 #i33313# - consider not connected
- // 'virtual' drawing objects
+ // #i33313# - consider not connected 'virtual' drawing
+ // objects
if ( pObj->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawVirtObj*>(pObj)->IsConnected() )
{
@@ -862,7 +839,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
}
- // --> OD 2006-03-01 #i54336#
+ // #i54336#
if ( pNewAnchorFrm && pOldAsCharAnchorPos )
{
//Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet
@@ -871,8 +848,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
//Verbindung zwischen Attribut und Format.
const xub_StrLen nIndx( pOldAsCharAnchorPos->nContent.GetIndex() );
SwTxtNode* pTxtNode( pOldAsCharAnchorPos->nNode.GetNode().GetTxtNode() );
- ASSERT( pTxtNode, "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object" );
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode, "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object" );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIndx, RES_TXTATR_FLYCNT );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -882,7 +859,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIndx, nIndx );
delete pOldAsCharAnchorPos;
}
- // <--
}
}
@@ -892,10 +868,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return bUnmark;
}
-
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
//Die Source darf noch keinen Follow haben.
@@ -942,7 +914,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
const SwFmtAnchor& rAnchor = (*GetSpzFrmFmts())[ n ]->GetAnchor();
sal_uLong nTstSttNd;
- // OD 11.12.2003 #i20622# - to-frame anchored objects are allowed.
+ // #i20622# - to-frame anchored objects are allowed.
if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) ||
(rAnchor.GetAnchorId() == FLY_AT_CHAR)) &&
0 != rAnchor.GetCntntAnchor() &&
@@ -994,9 +966,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
int nErr = Chainable( rSource, rDest );
@@ -1040,9 +1010,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
return nErr;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
void SwDoc::Unchain( SwFrmFmt &rFmt )
{
SwFmtChain aChain( rFmt.GetChain() );
@@ -1059,5 +1027,4 @@ void SwDoc::Unchain( SwFrmFmt &rFmt )
}
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 1154fbf61d88..b1aed2bfa726 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,6 @@
#include <editeng/brkitem.hxx>
#include <svl/whiter.hxx>
#ifndef _ZFORLIST_HXX //autogen
-#define _ZFORLIST_DECLARE_TABLE
#include <svl/zforlist.hxx>
#endif
#include <comphelper/processfactory.hxx>
@@ -120,13 +120,11 @@ struct ParaRstFmt
const SfxItemSet* pDelSet;
sal_uInt16 nWhich;
bool bReset;
- // --> OD 2007-11-06 #i62575#
- bool bResetListAttrs;
- // <--
+ bool bResetListAttrs; // #i62575#
bool bResetAll;
bool bInclRefToxMark;
- bool bKeepOutlineLevelAttr; //#outline level,add by zhaojianwei
+ bool bKeepOutlineLevelAttr;
ParaRstFmt( const SwPosition* pStt, const SwPosition* pEnd,
SwHistory* pHst, sal_uInt16 nWhch = 0, const SfxItemSet* pSet = 0 )
@@ -136,13 +134,11 @@ struct ParaRstFmt
pEndNd(pEnd),
pDelSet(pSet),
nWhich(nWhch),
- // --> OD 2007-11-06 #i62675#
- bReset( false ),
+ bReset( false ), // #i62675#
bResetListAttrs( false ),
- // <--
bResetAll( true ),
bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
+ bKeepOutlineLevelAttr( false )
{}
ParaRstFmt( SwHistory* pHst )
@@ -152,13 +148,11 @@ struct ParaRstFmt
pEndNd(0),
pDelSet(0),
nWhich(0),
- // --> OD 2007-11-06 #i62675#
bReset( false ),
- bResetListAttrs( false ),
- // <--
+ bResetListAttrs( false ), // #i62675#
bResetAll( true ),
bInclRefToxMark( false ),
- bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
+ bKeepOutlineLevelAttr( false )
{}
};
@@ -210,7 +204,6 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
SwDoc* pDoc = pNode->GetDoc();
- // --> OD 2008-04-14 #refactorlists#
// remove unused attribute RES_LR_SPACE
// add list attributes
SfxItemSet aSet( pDoc->GetAttrPool(),
@@ -221,11 +214,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
0 );
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
- // --> OD 2008-04-15 #refactorlists#
-// std::vector<sal_uInt16> aClearWhichIds;
SvUShorts aClearWhichIds;
- // <--
- // --> OD 2008-04-15 #refactorlists#
// restoring all paragraph list attributes
{
SfxItemSet aListAttrSet( pDoc->GetAttrPool(),
@@ -244,13 +233,10 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
}
}
}
- // <--
const SfxPoolItem* pItem;
- // sal_uInt16 __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
- // RES_PARATR_NUMRULE };
- //for( sal_uInt16 n = 0; n < 3; ++n )
- sal_uInt16 __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
+
+ sal_uInt16 const aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
RES_PARATR_NUMRULE,
RES_PARATR_OUTLINELEVEL };
for( sal_uInt16 n = 0; n < 4; ++n ) //<-end,zhaojianwei
@@ -280,24 +266,19 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( bSave )
{
aSet.Put( *pItem );
- // --> OD 2008-04-15 #refactorlists#
-// aClearWhichIds.push_back( aSavIds[n] );
aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() );
}
}
}
- // --> OD 2008-04-14 #refactorlists#
// do not clear items directly from item set and only clear to be kept
// attributes, if no deletion item set is found.
-// pNode->ClearItemsFromAttrSet( aClearWhichIds );
const bool bKeepAttributes =
!pPara || !pPara->pDelSet || pPara->pDelSet->Count() == 0;
if ( bKeepAttributes )
{
pNode->ResetAttr( aClearWhichIds );
}
- // <--
if( !bLocked )
pNode->UnlockModify();
@@ -308,16 +289,12 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( pPara->pDelSet && pPara->pDelSet->Count() )
{
- // --> OD 2008-04-15 #refactorlists#
- ASSERT( !bKeepAttributes,
+ OSL_ENSURE( !bKeepAttributes,
"<lcl_RstAttr(..)> - certain attributes are kept, but not needed. -> please inform OD" );
- // <--
SfxItemIter aIter( *pPara->pDelSet );
pItem = aIter.FirstItem();
while( sal_True )
{
- // --> OD 2008-04-14 #refactorlists#
- //
if ( ( pItem->Which() != RES_PAGEDESC &&
pItem->Which() != RES_BREAK &&
pItem->Which() != RES_PARATR_NUMRULE ) ||
@@ -325,7 +302,6 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
{
pNode->ResetAttr( pItem->Which() );
}
- // <--
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
@@ -339,10 +315,8 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
else
pNode->ResetAllAttr();
- // --> OD 2008-04-15 #refactorlists#
// only restore saved attributes, if needed
if ( bKeepAttributes && aSet.Count() )
- // <--
{
pNode->LockModify();
@@ -376,9 +350,7 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark )
void SwDoc::ResetAttrs( const SwPaM &rRg,
sal_Bool bTxtAttr,
const SvUShortsSort* pAttrs,
- // --> OD 2008-11-28 #b96644#
const bool bSendDataChangedEvents )
- // <--
{
SwPaM* pPam = (SwPaM*)&rRg;
if( !bTxtAttr && pAttrs && pAttrs->Count() &&
@@ -433,14 +405,13 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
pPam->GetPoint()->nContent = nPtPos;
}
- // --> OD 2008-11-28 #i96644#
+ // #i96644#
// SwDataChanged aTmp( *pPam, 0 );
std::auto_ptr< SwDataChanged > pDataChanged;
if ( bSendDataChangedEvents )
{
pDataChanged.reset( new SwDataChanged( *pPam, 0 ) );
}
- // <--
SwHistory* pHst = 0;
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -458,13 +429,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
ParaRstFmt aPara( pStt, pEnd, pHst );
// mst: not including META here; it seems attrs with CH_TXTATR are omitted
- sal_uInt16 __FAR_DATA aResetableSetRange[] = {
+ sal_uInt16 aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_TXTATR_INETFMT, RES_TXTATR_INETFMT,
RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
@@ -628,9 +597,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
}
if ( isPARATR(nWhich)
- // --> OD 2008-02-25 #refactorlists#
|| isPARATR_LIST(nWhich)
- // <--
|| isFRMATR(nWhich)
|| isGRFATR(nWhich)
|| isUNKNOWNATR(nWhich) )
@@ -655,9 +622,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -679,21 +644,20 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
if( pNode && pNode->IsTxtNode() )
{
- // -> #i27615#
+ // #i27615#
if (rRg.IsInFrontOfLabel())
{
SwTxtNode * pTxtNd = pNode->GetTxtNode();
SwNumRule * pNumRule = pTxtNd->GetNumRule();
- // --> OD 2005-10-24 #126346# - make code robust:
+ // make code robust:
if ( !pNumRule )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<InsAttr(..)> - PaM in front of label, but text node has no numbering rule set. This is a serious defect, please inform OD." );
DELETECHARSETS
return false;
}
- // <--
SwNumFmt aNumFmt = pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()));
SwCharFmt * pCharFmt =
@@ -711,7 +675,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
DELETECHARSETS
return true;
}
- // <- #i27615#
const SwIndex& rSt = pStt->nContent;
@@ -1203,7 +1166,6 @@ void SwDoc::SetAttr( const SfxItemSet& rSet, SwFmt& rFmt )
SetModified();
}
-// --> OD 2008-02-12 #newlistlevelattrs#
void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
SwFmt& rChangedFormat )
{
@@ -1225,7 +1187,6 @@ void SwDoc::ResetAttrAtFormat( const sal_uInt16 nWhichId,
else if ( pUndo )
delete pUndo;
}
-// <--
int lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
SvxTabStopItem& rChgTabStop )
@@ -1290,9 +1251,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
bCheckSdrDflt = 0 != pSdrPool;
}
else if ( isPARATR(nWhich) ||
- // --> OD 2008-02-25 #refactorlists#
isPARATR_LIST(nWhich) )
- // <--
{
aCallMod.Add( pDfltTxtFmtColl );
bCheckSdrDflt = 0 != pSdrPool;
@@ -1420,7 +1379,7 @@ void SwDoc::DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast)
void SwDoc::DelCharFmt( SwCharFmt *pFmt, sal_Bool bBroadcast )
{
sal_uInt16 nFmt = pCharFmtTbl->GetPos( pFmt );
- ASSERT( USHRT_MAX != nFmt, "Fmt not found," );
+ OSL_ENSURE( USHRT_MAX != nFmt, "Fmt not found," );
DelCharFmt( nFmt, bBroadcast );
}
@@ -1429,7 +1388,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
{
if( pFmt->ISA( SwTableBoxFmt ) || pFmt->ISA( SwTableLineFmt ))
{
- ASSERT( !this, "Format steht nicht mehr im DocArray, "
+ OSL_ENSURE( !this, "Format steht nicht mehr im DocArray, "
"kann per delete geloescht werden" );
delete pFmt;
}
@@ -1458,7 +1417,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
else
{
nPos = GetSpzFrmFmts()->GetPos( pFmt );
- ASSERT( nPos != USHRT_MAX, "FrmFmt not found." );
+ OSL_ENSURE( nPos != USHRT_MAX, "FrmFmt not found." );
if( USHRT_MAX != nPos )
GetSpzFrmFmts()->DeleteAndDestroy( nPos );
}
@@ -1468,7 +1427,7 @@ void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast )
void SwDoc::DelTblFrmFmt( SwTableFmt *pFmt )
{
sal_uInt16 nPos = pTblFrmFmtTbl->GetPos( pFmt );
- ASSERT( USHRT_MAX != nPos, "Fmt not found," );
+ OSL_ENSURE( USHRT_MAX != nPos, "Fmt not found," );
pTblFrmFmtTbl->DeleteAndDestroy( nPos );
}
@@ -1576,12 +1535,11 @@ SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName,
}
-// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
+// #i40550# - add parameter <bAuto> - not relevant
SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName,
SwCharFmt *pDerivedFrom,
sal_Bool bBroadcast,
sal_Bool )
-// <--
{
SwCharFmt *pFmt = new SwCharFmt( GetAttrPool(), rFmtName, pDerivedFrom );
pCharFmtTbl->Insert( pFmt, pCharFmtTbl->Count() );
@@ -1618,12 +1576,11 @@ SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName,
* Erzeugen der FormatCollections
*/
// TXT
-// --> OD 2005-01-13 #i40550# - add parameter <bAuto> - not relevant
+// #i40550# - add parameter <bAuto> - not relevant
SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName,
SwTxtFmtColl *pDerivedFrom,
sal_Bool bBroadcast,
sal_Bool )
-// <--
{
SwTxtFmtColl *pFmtColl = new SwTxtFmtColl( GetAttrPool(), rFmtName,
pDerivedFrom );
@@ -1689,7 +1646,7 @@ SwGrfFmtColl* SwDoc::MakeGrfFmtColl( const String &rFmtName,
void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast)
{
- ASSERT( nFmtColl, "Remove fuer Coll 0." );
+ OSL_ENSURE( nFmtColl, "Remove fuer Coll 0." );
// Wer hat die zu loeschende als Next
SwTxtFmtColl *pDel = (*pTxtFmtCollTbl)[nFmtColl];
@@ -1720,7 +1677,7 @@ void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast)
void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, sal_Bool bBroadcast )
{
sal_uInt16 nFmt = pTxtFmtCollTbl->GetPos( pColl );
- ASSERT( USHRT_MAX != nFmt, "Collection not found," );
+ OSL_ENSURE( USHRT_MAX != nFmt, "Collection not found," );
DelTxtFmtColl( nFmt, bBroadcast );
}
@@ -1741,18 +1698,15 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
lcl_RstAttr( pCNd, pPara );
- // --> OD 2007-11-06 #i62675#
- // --> OD 2008-04-15 #refactorlists#
- // check, if paragraph style has changed
+ // #i62675# check, if paragraph style has changed
if ( pPara->bResetListAttrs &&
pFmt != pCNd->GetFmtColl() &&
pFmt->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET )
{
- // --> OD 2009-09-07 #b6876367#
// Check, if the list style of the paragraph will change.
bool bChangeOfListStyleAtParagraph( true );
SwTxtNode* pTNd( dynamic_cast<SwTxtNode*>(pCNd) );
- ASSERT( pTNd,
+ OSL_ENSURE( pTNd,
"<lcl_SetTxtFmtColl(..)> - text node expected -> crash" );
{
SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() );
@@ -1770,7 +1724,6 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
if ( bChangeOfListStyleAtParagraph )
{
- // --> OD 2008-04-08 #refactorlists#
std::auto_ptr< SwRegHistory > pRegH;
if ( pPara->pHistory )
{
@@ -1786,9 +1739,7 @@ sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
pCNd->ResetAttr( RES_PARATR_LIST_ID );
}
- // <--
}
- // <--
}
// erst in die History aufnehmen, damit ggfs. alte Daten
@@ -1816,11 +1767,9 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl* pUndo = new SwUndoFmtColl( rRg, pFmt,
bReset,
bResetListAttrs );
- // <--
pHst = pUndo->GetHistory();
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
@@ -1828,9 +1777,8 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg,
ParaRstFmt aPara( pStt, pEnd, pHst );
aPara.pFmtColl = pFmt;
aPara.bReset = bReset;
- // --> OD 2007-11-06 #i62675#
+ // #i62675#
aPara.bResetListAttrs = bResetListAttrs;
- // <--
GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1,
lcl_SetTxtFmtColl, &aPara );
@@ -1866,9 +1814,8 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
fnCopyFmt, rDfltFmt );
// erzeuge das Format und kopiere die Attribute
- // --> OD 2005-01-13 #i40550#
+ // #i40550#
SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, sal_False, sal_True );
- // <--
pNewFmt->SetAuto( rFmt.IsAuto() );
pNewFmt->CopyAttrs( rFmt, sal_True ); // kopiere Attribute
@@ -1933,9 +1880,6 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
// kopiere jetzt noch die Auto-Formate oder kopiere die Attribute
pNewColl->CopyAttrs( rColl, sal_True );
- // setze noch den Outline-Level
- //if( NO_NUMBERING != rColl.GetOutlineLevel() ) //#outline level,zhaojianwei
- // pNewColl->SetOutlineLevel( rColl.GetOutlineLevel() );
if(rColl.IsAssignedToListLevelOfOutlineStyle())
pNewColl->AssignToListLevelOfOutlineStyle(rColl.GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
//<-end
@@ -2031,9 +1975,8 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
if( RES_CONDTXTFMTCOLL == pSrc->Which() )
MakeCondTxtFmtColl( pSrc->GetName(), (SwTxtFmtColl*)&rDfltFmt );
else
- // --> OD 2005-01-13 #i40550#
+ // #i40550#
(this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, sal_False, sal_True );
- // <--
}
}
@@ -2046,13 +1989,9 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDest = FindFmtByName( rDestArr, pSrc->GetName() );
pDest->SetAuto( sal_False );
-// pDest->ResetAllAttr();
-// pDest->CopyAttrs( *pSrc, sal_True ); // kopiere Attribute
+
//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus!
pDest->DelDiffs( *pSrc );
- // --> OD 2009-03-23 #i94285#
- // copy existing <SwFmtPageDesc> instance, before copying attributes
-// pDest->SetFmtAttr( pSrc->GetAttrSet() ); // kopiere Attribute
//JP 18.08.98: Bug 55115 - copy PageDescAttribute in this case
const SfxPoolItem* pItem;
if( &GetAttrPool() != pSrc->GetAttrSet().GetPool() &&
@@ -2068,7 +2007,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pPageDesc = aPageDescs[ MakePageDesc( rNm ) ];
}
pPageDesc->Add( &aPageDesc );
-// pDest->SetFmtAttr( aPageDesc );
SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() );
aTmpAttrSet.Put( aPageDesc );
pDest->SetFmtAttr( aTmpAttrSet );
@@ -2097,9 +2035,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDstColl->SetNextTxtFmtColl( *(SwTxtFmtColl*)FindFmtByName(
rDestArr, pSrcColl->GetNextTxtFmtColl().GetName() ) );
- // setze noch den Outline-Level
- //if( NO_NUMBERING != pSrcColl->GetOutlineLevel() ) //#outline level,zhaojianwei
- // pDstColl->SetOutlineLevel( pSrcColl->GetOutlineLevel() );
if(pSrcColl->IsAssignedToListLevelOfOutlineStyle())
pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
//<-end
@@ -2366,7 +2301,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulu
{
SvxLRSpaceItem aLS( (SvxLRSpaceItem&)pTNd->SwCntntNode::GetAttr( RES_LR_SPACE ) );
- // --> FME 2008-09-16 #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
+ // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx
if ( pTNd->AreListLevelIndentsApplicable() )
{
const SwNumRule* pRule = pTNd->GetNumRule();
@@ -2439,13 +2374,11 @@ void SwDoc::_CreateNumberFormatter()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::_CreateNumberFormatter" );
- ASSERT( !pNumberFormatter, "ist doch schon vorhanden" );
+ OSL_ENSURE( !pNumberFormatter, "ist doch schon vorhanden" );
+
+ LanguageType eLang = LANGUAGE_SYSTEM;
- LanguageType eLang = LANGUAGE_SYSTEM; //System::GetLanguage();
-/* ((const SvxLanguageItem&)GetAttrPool().
- GetDefaultItem( RES_CHRATR_LANGUAGE )).GetLanguage();
-*/
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
pNumberFormatter = new SvNumberFormatter( xMSF, eLang );
pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
@@ -2534,19 +2467,6 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet )
// in den Node gesetzt werden. Also muss man die Differenz nehmen
SwRedlineExtraData_Format aExtraData( rSet );
-/*
- if( pSet && pTNd->HasSwAttrSet() )
- {
- SfxItemSet aTmp( *pTNd->GetpSwAttrSet() );
- aTmp.Differentiate( *pSet );
- // das Adjust Item behalten wir extra
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pTNd->GetpSwAttrSet()->GetItemState(
- RES_PARATR_ADJUST, sal_False, &pItem ))
- aTmp.Put( *pItem );
- aExtraData.SetItemSet( aTmp );
- }
-*/
pRedl->SetExtraData( &aExtraData );
// !!!!!!!!! Undo fehlt noch !!!!!!!!!!!!!!!!!!
@@ -2635,7 +2555,7 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName,
BroadcastStyleOperation(sNewName, eFamily, SFX_STYLESHEET_MODIFIED);
}
-// --> OD 2006-09-27 #i69627#
+// #i69627#
namespace docfunc
{
bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc )
@@ -2656,7 +2576,6 @@ namespace docfunc
SwTxtFmtColl* pTxtFmtColl = (*pTxtFmtColls)[i];
if ( pTxtFmtColl->IsDefault() ||
- // pTxtFmtColl->GetOutlineLevel() == NO_NUMBERING ) //#outline level,zhaojianwei
! pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() ) //<-end,zhaojianwei
{
continue;
@@ -2669,15 +2588,13 @@ namespace docfunc
if ( SFX_ITEM_SET == pParentTxtFmtColl->GetItemState( RES_PARATR_NUMRULE ) )
{
- // --> OD 2009-11-12 #i106218#
- // consider that the outline style is set
+ // #i106218# consider that the outline style is set
const SwNumRuleItem& rDirectItem = pParentTxtFmtColl->GetNumRule();
if ( rDirectItem.GetValue() != rDoc.GetOutlineNumRule()->GetName() )
{
bRet = true;
break;
}
- // <--
}
}
@@ -2685,4 +2602,5 @@ namespace docfunc
return bRet;
}
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 80798546d041..6f5d0f509f52 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -313,8 +314,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
pFtnInfo->Modify( &aOld, &aNew );
}
- // --> OD 2008-01-09 #i81002#
- // no update during loading
+ // #i81002# no update during loading
if ( !IsInReading() )
{
UpdateRefFlds(NULL);
@@ -378,8 +378,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
pEndNoteInfo->Modify( &aOld, &aNew );
}
- // --> OD 2008-01-09 #i81002#
- // no update during loading
+ // #i81002# no update during loading
if ( !IsInReading() )
{
UpdateRefFlds(NULL);
@@ -423,8 +422,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
nSttCnt <= *pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
- if( /*rFtn.GetNumber() != nNumber ||*/
- rFtn.GetNumStr() != rNumStr ||
+ if( rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
bChg = sal_True;
@@ -455,8 +453,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
nEndCnt >= *pTxtFtn->GetStart() ) )
{
const SwFmtFtn& rFtn = pTxtFtn->GetFtn();
- if( /*rFtn.GetNumber() != nNumber ||*/
- rFtn.GetNumStr() != rNumStr ||
+ if( rFtn.GetNumStr() != rNumStr ||
rFtn.IsEndNote() != bIsEndNote )
{
bChg = sal_True;
@@ -503,3 +500,4 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index d31bc4df722a..cc881ca8cd45 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,24 +88,6 @@ sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
-#ifdef JP_TEST
- if( !pSplitColl )
- {
- sal_uInt8 nLvl = 1;
- const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
- for( sal_uInt16 n = rFmtColls.Count(); n; )
- //if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
- if( nLvl == rFmtColls[ --n ]->GetAttrOutlineLevel() -1 )//<-end,zhaojianwei 0814
- {
- pSplitColl = rFmtColls[ n ];
- break;
- }
-
- if( !pSplitColl )
- pSplitColl = GetTxtCollFromPool( RES_POOLCOLL_HEADLINE2 );
- }
-#endif
-
return SplitDoc( SPLITDOC_TO_HTML, rPath, pSplitColl );
}
@@ -129,7 +112,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
{
// wenn keine OutlineNumerierung ist, dann benutze eigenes Array
// und sammel die Nodes zusammen.
- //if( NO_NUMBERING == pSplitColl->GetOutlineLevel() )//#outline level,zhaojianwei
if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
{
pOutlNds = new SwOutlineNodes( 8, 8 );
@@ -151,7 +133,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// dann suche die Gliederungs - Vorlage, der 1. Ebene
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
for( sal_uInt16 n = rFmtColls.Count(); n; )
- //if( !rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
pSplitColl = rFmtColls[ n ];
@@ -171,7 +152,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
break;
default:
-// case SPLITDOC_TO_GLOBALDOC:
pFilter = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii( FILTER_XML ));
eDocType = SPLITDOC_TO_GLOBALDOC;
@@ -231,11 +211,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
pNd = pOutlNds->GetObject( nOutl );
SwTxtFmtColl* pTColl = pNd->GetTxtNode()->GetTxtColl();
- //if( ( pTColl == pSplitColl || //#outline level,zhaojianwei
- // ( NO_NUMBERING != pSplitColl->GetOutlineLevel() &&
- // pTColl->GetOutlineLevel() <
- // pSplitColl->GetOutlineLevel() )) &&
- // !pNd->FindTableNode() )
if( ( pTColl == pSplitColl ||
( pSplitColl->GetAttrOutlineLevel() > 0 &&
pTColl->GetAttrOutlineLevel() > 0 &&
@@ -358,7 +333,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_ENSURE( sal_False, "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
@@ -476,7 +451,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
} while( pSttNd );
-// if( pOutlNds != (SwOutlineNodes*)&GetNodes().GetOutLineNds();
if( pOutlNds != &GetNodes().GetOutLineNds() )
delete pOutlNds;
@@ -494,7 +468,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
break;
-// case SPLITDOC_TO_GLOBALDOC:
default:
// dann das Globaldoc speichern
set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
@@ -532,7 +505,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
break;
default:
-// case SPLITDOC_TO_GLOBALDOC:
pFilter = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii( FILTER_XML ));
eDocType = SPLITDOC_TO_GLOBALDOC;
@@ -670,7 +642,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
if( SPLITDOC_TO_HTML == eDocType &&
pDoc->GetSpzFrmFmts()->Count() )
{
- /* SfxViewFrame* pFrame = */
SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
}
xDocSh->DoSaveAs( *pTmpMed );
@@ -709,7 +680,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
aTmp.Exchange();
if( !aTmp.Move( fnMoveBackward, fnGoNode ))
{
- ASSERT( sal_False, "kein Node mehr vorhanden" );
+ OSL_ENSURE( sal_False, "kein Node mehr vorhanden" );
}
}
// Bookmarks usw. verschieben
@@ -854,3 +825,4 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutline
return pRet && pRet->GetValue();
}//<-end,zhaojianwei
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 610a8fb170b8..350bde67062c 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@ static void lcl_copyDocumentProperties(
}
}
-/* -----------------22.07.99 11:47-------------------
+/* --------------------------------------------------
Description: inserts an AutoText block
--------------------------------------------------*/
sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
@@ -115,8 +116,6 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
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!
sal_Bool bSav_IsInsGlossary = mbInsOnlyTxtGlssry;
mbInsOnlyTxtGlssry = rBlock.IsOnlyTextBlock( nIdx );
@@ -201,3 +200,4 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 98179bd1d8ea..fe7b0626300a 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,7 +56,6 @@
#include <rtl/logfile.hxx>
#include <SwStyleNameMapper.hxx>
#include <fchrfmt.hxx>
-#include <errhdl.hxx>
#include <frmatr.hxx>
#include <txatbase.hxx>
#include <fmtfld.hxx>
@@ -67,7 +67,6 @@
#include <fmtflcnt.hxx>
#include <fmtcnct.hxx>
#include <frmfmt.hxx>
-#include <dcontact.hxx>
#include <txtflcnt.hxx>
#include <docfld.hxx> // fuer Expression-Felder
#include <pam.hxx>
@@ -101,21 +100,18 @@
#include <PostItMgr.hxx>
#include <comcore.hrc> // STR-ResId's
-// #i11176#
#include <unoframe.hxx>
-// OD 2004-05-24 #i28701#
+
#include <sortedobjs.hxx>
-// --> OD 2004-07-26 #i32089#
#include <vector>
-// <--
using namespace ::com::sun::star;
using ::rtl::OUString;
#define DEF_FLY_WIDTH 2268 //Defaultbreite fuer FlyFrms (2268 == 4cm)
-/* #109161# */
+
static bool lcl_IsItemSet(const SwCntntNode & rNode, sal_uInt16 which)
{
bool bResult = false;
@@ -135,11 +131,7 @@ static bool lcl_IsItemSet(const SwCntntNode & rNode, sal_uInt16 which)
|* entsprechende Formate-Array gestellt.
|* Wenn bereits ein passendes Format existiert, so wird dies
|* zurueckgeliefert.
-|* Ersterstellung MA 22. Sep. 92
-|* Letzte Aenderung JP 08.05.98
-|*
|*************************************************************************/
-
SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
{
SwFrmFmt *pFmt = 0;
@@ -206,34 +198,32 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet )
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
case FLY_AT_PAGE:
case FLY_AT_CHAR:
case FLY_AT_FLY:
case FLY_AT_PARA:
case FLY_AS_CHAR:
- ASSERT( false, "use new interface instead: SwDoc::MakeFlySection!" );
+ OSL_ENSURE( false, "use new interface instead: SwDoc::MakeFlySection!" );
break;
#endif
default:
- ASSERT( !this,
+ OSL_ENSURE( !this,
"Layoutformat mit ungueltigem Request angefordert." );
}
return pFmt;
}
+
/*************************************************************************
|*
|* SwDoc::DelLayoutFmt()
|*
|* Beschreibung Loescht das angegebene Format, der Inhalt wird mit
|* geloescht.
-|* Ersterstellung MA 23. Sep. 92
-|* Letzte Aenderung MA 05. Feb. 93
|*
|*************************************************************************/
-
void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
{
//Verkettung von Rahmen muss ggf. zusammengefuehrt werden.
@@ -260,18 +250,6 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
SwOLENode* pOLENd = GetNodes()[ pCntIdx->GetIndex()+1 ]->GetOLENode();
if( pOLENd && pOLENd->GetOLEObj().IsOleRef() )
{
- /*
- SwDoc* pDoc = (SwDoc*)pFmt->GetDoc();
- if( pDoc )
- {
- SfxObjectShell* p = pDoc->GetPersist();
- if( p ) // muss da sein
- {
- SvInfoObjectRef aRef( p->Find( pOLENd->GetOLEObj().GetName() ) );
- if( aRef.Is() )
- aRef->SetObj(0);
- }
- } */
// TODO/MBA: the old object closed the object, cleared all references to it, but didn't remove it from the container.
// I have no idea, why, nobody could explain it - so I do my very best to mimic this behavior
@@ -287,7 +265,6 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
}
- //pOLENd->GetOLEObj().GetOleRef() = 0;
}
}
@@ -303,7 +280,7 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
else
{
- // --> OD 2004-07-26 #i32089# - delete at-frame anchored objects
+ // #i32089# - delete at-frame anchored objects
if ( nWh == RES_FLYFRMFMT )
{
// determine frame formats of at-frame anchored objects
@@ -388,22 +365,18 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
|* Vom chaos::Anchor-Attribut wird die Position immer
|* auf 0 gesetzt !!!
|*
-|* Ersterstellung BP 18.12.92
-|* Letzte Aenderung MA 17. Jul. 96
-|*
|*************************************************************************/
-
SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
const SwFmtAnchor& rNewAnchor,
bool bSetTxtFlyAtt, bool bMakeFrms )
{
const bool bFly = RES_FLYFRMFMT == rSource.Which();
const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
- ASSERT( bFly || bDraw, "this method only works for fly or draw" );
+ OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
SwDoc* pSrcDoc = (SwDoc*)rSource.GetDoc();
- // #108784# may we copy this object?
+ // May we copy this object?
// We may, unless it's 1) it's a control (and therfore a draw)
// 2) anchored in a header/footer
// 3) anchored (to paragraph?)
@@ -505,16 +478,16 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
}
else
{
- ASSERT( RES_DRAWFRMFMT == rSource.Which(), "Weder Fly noch Draw." );
- // OD 2005-08-02 #i52780# - Note: moving object to visible layer not needed.
+ OSL_ENSURE( RES_DRAWFRMFMT == rSource.Which(), "Weder Fly noch Draw." );
+ // #i52780# - Note: moving object to visible layer not needed.
SwDrawContact* pSourceContact = (SwDrawContact *)rSource.FindContactObj();
SwDrawContact* pContact = new SwDrawContact( (SwDrawFrmFmt*)pDest,
CloneSdrObj( *pSourceContact->GetMaster(),
mbCopyIsMove && this == pSrcDoc ) );
- // --> OD 2005-05-23 #i49730# - notify draw frame format
- // that position attributes are already set, if the position attributes
- // are already set at the source draw frame format.
+ // #i49730# - notify draw frame format that position attributes are
+ // already set, if the position attributes are already set at the
+ // source draw frame format.
if ( pDest->ISA(SwDrawFrmFmt) &&
rSource.ISA(SwDrawFrmFmt) &&
static_cast<const SwDrawFrmFmt&>(rSource).IsPosAttrSet() )
@@ -525,8 +498,7 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
if( pDest->GetAnchor() == rNewAnchor )
{
- // OD 03.07.2003 #108784# - do *not* connect to layout, if
- // a <MakeFrms> will not be called.
+ // Do *not* connect to layout, if a <MakeFrms> will not be called.
if ( bMakeFrms )
{
pContact->ConnectToLayout( &rNewAnchor );
@@ -558,9 +530,8 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
sal_Bool bInsInPage )
{
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
SdrPage *pPg = GetOrCreateDrawModel()->GetPage( 0 );
- // <--
if( !pPg )
{
pPg = GetDrawModel()->AllocPage( sal_False );
@@ -574,7 +545,7 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
uno::Reference< awt::XControlModel > xModel = ((SdrUnoObj*)pObj)->GetUnoControlModel();
uno::Any aVal;
uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
- OUString sName( rtl::OUString::createFromAscii("Name") );
+ OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
if( xSet.is() )
aVal = xSet->getPropertyValue( sName );
if( bInsInPage )
@@ -585,8 +556,7 @@ SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc,
else if( bInsInPage )
pPg->InsertObject( pObj );
- // OD 02.07.2003 #108784# - for drawing objects: set layer of cloned object
- // to invisible layer
+ // For drawing objects: set layer of cloned object to invisible layer
SdrLayerID nLayerIdForClone = rObj.GetLayer();
if ( !pObj->ISA(SwFlyDrawObj) &&
!pObj->ISA(SwVirtFlyDrawObj) &&
@@ -649,8 +619,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
// Anker noch nicht gesetzt ?
RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId()
: pFmt->GetAnchor().GetAnchorId();
- // --> OD 2010-01-07 #i107811#
- // Assure that at-page anchored fly frames have a page num or a content anchor set.
+ // #i107811# Assure that at-page anchored fly frames have a page num or a
+ // content anchor set.
if ( !pAnchor ||
( FLY_AT_PAGE != pAnchor->GetAnchorId() &&
!pAnchor->GetCntntAnchor() ) ||
@@ -694,7 +664,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
xub_StrLen nStt = rAnchPos.nContent.GetIndex();
SwTxtNode * pTxtNode = rAnchPos.nNode.GetNode().GetTxtNode();
- ASSERT(pTxtNode!= 0, "There should be a SwTxtNode!");
+ OSL_ENSURE(pTxtNode!= 0, "There should be a SwTxtNode!");
if (pTxtNode != NULL)
{
@@ -773,7 +743,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
sal_uInt16 nCollId = static_cast<sal_uInt16>(
get(IDocumentSettingAccess::HTML_MODE) ? RES_POOLCOLL_TEXT : RES_POOLCOLL_FRAME );
- /* #109161# If there exists no adjust item in the paragraph
+ /* If there exists no adjust item in the paragraph
style for the content node of the new fly section
propagate an existing adjust item at the anchor to the new
content node. */
@@ -814,7 +784,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
{
do { // middle check loop
const SwFmtCntnt &rCntnt = pFmt->GetCntnt();
- ASSERT( rCntnt.GetCntntIdx(), "Kein Inhalt vorbereitet." );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "Kein Inhalt vorbereitet." );
SwNodeIndex aIndex( *(rCntnt.GetCntntIdx()), 1 );
SwCntntNode *pNode = aIndex.GetNode().GetCntntNode();
@@ -863,7 +833,7 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
// wenn Tabelle im Rahmen, dann ohne nachfolgenden TextNode
aIndex = rCntnt.GetCntntIdx()->GetNode().EndOfSectionIndex() - 1;
- ASSERT( aIndex.GetNode().GetTxtNode(),
+ OSL_ENSURE( aIndex.GetNode().GetTxtNode(),
"hier sollte ein TextNode stehen" );
aPos.nContent.Assign( 0, 0 ); // Index abmelden !!
GetNodes().Delete( aIndex, 1 );
@@ -878,15 +848,6 @@ if( GetIDocumentUndoRedo().DoesUndo() )
}
else
{
-/*
- // alle Pams verschieben
- SwPaM* pTmp = (SwPaM*)&rPam;
- do {
- if( pTmp->HasMark() &&
- *pTmp->GetPoint() != *pTmp->GetMark() )
- MoveAndJoin( *pTmp, aPos );
- } while( &rPam != ( pTmp = (SwPaM*)pTmp->GetNext() ) );
-*/
// copy all Pams and then delete all
SwPaM* pTmp = (SwPaM*)&rPam;
sal_Bool bOldFlag = mbCopyIsMove;
@@ -924,9 +885,8 @@ if( GetIDocumentUndoRedo().DoesUndo() )
return pFmt;
}
-
- //Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
- // angemeldet sein.
+// Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
+// angemeldet sein.
SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
SdrObject& rDrawObj,
const SfxItemSet* pFlyAttrSet,
@@ -962,8 +922,8 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
: &rRg.GetPoint()->nNode;
}
- // OD 24.06.2003 #108784# - allow drawing objects in header/footer, but
- // control objects aren't allowed in header/footer.
+ // Allow drawing objects in header/footer, but control objects aren't
+ // allowed in header/footer.
if( pChkIdx &&
::CheckControlLayer( &rDrawObj ) &&
IsInHeaderFooter( *pChkIdx ) )
@@ -1008,14 +968,13 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
if( GetRootFrm() )
{
pFmt->MakeFrms();
- // --> OD 2005-02-09 #i42319# - follow-up of #i35635#
+ // #i42319# - follow-up of #i35635#
// move object to visible layer
- // --> OD 2007-07-10 #i79391#
+ // #i79391#
if ( pContact->GetAnchorFrm() )
{
pContact->MoveObjToVisibleLayer( &rDrawObj );
}
- // <--
}
if (GetIDocumentUndoRedo().DoesUndo())
@@ -1027,26 +986,6 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
return pFmt;
}
-/*************************************************************************
-|*
-|* SwDoc::GetAllFlyFmts
-|*
-|* Ersterstellung MA 14. Jul. 93
-|* Letzte Aenderung MD 23. Feb. 95
-|*
-|*************************************************************************/
-
-/*sal_Bool TstFlyRange( const SwPaM* pPam, sal_uInt32 nFlyPos )
-{
- sal_Bool bOk = sal_False;
- const SwPaM* pTmp = pPam;
- do {
- bOk = pTmp->Start()->nNode.GetIndex() < nFlyPos &&
- pTmp->End()->nNode.GetIndex() > nFlyPos;
- } while( !bOk && pPam != ( pTmp = (const SwPaM*)pTmp->GetNext() ));
- return bOk;
-}
-*/
/* -----------------------------04.04.00 10:55--------------------------------
paragraph frames - o.k. if the PaM includes the paragraph from the beginning
to the beginning of the next paragraph at least
@@ -1087,7 +1026,6 @@ sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos,
return bOk;
}
-
void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
const SwPaM* pCmpRange, sal_Bool bDrawAlso ) const
{
@@ -1179,9 +1117,6 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
|*
|* SwDoc::InsertLabel()
|*
-|* Ersterstellung MA 11. Feb. 94
-|* Letzte Aenderung MA 12. Nov. 97
-|*
|*************************************************************************/
/* #i6447# changed behaviour if lcl_CpyAttr:
@@ -1195,7 +1130,6 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
Otherwise the new set will not be changed.
*/
-
void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWhich )
{
const SfxPoolItem *pOldItem = NULL, *pNewItem = NULL;
@@ -1215,17 +1149,16 @@ void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWh
rNewSet.Put( *pOldItem );
}
else {
- ASSERT(0, "What am I doing here?");
+ OSL_ENSURE(0, "What am I doing here?");
}
}
else {
- ASSERT(0, "What am I doing here?");
+ OSL_ENSURE(0, "What am I doing here?");
}
}
}
-
static SwFlyFrmFmt *
lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
SwUndoInsertLabel *const pUndo,
@@ -1278,7 +1211,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//einfuegen (Frame wird automatisch erzeugt).
{
SwStartNode *pSttNd = rDoc.GetNodes()[nNdIdx]->GetStartNode();
- ASSERT( pSttNd, "Kein StartNode in InsertLabel." );
+ OSL_ENSURE( pSttNd, "Kein StartNode in InsertLabel." );
sal_uLong nNode;
if( bBefore )
{
@@ -1311,7 +1244,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
- ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
+ OSL_ENSURE( pOldFmt, "Format des Fly nicht gefunden." );
pOldFmt->DelFrms();
pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
@@ -1390,14 +1323,14 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
{
const SwPosition *pPos = rAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(nIdx, RES_TXTATR_FLYCNT);
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pOldFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pOldFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt(
@@ -1455,7 +1388,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
default:
OSL_ENSURE(false, "unknown LabelType?");
}
- ASSERT( pNew, "No Label inserted" );
+ OSL_ENSURE( pNew, "No Label inserted" );
if( pNew )
{
//#i61007# order of captions
@@ -1571,11 +1504,7 @@ SwDoc::InsertLabel(
|*
|* SwDoc::InsertDrawLabel()
|*
-|* Ersterstellung MIB 7. Dez. 98
-|* Letzte Aenderung MIB 7. Dez. 98
-|*
|*************************************************************************/
-
static SwFlyFrmFmt *
lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
SwUndoInsertLabel *const pUndo, SwDrawFrmFmt *const pOldFmt,
@@ -1588,6 +1517,8 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
{
::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
::sw::DrawUndoGuard const drawUndoGuard(rDoc.GetIDocumentUndoRedo());
+ OSL_ENSURE( RES_DRAWFRMFMT == pContact->GetFmt()->Which(),
+ "Kein DrawFrmFmt" );
// Erstmal das Feld bauen, weil ueber den Namen die TxtColl besorgt
// werden muss
@@ -1623,7 +1554,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
// dem Object (Grafik/Ole) absatzgebunden in den neuen Rahmen,
// Frames erzeugen.
- // OD 27.11.2003 #112045# - Keep layer ID of drawing object before removing
+ // Keep layer ID of drawing object before removing
// its frames.
// Note: The layer ID is passed to the undo and have to be the correct value.
// Removing the frames of the drawing object changes its layer.
@@ -1651,7 +1582,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_SURROUND );
// Den Rahmen ggf. in den Hintergrund schicken.
- // OD 02.07.2003 #108784# - consider 'invisible' hell layer.
+ // Consider 'invisible' hell layer.
if ( rDoc.GetHellId() != nLayerId &&
rDoc.GetInvisibleHellId() != nLayerId )
{
@@ -1661,7 +1592,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
}
// Position uebernehmen
- // OD 2004-04-15 #i26791# - use directly the positioning attributes of
+ // #i26791# - use directly the positioning attributes of
// the drawing object.
pNewSet->Put( pOldFmt->GetHoriOrient() );
pNewSet->Put( pOldFmt->GetVertOrient() );
@@ -1705,15 +1636,15 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
{
const SwPosition *pPos = rAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
-#ifdef DBG_UTIL
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).
+ OSL_ENSURE( pHnt && ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).
GetFrmFmt() == (SwFrmFmt*)pOldFmt,
"Wrong TxtFlyCnt-Hint." );
#endif
@@ -1728,9 +1659,9 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
if (nLayerId == rDoc.GetHellId())
{
+ // Consider drawing objects in 'invisible' hell layer
rSdrObj.SetLayer( rDoc.GetHeavenId() );
}
- // OD 02.07.2003 #108784# - consider drawing objects in 'invisible' hell layer
else if (nLayerId == rDoc.GetInvisibleHellId())
{
rSdrObj.SetLayer( rDoc.GetInvisibleHeavenId() );
@@ -1738,7 +1669,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
pNewSet->Put( SvxLRSpaceItem( RES_LR_SPACE ) );
pNewSet->Put( SvxULSpaceItem( RES_UL_SPACE ) );
- // OD 2004-04-15 #i26791# - set position of the drawing object, which is labeled.
+ // #i26791# - set position of the drawing object, which is labeled.
pNewSet->Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
pNewSet->Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) );
@@ -1753,7 +1684,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
if( pUndo )
{
pUndo->SetFlys( *pOldFmt, *pNewSet, *pNewFmt );
- // OD 2004-04-15 #i26791# - position no longer needed
+ // #i26791# - position no longer needed
pUndo->SetDrawObj( nLayerId );
}
else
@@ -1765,7 +1696,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
- ASSERT( pNew, "No Label inserted" );
+ OSL_ENSURE( pNew, "No Label inserted" );
if( pNew )
{
@@ -1872,7 +1803,6 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel(
|* IDocumentTimerAccess-methods
|*
|*************************************************************************/
-
void SwDoc::StartIdling()
{
mbStartIdleTimer = sal_True;
@@ -1899,16 +1829,11 @@ void SwDoc::UnblockIdling()
aIdleTimer.Start();
}
-
/*************************************************************************
|*
|* SwDoc::DoIdleJobs()
|*
-|* Ersterstellung OK 30.03.94
-|* Letzte Aenderung MA 09. Jun. 95
-|*
|*************************************************************************/
-
IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
{
#ifdef TIMELOG
@@ -1937,8 +1862,8 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
sal_Bool bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
sal_Bool bIsAutoGrammar = sal_False;
- SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii(
- UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar;
+ SvtLinguConfig().GetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ UPN_IS_GRAMMAR_AUTO )) ) >>= bIsAutoGrammar;
if (bIsOnlineSpell && bIsAutoGrammar)
StartGrammarChecking( *this );
@@ -2273,7 +2198,7 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const
}
if( n >= GetSpzFrmFmts()->Count() )
{
- ASSERT( mbInReading, "Fly-Section aber kein Format gefunden" );
+ OSL_ENSURE( mbInReading, "Fly-Section aber kein Format gefunden" );
return sal_False;
}
}
@@ -2289,13 +2214,12 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode();
- // --> OD 2005-02-21 #i42921# - use new method <SwCntntNode::GetTextDirection(..)>
+ // #i42921# - use new method <SwCntntNode::GetTextDirection(..)>
if ( pNd )
{
nRet = pNd->GetTextDirection( rPos, pPt );
}
if ( nRet == -1 )
- // <--
{
const SvxFrameDirectionItem* pItem = 0;
if( pNd )
@@ -2349,3 +2273,5 @@ void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; }
SwLayouter* SwDoc::GetLayouter() { return pLayouter; }
const SwLayouter* SwDoc::GetLayouter() const { return pLayouter; }
void SwDoc::SetLayouter( SwLayouter* pNew ) { pLayouter = pNew; }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index cdf031aeb923..a396ef295d27 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,37 +103,29 @@
#include <cmdid.h> // fuer den dflt - Printer in SetJob
-// --> OD 2006-04-19 #b6375613#
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-// <--
-
-// --> OD 2007-03-16 #i73788#
#include <pausethreadstarting.hxx>
-// <--
#include <numrule.hxx>
-// --> OD 2008-03-13 #refactorlists#
#include <list.hxx>
#include <listfunc.hxx>
-// <--
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <sfx2/Metadatable.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::document;
-const sal_Char __FAR_DATA sFrmFmtStr[] = "Frameformat";
-const sal_Char __FAR_DATA sEmptyPageStr[] = "Empty Page";
-const sal_Char __FAR_DATA sColumnCntStr[] = "Columncontainer";
-const sal_Char __FAR_DATA sCharFmtStr[] = "Zeichenformat";
-const sal_Char __FAR_DATA sTxtCollStr[] = "Textformatvorlage";
-const sal_Char __FAR_DATA sGrfCollStr[] = "Graphikformatvorlage";
+const sal_Char sFrmFmtStr[] = "Frameformat";
+const sal_Char sEmptyPageStr[] = "Empty Page";
+const sal_Char sColumnCntStr[] = "Columncontainer";
+const sal_Char sCharFmtStr[] = "Zeichenformat";
+const sal_Char sTxtCollStr[] = "Textformatvorlage";
+const sal_Char sGrfCollStr[] = "Graphikformatvorlage";
SV_IMPL_PTRARR( SwNumRuleTbl, SwNumRulePtr)
SV_IMPL_PTRARR( SwTxtFmtColls, SwTxtFmtCollPtr)
@@ -141,7 +134,6 @@ SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr)
/*
* global functions...
*/
-
uno::Reference< linguistic2::XProofreadingIterator > SwDoc::GetGCIterator() const
{
if (!m_xGCIterator.is() && SvtLinguConfig().HasGrammarChecker())
@@ -151,13 +143,13 @@ SV_IMPL_PTRARR( SwGrfFmtColls, SwGrfFmtCollPtr)
{
try
{
- rtl::OUString aServiceName( rtl::OUString::createFromAscii("com.sun.star.linguistic2.ProofreadingIterator") );
+ rtl::OUString aServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ProofreadingIterator"));
m_xGCIterator = uno::Reference< linguistic2::XProofreadingIterator >
( xMgr->createInstance( aServiceName ), uno::UNO_QUERY_THROW );
}
catch (uno::Exception &)
{
- DBG_ERROR( "No GCIterator" );
+ OSL_FAIL( "No GCIterator" );
}
}
}
@@ -200,9 +192,6 @@ void StartGrammarChecking( SwDoc &rDoc )
/*
* interne Funktionen
*/
-
-
-
sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
{
SwFmtCntnt &rFmtCntnt = (SwFmtCntnt&)rpFmt->GetCntnt();
@@ -217,7 +206,6 @@ sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
/*
* exportierte Methoden
*/
-
SwDoc::SwDoc()
: m_pNodes( new SwNodes(this) )
,
@@ -261,27 +249,21 @@ SwDoc::SwDoc()
pURLStateChgd( 0 ),
pNumberFormatter( 0 ),
pNumRuleTbl( new SwNumRuleTbl ),
- // --> OD 2008-03-26 #refactorlists#
maLists(),
maListStyleLists(),
- // <--
pRedlineTbl( new SwRedlineTbl ),
pAutoFmtRedlnComment( 0 ),
pUnoCrsrTbl( new SwUnoCrsrTbl( 0, 16 ) ),
pPgPViewPrtData( 0 ),
pExtInputRing( 0 ),
pLayouter( 0 ),
- // --> OD 2008-03-07 #refactorlists#
pStyleAccess( 0 ),
- // <--
pLayoutCache( 0 ),
pUnoCallBack(new SwModify(0)),
mpGrammarContact( 0 ),
aChartDataProviderImplRef(),
pChartControllerHelper( 0 ),
- // --> OD 2007-10-31 #i83479#
- mpListItemsList( new tImplSortedNodeNumList() ),
- // <--
+ mpListItemsList( new tImplSortedNodeNumList() ), // #i83479#
m_pXmlIdRegistry(),
nAutoFmtRedlnCommentNo( 0 ),
nLinkUpdMode( GLOBALSETTING ),
@@ -292,12 +274,10 @@ SwDoc::SwDoc()
mIdleBlockCount(0),
nLockExpFld( 0 ),
mbReadlineChecked(false),
- // --> OD 2005-02-11 #i38810#
- mbLinksUpdated( sal_False ),
+ mbLinksUpdated( sal_False ), //#i38810#
mbClipBoard( false ),
mbColumnSelection( false ),
- // i#78591#
- mbProtectForm(false),
+ mbProtectForm(false), // i#78591#
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
mbStartIdleTimer(sal_False)
@@ -329,12 +309,10 @@ SwDoc::SwDoc()
mbInsOnlyTxtGlssry =
mbContains_MSVBasic =
mbKernAsianPunctuation =
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
mbXMLExport =
#endif
- // --> OD 2006-03-21 #b6375613#
mbApplyWorkaroundForB6375613 =
- // <--
false;
mbNewFldLst =
@@ -375,9 +353,9 @@ SwDoc::SwDoc()
mbUnixForceZeroExtLeading = false; // hidden
mbOldPrinterMetrics = false; // hidden
mbTabRelativeToIndent = true; // hidden
- // --> OD 2008-06-05 #i89181#
- mbTabAtLeftIndentForParagraphsInList = false; // hidden
- // <--
+ mbTabAtLeftIndentForParagraphsInList = false; // hidden #i89181#
+ mbInvertBorderSpacing = false; // hidden
+ mbCollapseEmptyCellPara = true; // hidden
//
// COMPATIBILITY FLAGS END
@@ -415,18 +393,13 @@ SwDoc::SwDoc()
_InitFieldTypes();
// lege (fuer die Filter) eine Default-OutlineNumRule an
- // --> OD 2008-02-11 #newlistlevelattrs#
pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(),
- // <--
OUTLINE_RULE );
- // <--
- // #115901#
AddNumRule(pOutlineRule);
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // Counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- // <--
new SwTxtNode(
SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
@@ -447,7 +420,6 @@ SwDoc::SwDoc()
// create TOXTypes
InitTOXTypes();
- // --> OD 2008-03-07 #refactorlists#
// pass empty item set containing the paragraph's list attributes
// as ignorable items to the stype manager.
{
@@ -456,7 +428,6 @@ SwDoc::SwDoc()
0 );
pStyleAccess = createStyleManager( &aIgnorableParagraphItems );
}
- // <--
ResetModified();
}
@@ -467,8 +438,6 @@ SwDoc::SwDoc()
* Dieser darf also keinesfalls durch delete geloescht
* werden!!!!!!!!!!
*/
-
-
SwDoc::~SwDoc()
{
// nothing here should create Undo actions!
@@ -479,14 +448,10 @@ SwDoc::~SwDoc()
pDocShell->SetUndoManager(0);
}
- // --> OD 2007-03-16 #i73788#
- SwPauseThreadStarting aPauseThreadStarting;
- // <--
- // --> OD 2007-11-01 #i83479#
+ // #i83479#
delete mpListItemsList;
mpListItemsList = 0;
- // <--
// clean up chart related structures...
// Note: the chart data provider gets already diposed in ~SwDocShell
@@ -514,9 +479,7 @@ SwDoc::~SwDoc()
delete pURLStateChgd;
delete pLayouter;
- // --> OD 2005-09-05 #125370#
pLayouter = 0L;
- // <--
// Undo-Benachrichtigung vom Draw abschalten
if( pDrawModel )
@@ -614,7 +577,7 @@ SwDoc::~SwDoc()
pFtnColl = pEndNoteInfo->GetFtnTxtColl();
if ( pFtnColl ) pFtnColl->Remove(pEndNoteInfo);
- ASSERT( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
+ OSL_ENSURE( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
"Default-Text-Collection muss immer am Anfang stehen" );
// JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
@@ -625,7 +588,7 @@ SwDoc::~SwDoc()
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
delete pTxtFmtCollTbl;
- ASSERT( pDfltGrfFmtColl == (*pGrfFmtCollTbl)[0],
+ OSL_ENSURE( pDfltGrfFmtColl == (*pGrfFmtCollTbl)[0],
"Default-Grf-Collection muss immer am Anfang stehen" );
pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 );
@@ -673,9 +636,8 @@ SwDoc::~SwDoc()
delete pDfltGrfFmtColl;
delete pNumRuleTbl;
- // --> OD 2008-03-26 #refactorlists#
{
- for ( std::hash_map< String, SwList*, StringHash >::iterator
+ for ( boost::unordered_map< String, SwList*, StringHash >::iterator
aListIter = maLists.begin();
aListIter != maLists.end();
++aListIter )
@@ -685,7 +647,6 @@ SwDoc::~SwDoc()
maLists.clear();
}
maListStyleLists.clear();
- // <--
delete pPrtData;
delete pNumberFormatter;
@@ -706,19 +667,15 @@ SwDoc::~SwDoc()
SfxItemPool::Free(mpAttrPool);
}
-//---------------------------------------------------
-
VirtualDevice& SwDoc::CreateVirtualDevice_() const
{
VirtualDevice* pNewVir = new VirtualDevice( 1 );
- // <--
pNewVir->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
- // --> FME 2006-10-09 #i60945# External leading compatibility for unix systems.
+ // #i60945# External leading compatibility for unix systems.
if ( get(IDocumentSettingAccess::UNIX_FORCE_ZERO_EXT_LEADING ) )
pNewVir->Compat_ZeroExtleadBug();
- // <--
MapMode aMapMode( pNewVir->GetMapMode() );
aMapMode.SetMapUnit( MAP_TWIP );
@@ -728,14 +685,12 @@ VirtualDevice& SwDoc::CreateVirtualDevice_() const
return *pVirDev;
}
-//---------------------------------------------------
-
SfxPrinter& SwDoc::CreatePrinter_() const
{
- ASSERT( ! pPrt, "Do not call CreatePrinter_(), call getPrinter() instead" )
+ OSL_ENSURE( ! pPrt, "Do not call CreatePrinter_(), call getPrinter() instead" );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "Printer will be created!" )
+ OSL_ENSURE( false, "Printer will be created!" );
#endif
// wir erzeugen einen default SfxPrinter.
@@ -751,7 +706,6 @@ SfxPrinter& SwDoc::CreatePrinter_() const
const_cast<SwDoc*>(this)->setPrinter( pNewPrt, true, true );
return *pPrt;
}
-//---------------------------------------------------
void SwDoc::SetDocShell( SwDocShell* pDSh )
{
@@ -773,18 +727,14 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
{
((SwDrawDocument*)pDrawModel)->SetObjectShell( pDocShell );
pDrawModel->SetPersist( pDocShell );
- ASSERT( pDrawModel->GetPersist() == GetPersist(),
+ OSL_ENSURE( pDrawModel->GetPersist() == GetPersist(),
"draw model's persist is out of sync" );
}
}
}
-
// Convenience-Methode, um uebermaessige Includes von docsh.hxx
// zu vermeiden
-
-
-
uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
{
if( pDocShell )
@@ -794,14 +744,11 @@ uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
return NULL;
}
-
-
SfxObjectShell* SwDoc::GetPersist() const
{
return pDocShell ? pDocShell : pLinkMgr->GetPersist();
}
-
void SwDoc::ClearDoc()
{
GetIDocumentUndoRedo().DelAllUndoObj();
@@ -818,7 +765,7 @@ void SwDoc::ClearDoc()
sal_uInt16 n;
while ( 0 != (n = GetSpzFrmFmts()->Count()) )
DelLayoutFmt((*pSpzFrmFmtTbl)[n-1]);
- ASSERT( !pDrawModel || !pDrawModel->GetPage(0)->GetObjCount(),
+ OSL_ENSURE( !pDrawModel || !pDrawModel->GetPage(0)->GetObjCount(),
"not all DrawObjects removed from the page" );
pRedlineTbl->DeleteAndDestroy( 0, pRedlineTbl->Count() );
@@ -852,24 +799,19 @@ void SwDoc::ClearDoc()
GetNodes().Delete( aSttIdx,
GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
- // --> OD 2006-02-28 #i62440#
+ // #i62440#
// destruction of numbering rules and creation of new outline rule
// *after* the document nodes are deleted.
pOutlineRule = NULL;
pNumRuleTbl->DeleteAndDestroy( 0, pNumRuleTbl->Count() );
// creation of new outline numbering rule
- // --> OD 2008-02-11 #newlistlevelattrs#
pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode(),
- // <--
OUTLINE_RULE );
- // <--
AddNumRule(pOutlineRule);
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ // Counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- // <--
- // <--
//remove the dummy pagedec from the array and delete all the old ones
aPageDescs.Remove( nDummyPgDsc );
@@ -882,9 +824,9 @@ void SwDoc::ClearDoc()
pFtnColl = pEndNoteInfo->GetFtnTxtColl();
if( pFtnColl ) pFtnColl->Remove( pEndNoteInfo );
- // JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
- // steht, sollte das als letztes geloescht werden, damit
- // die ganze Umhaengerei der Formate vermieden wird!
+ // opt.: ausgehend davon, das Standard als 2. im Array
+ // steht, sollte das als letztes geloescht werden, damit
+ // die ganze Umhaengerei der Formate vermieden wird!
if( 2 < pTxtFmtCollTbl->Count() )
pTxtFmtCollTbl->DeleteAndDestroy( 2, pTxtFmtCollTbl->Count()-2 );
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
@@ -901,7 +843,7 @@ void SwDoc::ClearDoc()
else
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
- xForbiddenCharsTable.unbind();
+ xForbiddenCharsTable.clear();
pFldTypes->DeleteAndDestroy( INIT_FLDTYPES,
pFldTypes->Count() - INIT_FLDTYPES );
@@ -931,19 +873,16 @@ void SwDoc::SetPreViewPrtData( const SwPagePreViewPrtData* pNew )
DELETEZ( pPgPViewPrtData );
SetModified();
}
-/* -----------------------------06.01.00 14:03--------------------------------
- ---------------------------------------------------------------------------*/
SwModify* SwDoc::GetUnoCallBack() const
{
return pUnoCallBack;
}
-/*-----------------28.5.2001 10:06------------------
- * SwDoc:
+
+/** SwDoc:
* Reading and writing of the layout cache.
*--------------------------------------------------*/
-
void SwDoc::ReadLayoutCache( SvStream& rStream )
{
if( !pLayoutCache )
@@ -969,8 +908,8 @@ IGrammarContact* getGrammarContact( const SwTxtNode& rTxtNode )
return pDoc->getGrammarContact();
}
-// --> FME 2005-02-25 #i42634# Moved common code of SwReader::Read() and
-// SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
+// #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks()
+// to new SwDoc::UpdateLinks():
void SwDoc::UpdateLinks( sal_Bool bUI )
{
SfxObjectCreateMode eMode;
@@ -1012,8 +951,7 @@ void SwDoc::UpdateLinks( sal_Bool bUI )
}
}
-// <--
-// --> OD 2006-04-19 #b6375613#
+
void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
{
if ( mbApplyWorkaroundForB6375613 != p_bApplyWorkaroundForB6375613 )
@@ -1035,13 +973,13 @@ void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
if ( mbApplyWorkaroundForB6375613 )
{
xDocInfo->addProperty(
- rtl::OUString::createFromAscii("WorkaroundForB6375613Applied"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")),
beans::PropertyAttribute::TRANSIENT | beans::PropertyAttribute::REMOVABLE,
uno::makeAny( false ) );
}
else
{
- xDocInfo->removeProperty( rtl::OUString::createFromAscii("WorkaroundForB6375613Applied") );
+ xDocInfo->removeProperty( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")) );
}
}
catch( uno::Exception& )
@@ -1051,7 +989,6 @@ void SwDoc::SetApplyWorkaroundForB6375613( bool p_bApplyWorkaroundForB6375613 )
}
}
}
-// <--
::sfx2::IXmlIdRegistry&
SwDoc::GetXmlIdRegistry()
@@ -1113,20 +1050,15 @@ void SwDoc::InitTOXTypes()
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
}
-/*-- 08.05.2009 10:07:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
{
SwDoc* pRet = new SwDoc;
//copy settings
- sal_uInt16 __FAR_DATA aRangeOfDefaults[] = {
+ sal_uInt16 aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists##
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
@@ -1198,6 +1130,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
return pRetShell;
}
+
/*-- 08.05.2009 10:52:40---------------------------------------------------
copy document content - code from SwFEShell::Paste( SwDoc* , sal_Bool )
-----------------------------------------------------------------------*/
@@ -1273,3 +1206,5 @@ void SwDoc::Paste( const SwDoc& rSource )
UnlockExpFlds();
UpdateFlds(NULL, false);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 5a559c022c7b..caf34812dd9e 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,10 +60,9 @@
#include <frmatr.hxx>
#include <SwStyleNameMapper.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-03-13 #refactorlists#
+
#include <list.hxx>
#include <listfunc.hxx>
-// <--
#include <map>
@@ -90,21 +90,17 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
}
pOutlineRule->SetRuleType( OUTLINE_RULE );
- // --> OD 2008-07-08 #i91400#
pOutlineRule->SetName( String::CreateFromAscii(
SwNumRule::GetOutlineRuleName() ),
*this);
- // <--
- // --> OD 2006-09-21 #i69522#
+
// assure that the outline numbering rule is an automatic rule
pOutlineRule->SetAutoRule( sal_True );
- // <--
// teste ob die evt. gesetzen CharFormate in diesem Document
// definiert sind
pOutlineRule->CheckCharFmts( this );
- // --> OD 2008-05-13 #refactorlists#
// notify text nodes, which are registered at the outline style, about the
// changed outline style
SwNumRule::tTxtNodeList aTxtNodeList;
@@ -114,16 +110,14 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
{
SwTxtNode* pTxtNd = *aIter;
pTxtNd->NumRuleChgd();
- // --> OD 2009-01-20 #i94152#
+
// assure that list level corresponds to outline level
if ( pTxtNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle() &&
pTxtNd->GetAttrListLevel() != pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() )
{
pTxtNd->SetAttrListLevel( pTxtNd->GetTxtColl()->GetAssignedOutlineStyleLevel() );
}
- // <--
}
- // <--
PropagateOutlineRule();
pOutlineRule->SetInvalidRule(sal_True);
@@ -144,20 +138,15 @@ void SwDoc::PropagateOutlineRule()
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
- // if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei
if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
SwClientIter aIter(*pColl);
- // --> OD 2006-11-20 #i71764#
// Check only the list style, which is set at the paragraph style
const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
- // <--
- // --> OD 2006-11-20 #i71764#
// Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
if ( rCollRuleItem.GetValue().Len() == 0 )
- // <--
{
SwNumRule * pMyOutlineRule = GetOutlineNumRule();
@@ -172,7 +161,7 @@ void SwDoc::PropagateOutlineRule()
}
}
- // Hoch-/Runterstufen
+// Hoch-/Runterstufen
sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
if( !GetNodes().GetOutLineNds().Count() || !nOffset )
@@ -204,9 +193,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
for( n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
- //sal_uInt8 nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nLevel < MAXLEVEL )
- // aCollArr[ nLevel ] = (*pTxtFmtCollTbl)[ n ];
if((*pTxtFmtCollTbl)[ n ]->IsAssignedToListLevelOfOutlineStyle())
{
const int nLevel = (*pTxtFmtCollTbl)[ n ]->GetAssignedOutlineStyleLevel();
@@ -214,7 +200,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}//<-end,zhaojianwei
}
- /* --> #111107# */
/* Find the last occupied level (backward). */
for (n = MAXLEVEL - 1; n > 0; n--)
{
@@ -235,7 +220,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
SwTxtFmtColl *aTmpColl =
GetTxtCollFromPool(static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + n));
- //if (aTmpColl->GetOutlineLevel() == n)//#outline level,zhaojianwei
if( aTmpColl->IsAssignedToListLevelOfOutlineStyle() &&
aTmpColl->GetAssignedOutlineStyleLevel() == n )//<-end,zhaojianwei
{
@@ -274,7 +258,6 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
}
}
}
- /* <-- #111107# */
/* --> #i13747#
@@ -346,16 +329,14 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
-// int nLevel = pColl->GetOutlineLevel();//#outline level,zhaojianwei
-// if (aMoveArr[nLevel] == -1)
-// bMoveApplicable = false;
+
if( pColl->IsAssignedToListLevelOfOutlineStyle() )
{
const int nLevel = pColl->GetAssignedOutlineStyleLevel();
if (aMoveArr[nLevel] == -1)
bMoveApplicable = false;
}//<-end,zhaojianwei
- // --> OD 2008-12-16 #i70748#
+
// Check on outline level attribute of text node, if text node is
// not an outline via a to outline style assigned paragraph style.
else
@@ -366,13 +347,11 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
bMoveApplicable = false;
}
}
- // <--
}
if (! bMoveApplicable )
return sal_False;
- /* <-- #i13747 # */
if (GetIDocumentUndoRedo().DoesUndo())
{
GetIDocumentUndoRedo().StartUndo(UNDO_OUTLINE_LR, NULL);
@@ -390,12 +369,9 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
if( pColl->IsAssignedToListLevelOfOutlineStyle() )
{
- // ASSERT(pColl->GetOutlineLevel() < MAXLEVEL, //#outline level,removed by zhaojianwei
- // "non outline node in outline nodes?");
- //int nLevel = pColl->GetOutlineLevel();
const int nLevel = pColl->GetAssignedOutlineStyleLevel();//#outline level,add by zhaojianwei
- ASSERT(aMoveArr[nLevel] >= 0,
+ OSL_ENSURE(aMoveArr[nLevel] >= 0,
"move table: current TxtColl not found when building table!");
@@ -430,9 +406,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
return sal_True;
}
-
-
- // Hoch-/Runter - Verschieben !
+// Hoch-/Runter - Verschieben !
sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
{
// kein Verschiebung in den Sonderbereichen
@@ -449,11 +423,9 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
sal_uInt16 nAktPos = 0;
SwNodeIndex aSttRg( rStt.nNode ), aEndRg( rEnd.nNode );
- //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<sal_uInt8>(((SwTxtNode*)pSrch)->GetOutlineLevel());
+
if( pSrch->IsTxtNode())
nOutLineLevel = static_cast<sal_uInt8>(((SwTxtNode*)pSrch)->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
SwNode* pEndSrch = &aEndRg.GetNode();
@@ -477,7 +449,6 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
{
if( !pEndSrch->IsTxtNode() || pEndSrch == pSrch ||
- //nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetOutlineLevel() )//#outline level,zhaojianwei
nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetAttrOutlineLevel()-1 )//<-end,zhaojianwei
++nTmpPos; // For sub outlines only!
}
@@ -489,7 +460,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
nAktPos = nTmpPos;
if( aEndRg == aSttRg )
{
- ASSERT( false, "Moving outlines: Surprising selection" );
+ OSL_ENSURE( false, "Moving outlines: Surprising selection" );
aEndRg++;
}
@@ -571,7 +542,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( pNd->FindTableNode() )
return sal_False;
- ASSERT( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
+ OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
"Position liegt im MoveBereich" );
// wurde ein Position in den Sonderbereichen errechnet, dann
@@ -585,7 +556,6 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
return MoveParagraph( aPam, nOffs, sal_True );
}
-
sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
sal_Bool bExact )
{
@@ -612,8 +582,6 @@ sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
return nSavePos;
}
-
-
sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
{
// Gueltig Nummern sind (immer nur Offsets!!!):
@@ -660,7 +628,7 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
// Gliederung:
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
// OS: ohne OutlineNodes lohnt die Suche nicht
- // und man spart sich einen Absturz #42958#
+ // und man spart sich einen Absturz
if(!rOutlNds.Count())
return USHRT_MAX;
SwTxtNode* pNd;
@@ -669,16 +637,12 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
for( ; nPos < rOutlNds.Count(); ++nPos )
{
pNd = rOutlNds[ nPos ]->GetTxtNode();
- //sal_uInt8 nLvl = pNd->GetTxtColl()->GetOutlineLevel(); //#outline level,zhaojianwei
const int nLvl = pNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
if( nLvl == nLevel - 1)
{
- // check for the outline num
- // --> OD 2005-11-02 #i51089 - TUNING#
- // --> OD 2006-09-22 #i68289#
+ // #i51089#, #i68289#
// Assure, that text node has the correct numbering level. Otherwise,
// its number vector will not fit to the searched level.
-// if ( pNd->GetNum() )
if ( pNd->GetNum() &&
pNd->GetActualListLevel() == ( nLevel - 1 ) )
// <--
@@ -698,12 +662,11 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
}
else
{
- // --> OD 2006-01-12 #126588#
// A text node, which has an outline paragraph style applied and
// has as hard attribute 'no numbering' set, has an outline level,
// but no numbering tree node. Thus, consider this situation in
// the assertion condition.
- ASSERT( !pNd->GetNumRule(),
+ OSL_ENSURE( !pNd->GetNumRule(),
"<lcl_FindOutlineNum(..)> - text node with outline level and numbering rule, but without numbering tree node. This is a serious defect -> inform OD" );
}
}
@@ -713,18 +676,16 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
return nPos;
}
- // zu diesem Gliederungspunkt
-
-
- // JP 13.06.96:
- // im Namen kann eine Nummer oder/und der Text stehen.
- // zuerst wird ueber die Nummer versucht den richtigen Eintrag zu finden.
- // Gibt es diesen, dann wird ueber den Text verglichen, od es der
- // gewuenschte ist. Ist das nicht der Fall, wird noch mal nur ueber den
- // Text gesucht. Wird dieser gefunden ist es der Eintrag. Ansonsten der,
- // der ueber die Nummer gefunden wurde.
- // Ist keine Nummer angegeben, dann nur den Text suchen.
+// zu diesem Gliederungspunkt
+// JP 13.06.96:
+// im Namen kann eine Nummer oder/und der Text stehen.
+// zuerst wird ueber die Nummer versucht den richtigen Eintrag zu finden.
+// Gibt es diesen, dann wird ueber den Text verglichen, od es der
+// gewuenschte ist. Ist das nicht der Fall, wird noch mal nur ueber den
+// Text gesucht. Wird dieser gefunden ist es der Eintrag. Ansonsten der,
+// der ueber die Nummer gefunden wurde.
+// Ist keine Nummer angegeben, dann nur den Text suchen.
sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
{
if( rName.Len() )
@@ -774,8 +735,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
return sal_True;
}
- // --> OD 2006-09-22 #i68289#
- // additional search on hyperlink URL without its outline numbering part
+ // #i68289# additional search on hyperlink URL without its outline numbering part
if ( !sName.Equals( rName ) )
{
nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, sal_False );
@@ -787,96 +747,14 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
return sal_True;
}
}
- // <--
}
return sal_False;
}
-/* */
-
-// --- Nummerierung -----------------------------------------
-
-// --> OD 2008-02-19 #refactorlists#
-//void SwNumRuleInfo::MakeList( SwDoc& rDoc, sal_Bool )
-//{
-// SwNumRule* pRule = rDoc.FindNumRulePtr(rName);
-
-// // no rule, no fun.
-// if ( !pRule )
-// return;
-
-// //
-// // 1. Case: Information already available at pRule:
-// //
-// if (pRule->GetTxtNodeList())
-// {
-// // copy list to own pList pointer:
-// aList = *pRule->GetTxtNodeList();
-// return;
-// }
-
-// //
-// // 2. Case: Information has to be generated from scratch:
-// //
-
-// if (pRule->IsOutlineRule())
-// {
-// const SwOutlineNodes & rOutlineNodes = rDoc.GetNodes().GetOutLineNds();
-
-// for (sal_uInt16 i = 0; i < rOutlineNodes.Count(); ++i)
-// {
-// SwTxtNode & aNode = *((SwTxtNode *) rOutlineNodes[i]);
-
-// if (pRule == aNode.GetNumRule())
-// AddNode(aNode);
-// }
-// }
-// {
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 i, nMaxItems = rDoc.GetAttrPool().GetItemCount
-// ( RES_PARATR_NUMRULE);
-// for( i = 0; i < nMaxItems; ++i )
-// {
-// pItem = rDoc.GetAttrPool().GetItem( RES_PARATR_NUMRULE, i );
-// if( 0 != pItem)
-// {
-// pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn();
-// if (0 != pMod &&
-// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rName )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// pMod->GetInfo( *this );
-// else
-// {
-// SwTxtNode* pModTxtNode = (SwTxtNode*)pMod;
-
-// // #115901#
-// if( pModTxtNode->GetNodes().IsDocNodes())
-// {
-// AddNode( *pModTxtNode );
-// }
-// }
-// }
-// }
-// }
-// }
-
-// // --> FME 2004-11-03 #i36571# The numrule and this info structure should
-// // have different instances of the list:
-// // --> OD 2006-09-12 #i69145#
-// // method <SwNumRule::SetList(..)> copies content of list provided by the parameter
-// pRule->SetTxtNodeList( aList );
-// // <--
-//}
-// <--
-
-
void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
{
SwNumRule* pOld = rDoc.FindNumRulePtr( rRule.GetName() );
- ASSERT( pOld, "ohne die alte NumRule geht gar nichts" );
+ OSL_ENSURE( pOld, "ohne die alte NumRule geht gar nichts" );
sal_uInt16 nChgFmtLevel = 0, nMask = 1;
sal_uInt8 n;
@@ -897,43 +775,18 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
if( !nChgFmtLevel ) // es wurde nichts veraendert?
{
- // --> OD 2006-04-27 #i64311#
const bool bInvalidateNumRule( pOld->IsContinusNum() != rRule.IsContinusNum() );
- // <--
pOld->CheckCharFmts( &rDoc );
pOld->SetContinusNum( rRule.IsContinusNum() );
- // --> OD 2008-06-17 #i87166#
- // Do NOT change list style type
-// pOld->SetRuleType( rRule.GetRuleType() );
- // <--
- // --> OD 2006-04-27 #i64311#
+
if ( bInvalidateNumRule )
{
pOld->SetInvalidRule(sal_True);
}
- // <--
+
return ;
}
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo* pUpd = new SwNumRuleInfo( rRule.GetName() );
-// pUpd->MakeList( rDoc );
-
-// sal_uInt8 nLvl;
-// for( sal_uLong nFirst = 0, nLast = pUpd->GetList().Count();
-// nFirst < nLast; ++nFirst )
-// {
-// SwTxtNode* pTxtNd = pUpd->GetList().GetObject( nFirst );
-// nLvl = static_cast<sal_uInt8>(pTxtNd->GetLevel());
-
-// if( nLvl < MAXLEVEL )
-// {
-// if( nChgFmtLevel & ( 1 << nLvl ))
-// {
-// pTxtNd->NumRuleChgd();
-// }
-// }
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
pOld->GetTxtNodeList( aTxtNodeList );
sal_uInt8 nLvl( 0 );
@@ -951,7 +804,6 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
}
}
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
if( nChgFmtLevel & ( 1 << n ))
@@ -960,20 +812,10 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
pOld->CheckCharFmts( &rDoc );
pOld->SetInvalidRule(sal_True);
pOld->SetContinusNum( rRule.IsContinusNum() );
- // --> OD 2008-06-17 #i87166#
- // Do NOT change list style type
-// pOld->SetRuleType( rRule.GetRuleType() );
- // <--
-
- // --> OD 2008-02-19 #refactorlists#
-// delete pUpd;
- // <--
rDoc.UpdateNumRule();
}
-// OD 2008-02-08 #newlistlevelattrs# - add handling of parameter <bResetIndentAttrs>
-// --> OD 2008-03-17 #refactorlists#
void SwDoc::SetNumRule( const SwPaM& rPam,
const SwNumRule& rRule,
const bool bCreateNewList,
@@ -1016,7 +858,6 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
- // --> OD 2008-03-17 #refactorlists#
if ( bSetItem )
{
if ( bCreateNewList )
@@ -1031,7 +872,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
{
// create new list and apply its list id
SwList* pNewList = createList( String(), pNew->GetName() );
- ASSERT( pNewList,
+ OSL_ENSURE( pNewList,
"<SwDoc::SetNumRule(..)> - could not create new list. Serious defect -> please inform OD." );
sListId = pNewList->GetListId();
}
@@ -1045,12 +886,10 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
}
}
- // <--
if ( ! rPam.HasMark())
{
SwTxtNode * pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
- // --> OD 2006-10-19 #134160#
// consider case that the PaM doesn't denote a text node - e.g. it denotes a graphic node
if ( pTxtNd )
{
@@ -1059,15 +898,14 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
if (pRule && pRule->GetName() == pNew->GetName())
{
bSetItem = sal_False;
- // --> OD 2008-06-02 #refactorlists#
+
if ( !pTxtNd->IsInList() )
{
pTxtNd->AddToList();
}
- // <--
}
- // --> OD 2005-10-26 #b6340308# - only clear numbering attribute at
- // text node, if at paragraph style the new numbering rule is found.
+ // Only clear numbering attribute at text node, if at paragraph
+ // style the new numbering rule is found.
else if ( !pRule )
{
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
@@ -1081,19 +919,14 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
}
}
- // <--
}
- // <--
}
- // --> OD 2009-08-18 #i103817#
if ( bSetItem )
- // <--
{
InsertPoolItem( rPam, SwNumRuleItem( pNew->GetName() ), 0 );
}
- // --> OD 2008-02-08 #newlistlevelattrs#
if ( bResetIndentAttrs &&
pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
@@ -1117,7 +950,6 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
}
// <--
}
- // <--
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1186,19 +1018,6 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
if (pTxtNd)
{
- // --> OD 2008-02-27 #refactorlists#
-// const SwNumRule* pRule = pTxtNd->GetNumRule();
-// if( pRule && nStt != pTxtNd->GetListRestartValue() )
-// {
-// if( DoesUndo() )
-// {
-// ClearRedo();
-// AppendUndo( new SwUndoNumRuleStart( rPos, nStt ));
-// }
-// }
-// pTxtNd->SetListRestartValue(nStt);
-
-// SetModified();
if ( !pTxtNd->HasAttrListRestartValue() ||
pTxtNd->GetAttrListRestartValue() != nStt )
{
@@ -1211,23 +1030,20 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
SetModified();
}
- // <--
}
}
- // loeschen geht nur, wenn die Rule niemand benutzt!
+// loeschen geht nur, wenn die Rule niemand benutzt!
sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
{
sal_uInt16 nPos = FindNumRule( rName );
- // --> OD 2007-12-17 #151213#
if ( (*pNumRuleTbl)[ nPos ] == GetOutlineNumRule() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect - please inform OD" );
return sal_False;
}
- // <--
if( USHRT_MAX != nPos && !IsUsed( *(*pNumRuleTbl)[ nPos ] ))
{
@@ -1242,7 +1058,6 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PSEUDO,
SFX_STYLESHEET_ERASED);
- // --> OD 2008-04-02 #refactorlists#
deleteListForListStyle( rName );
{
// delete further list, which have the deleted list style as default list style
@@ -1265,7 +1080,6 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
deleteList( pList->GetListId() );
}
}
- // <--
// --> FME 2004-11-02 #i34097# DeleteAndDestroy deletes rName if
// rName is directly taken from the numrule.
const String aTmpName( rName );
@@ -1279,10 +1093,8 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
return sal_False;
}
-// #106897#
void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName )
{
- // #106897#
SwNumRule* pRule = FindNumRulePtr( pName ? *pName : rRule.GetName() );
if( pRule )
{
@@ -1316,31 +1128,19 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo aInfo(rOldName);
-// aInfo.MakeList(*this);
SwNumRule::tTxtNodeList aTxtNodeList;
pNumRule->GetTxtNodeList( aTxtNodeList );
- // <--
- // --> OD 2008-07-08 #i91400#
pNumRule->SetName( rNewName, *this );
- // <--
SwNumRuleItem aItem(rNewName);
- // --> OD 2008-02-19 #refactorlists#
-// for (sal_uLong nI = 0; nI < aInfo.GetList().Count(); ++nI)
-// {
-// SwTxtNode * pTxtNd = aInfo.GetList().GetObject(nI);
-// pTxtNd->SwCntntNode::SetAttr(aItem);
-// }
+
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
aIter != aTxtNodeList.end(); ++aIter )
{
SwTxtNode * pTxtNd = *aIter;
pTxtNd->SetAttr(aItem);
}
- // <--
bResult = sal_True;
@@ -1356,20 +1156,6 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
{
for( sal_uInt16 n = GetNumRuleTbl().Count(); n; )
{
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo aUpd( GetNumRuleTbl()[ --n ]->GetName() );
-// aUpd.MakeList( *this );
-
-// for( sal_uLong nFirst = 0, nLast = aUpd.GetList().Count();
-// nFirst < nLast; ++nFirst )
-// {
-// SwTxtNode* pTNd = aUpd.GetList().GetObject( nFirst );
-// SwClientIter aIter( *pTNd );
-// for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
-// pFrm; pFrm = (SwFrm*)aIter.Next() )
-// if( ((SwTxtFrm*)pFrm)->HasAnimation() )
-// ((SwTxtFrm*)pFrm)->StopAnimation( pOut );
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin();
@@ -1382,7 +1168,6 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
if( ((SwTxtFrm*)pFrm)->HasAnimation() )
((SwTxtFrm*)pFrm)->StopAnimation( pOut );
}
- // <--
}
}
@@ -1394,7 +1179,6 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
*pNewRule = FindNumRulePtr( rNewRule );
if( pOldRule && pNewRule && pOldRule != pNewRule )
{
- // --> OD 2008-02-19 #refactorlists#
SwUndoInsNum* pUndo = 0;
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -1404,48 +1188,10 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- // --> OD 2008-02-19 #refactorlists#
- // apply new list style <pNewRule> to all text nodes, which have the
- // old list style <pOldNRule> applied and belong to the same list as
- // the text node of the given <SwPosition>.
-// SwNumRuleInfo aUpd( rOldRule );
-// aUpd.MakeList( *this );
-
-// if (aUpd.GetList().Count() > 0) // #106897#
SwNumRule::tTxtNodeList aTxtNodeList;
pOldRule->GetTxtNodeList( aTxtNodeList );
if ( aTxtNodeList.size() > 0 )
{
-// // Position suchen und bestimme ob ein Node davor oder dahinter
-// // einen Start erzwingt
-// SwTxtNode* pTxtNd;
-// sal_uLong nFndPos, nFirst, nLast;
-
-// if( TABLE_ENTRY_NOTFOUND != aUpd.GetList().SearchKey(
-// rPos.nNode.GetIndex(), &nFndPos ))
-// ++nFndPos;
-
-// for( nLast = nFndPos; nLast < aUpd.GetList().Count(); ++nLast )
-// {
-// pTxtNd = aUpd.GetList().GetObject( nLast );
-// if(pTxtNd->IsRestart())
-// break;
-// }
-// for( nFirst = nFndPos; nFirst; )
-// {
-// pTxtNd = aUpd.GetList().GetObject( --nFirst );
-// if( pTxtNd->IsRestart() )
-// break;
-// }
-// // dann neue Numerierung ueber diesen Bereich
-// // definieren und den Start am Anfang/Ende zurueck setzen
-// pTxtNd = aUpd.GetList().GetObject( nFirst );
-// if( pTxtNd->IsRestart() )
-// {
-// pTxtNd->SetRestart(false);
-// if( pUndo )
-// pUndo->SetSttNum( pTxtNd->GetIndex() );
-// }
SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 );
sal_uInt16 nChgFmtLevel = 0;
@@ -1461,15 +1207,7 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
const SwTxtNode* pGivenTxtNode = rPos.nNode.GetNode().GetTxtNode();
SwNumRuleItem aRule( rNewRule );
-// for( ; nFirst < nLast; ++nFirst )
-// {
-// pTxtNd = aUpd.GetList().GetObject( nFirst );
-// aRegH.RegisterInModify( pTxtNd, *pTxtNd );
-
-// pTxtNd->SwCntntNode::SetAttr( aRule );
-// pTxtNd->NumRuleChgd();
-// }
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
aIter != aTxtNodeList.end(); ++aIter )
{
@@ -1487,14 +1225,13 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos,
GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
- bRet = sal_True; // #106897#
+ bRet = sal_True;
}
}
return bRet;
}
-// --> OD 2008-03-18 #refactorlists#
namespace
{
struct ListStyleData
@@ -1510,16 +1247,12 @@ namespace
{}
};
}
-// <--
void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
{
- ASSERT( rPaM.GetDoc() == this, "need same doc" );
+ OSL_ENSURE( rPaM.GetDoc() == this, "need same doc" );
- // --> OD 2008-03-18 #refactorlists#
-// map<SwNumRule *, SwNumRule *> aMyNumRuleMap;
::std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
- // <--
sal_uLong nStt = rPaM.Start()->nNode.GetIndex();
sal_uLong nEnd = rPaM.End()->nNode.GetIndex();
@@ -1536,11 +1269,8 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
if (pRule && pRule->IsAutoRule() && ! pRule->IsOutlineRule())
{
- // --> OD 2008-03-18 #refactorlists#
-// SwNumRule * pReplaceNumRule = aMyNumRuleMap[pRule];
ListStyleData aListStyleData = aMyNumRuleMap[pRule];
-// if (! pReplaceNumRule)
if ( aListStyleData.pReplaceNumRule == 0 )
{
if (bFirst)
@@ -1553,20 +1283,16 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
aListStyleData.sListId, true ));
}
-// if (! pReplaceNumRule)
if ( aListStyleData.pReplaceNumRule == 0 )
{
-// pReplaceNumRule = new SwNumRule(*pRule);
-// pReplaceNumRule->SetName(GetUniqueNumRuleName());
aListStyleData.pReplaceNumRule = new SwNumRule(*pRule);
- // --> OD 2008-07-08 #i91400#
+
aListStyleData.pReplaceNumRule->SetName(
GetUniqueNumRuleName(), *this );
- // <--
+
aListStyleData.bCreateNewList = true;
}
-// aMyNumRuleMap[pRule] = pReplaceNumRule;
aMyNumRuleMap[pRule] = aListStyleData;
}
@@ -1637,13 +1363,8 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
for( ; nStt <= nEnd; ++nStt )
{
SwTxtNode* pTNd = GetNodes()[ nStt ]->GetTxtNode();
- // --> OD 2008-03-13 #refactorlists#
-// if( pTNd && 0 != ( pItem = pTNd->GetNoCondAttr(
-// RES_PARATR_NUMRULE, sal_True ) ) &&
-// ( pName = &((SwNumRuleItem*)pItem)->GetValue())->Len() )
SwNumRule* pNumRuleOfTxtNode = pTNd ? pTNd->GetNumRule() : 0;
if ( pTNd && pNumRuleOfTxtNode )
- // <--
{
// recognize changes of attribute for undo
aRegH.RegisterInModify( pTNd, *pTNd );
@@ -1660,18 +1381,15 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
else
pTNd->SetAttr( aEmptyRule );
- // --> OD 2008-03-26 #refactorlists#
pTNd->ResetAttr( RES_PARATR_LIST_ID );
pTNd->ResetAttr( RES_PARATR_LIST_LEVEL );
pTNd->ResetAttr( RES_PARATR_LIST_ISRESTART );
pTNd->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
pTNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
- // <--
if( RES_CONDTXTFMTCOLL == pTNd->GetFmtColl()->Which() )
pTNd->ChkCondColl();
- //else if( !pOutlNd && NO_NUMBERING != //#outline level,zhaojianwei
- // ((SwTxtFmtColl*)pTNd->GetFmtColl())->GetOutlineLevel() )
+
else if( !pOutlNd &&
((SwTxtFmtColl*)pTNd->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle() )//<-end,zhaojianwei
pOutlNd = pTNd;
@@ -1691,15 +1409,12 @@ void SwDoc::InvalidateNumRules()
(*pNumRuleTbl)[n]->SetInvalidRule(sal_True);
}
- // zum naechsten/vorhergehenden Punkt auf gleicher Ebene
-
+// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
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,
+ OSL_ENSURE( nNumber < MAXLEVEL,
"<lcl_IsNumOk(..)> - misusage of method" );
- // <--
sal_Bool bRet = sal_False;
{
@@ -1851,8 +1566,6 @@ sal_Bool SwDoc::GotoNextNum( SwPosition& rPos, sal_Bool bOverUpper,
return ::lcl_GotoNextPrevNum( rPos, sal_True, bOverUpper, pUpper, pLower );
}
-// -> #i23731#
-// --> OD 2008-03-18 #refactorlists# - add output parameter <sListId>
const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
const bool bForward,
const bool bNum,
@@ -1869,12 +1582,10 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
{
SwNodeIndex aIdx(rPos.nNode);
- // --> OD 2005-10-20 #i55391#
// - the start node has also been investigated, if requested.
const SwNode * pNode = NULL;
do
{
- // --> OD 2005-10-20 #i55391#
if ( !bInvestigateStartNode )
{
if (bForward)
@@ -1882,7 +1593,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
else
aIdx--;
}
- // <--
+
if (aIdx.GetNode().IsTxtNode())
{
pTxtNd = aIdx.GetNode().GetTxtNode();
@@ -1890,12 +1601,11 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
const SwNumRule * pNumRule = pTxtNd->GetNumRule();
if (pNumRule)
{
- if ( ( pNumRule->IsOutlineRule() == ( bOutline ? sal_True : sal_False ) ) && // #115901#
+ if ( ( pNumRule->IsOutlineRule() == ( bOutline ? sal_True : sal_False ) ) &&
( ( bNum && pNumRule->Get(0).IsEnumeration()) ||
( !bNum && pNumRule->Get(0).IsItemize() ) ) ) // #i22362#, #i29560#
{
pResult = pTxtNd->GetNumRule();
- // --> OD 2008-03-18 #refactorlists#
// provide also the list id, to which the text node belongs.
sListId = pTxtNd->GetListId();
}
@@ -1914,7 +1624,6 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
}
}
- // --> OD 2005-10-20 #i55391#
if ( bInvestigateStartNode )
{
if (bForward)
@@ -1922,18 +1631,16 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
else
aIdx--;
}
- // <--
pNode = &aIdx.GetNode();
}
while (!(pNode == GetNodes().DocumentSectionStartNode(pStartFromNode) ||
pNode == GetNodes().DocumentSectionEndNode(pStartFromNode)));
- // <--
}
return pResult;
}
-// <- #i23731#
+
sal_Bool SwDoc::GotoPrevNum( SwPosition& rPos, sal_Bool bOverUpper,
sal_uInt8* pUpper, sal_uInt8* pLower )
@@ -1950,7 +1657,7 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
sal_uLong nTmp = nStt; nStt = nEnd; nEnd = nTmp;
}
- // -> #115901# outline nodes are promoted or demoted differently
+ // -> outline nodes are promoted or demoted differently
bool bOnlyOutline = true;
bool bOnlyNonOutline = true;
for (sal_uLong n = nStt; n <= nEnd; n++)
@@ -1970,17 +1677,15 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
}
}
}
- // <- #115901#
sal_Bool bRet = sal_True;
char nDiff = bDown ? 1 : -1;
- // ->#115901#
if (bOnlyOutline)
bRet = OutlineUpDown(rPam, nDiff);
else if (bOnlyNonOutline)
{
- /* --> #i24560#
+ /* #i24560#
Only promote or demote if all selected paragraphs are
promotable resp. demotable.
@@ -1990,8 +1695,8 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
{
SwTxtNode* pTNd = GetNodes()[ nTmp ]->GetTxtNode();
- // --> OD 2006-10-19 #134160# - make code robust:
- // consider case that the node doesn't denote a text node.
+ // Make code robust: consider case that the node doesn't denote a
+ // text node.
if ( pTNd )
{
SwNumRule * pRule = pTNd->GetNumRule();
@@ -2004,12 +1709,10 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown )
bRet = sal_False;
}
}
- // <--
}
if( bRet )
{
- /* <-- #i24560# */
if (GetIDocumentUndoRedo().DoesUndo())
{
SwUndo *const pUndo( new SwUndoNumUpDown(rPam, nDiff) );
@@ -2254,7 +1957,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
sal_Bool bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode();
- /* #101076# When copying to a non-content node Copy will
+ /* When copying to a non-content node Copy will
insert a paragraph before that node and insert before
that inserted node. Copy creates an SwUndoInserts that
does not cover the extra paragraph. Thus we insert the
@@ -2266,7 +1969,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
the previous content node. */
SwPaM aInsPam(aInsPos);
sal_Bool bMoved = aInsPam.Move(fnMoveBackward);
- ASSERT(bMoved, "No content node found!");
+ OSL_ENSURE(bMoved, "No content node found!");
if (bMoved)
{
@@ -2326,7 +2029,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
SwRedline* pNewRedline = new SwRedline( nsRedlineType_t::REDLINE_DELETE, aPam );
- // #101654# prevent assertion from aPam's target being deleted
+ // 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(sal_True).nContent.Assign( NULL, 0 );
@@ -2447,9 +2150,6 @@ SwNumRule* SwDoc::GetCurrNumRule( const SwPosition& rPos ) const
if( pTNd )
{
- // --> OD 2008-02-20 #refactorlists#
-// pTNd->SyncNumberAndNumRule();
- // <--
pRet = pTNd->GetNumRule();
}
@@ -2487,19 +2187,15 @@ SwNumRule* SwDoc::FindNumRulePtr( const String& rName ) const
return pResult;
}
-// #i36749#
void SwDoc::AddNumRule(SwNumRule * pRule)
{
pNumRuleTbl->Insert(pRule, pNumRuleTbl->Count());
maNumRuleMap[pRule->GetName()] = pRule;
pRule->SetNumRuleMap(&maNumRuleMap);
- // --> OD 2008-03-26 #refactorlists#
createListForListStyle( pRule->GetName() );
- // <--
}
-// --> OD 2008-02-11 #newlistlevelattrs#
sal_uInt16 SwDoc::MakeNumRule( const String &rName,
const SwNumRule* pCpy,
sal_Bool bBroadcast,
@@ -2510,31 +2206,26 @@ sal_uInt16 SwDoc::MakeNumRule( const String &rName,
{
pNew = new SwNumRule( *pCpy );
- // --> OD 2008-07-08 #i91400#
pNew->SetName( GetUniqueNumRuleName( &rName ), *this );
- // <--
+
if( pNew->GetName() != rName )
{
pNew->SetPoolFmtId( USHRT_MAX );
pNew->SetPoolHelpId( USHRT_MAX );
pNew->SetPoolHlpFileId( UCHAR_MAX );
- // --> OD 2008-04-03 #refactorlists#
pNew->SetDefaultListId( String() );
- // <--
}
pNew->CheckCharFmts( this );
}
else
{
- // --> OD 2008-02-11 #newlistlevelattrs#
pNew = new SwNumRule( GetUniqueNumRuleName( &rName ),
eDefaultNumberFormatPositionAndSpaceMode );
- // <--
}
sal_uInt16 nRet = pNumRuleTbl->Count();
- AddNumRule(pNew); // #i36749#
+ AddNumRule(pNew);
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -2633,7 +2324,6 @@ void SwDoc::UpdateNumRule()
rNmTbl[ n ]->Validate();
}
-// --> OD 2008-04-02 #refactorlists#
void SwDoc::MarkListLevel( const String& sListId,
const int nListLevel,
const sal_Bool bValue )
@@ -2653,10 +2343,7 @@ void SwDoc::MarkListLevel( SwList& rList,
// Set new marked list level and notify all affected nodes of the changed mark.
rList.MarkListLevel( nListLevel, bValue );
}
-// <- #i27615#
-// <--
-// #i23726#
sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos)
{
sal_Bool bResult = sal_False;
@@ -2673,7 +2360,6 @@ sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos)
return bResult;
}
-// --> OD 2007-10-26 #i83479#
// implementation for interface <IDocumentListItems>
bool SwDoc::lessThanNodeNum::operator()( const SwNodeNum* pNodeNumOne,
const SwNodeNum* pNodeNumTwo ) const
@@ -2690,7 +2376,7 @@ void SwDoc::addListItem( const SwNodeNum& rNodeNum )
const bool bAlreadyInserted(
mpListItemsList->find( &rNodeNum ) != mpListItemsList->end() );
- ASSERT( !bAlreadyInserted,
+ OSL_ENSURE( !bAlreadyInserted,
"<SwDoc::InsertListItem(..)> - <SwNodeNum> instance already registered as numbered item!" );
if ( !bAlreadyInserted )
{
@@ -2708,7 +2394,7 @@ void SwDoc::removeListItem( const SwNodeNum& rNodeNum )
const tImplSortedNodeNumList::size_type nDeleted = mpListItemsList->erase( &rNodeNum );
if ( nDeleted > 1 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::RemoveListItem(..)> - <SwNodeNum> was registered more than once as numbered item!" );
}
}
@@ -2753,9 +2439,7 @@ void SwDoc::getNumItems( tSortedNodeNumList& orNodeNumList ) const
}
}
}
-// <--
-// --> OD 2007-11-15 #i83479#
// implementation for interface <IDocumentOutlineNodes>
sal_Int32 SwDoc::getOutlineNodesCount() const
{
@@ -2795,9 +2479,7 @@ void SwDoc::getOutlineNodes( IDocumentOutlineNodes::tSortedOutlineNodeList& orOu
GetNodes().GetOutLineNds()[i]->GetTxtNode() );
}
}
-// <--
-// --> OD 2008-03-26 #refactorlists#
// implementation of interface IDocumentListsAccess
SwList* SwDoc::createList( String sListId,
const String sDefaultListStyleName )
@@ -2809,7 +2491,7 @@ SwList* SwDoc::createList( String sListId,
if ( getListByName( sListId ) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::createList(..)> - provided list id already used. Serious defect -> please inform OD." );
return 0;
}
@@ -2817,7 +2499,7 @@ SwList* SwDoc::createList( String sListId,
SwNumRule* pDefaultNumRuleForNewList = FindNumRulePtr( sDefaultListStyleName );
if ( !pDefaultNumRuleForNewList )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::createList(..)> - for provided default list style name no list style is found. Serious defect -> please inform OD." );
return 0;
}
@@ -2842,7 +2524,7 @@ SwList* SwDoc::getListByName( const String sListId ) const
{
SwList* pList = 0;
- std::hash_map< String, SwList*, StringHash >::const_iterator
+ boost::unordered_map< String, SwList*, StringHash >::const_iterator
aListIter = maLists.find( sListId );
if ( aListIter != maLists.end() )
{
@@ -2856,14 +2538,14 @@ SwList* SwDoc::createListForListStyle( const String sListStyleName )
{
if ( sListStyleName.Len() == 0 )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::createListForListStyle(..)> - no list style name provided. Serious defect -> please inform OD." );
return 0;
}
if ( getListForListStyle( sListStyleName ) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::createListForListStyle(..)> - a list for the provided list style name already exists. Serious defect -> please inform OD." );
return 0;
}
@@ -2871,7 +2553,7 @@ SwList* SwDoc::createListForListStyle( const String sListStyleName )
SwNumRule* pNumRule = FindNumRulePtr( sListStyleName );
if ( !pNumRule )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::createListForListStyle(..)> - for provided list style name no list style is found. Serious defect -> please inform OD." );
return 0;
}
@@ -2892,7 +2574,7 @@ SwList* SwDoc::getListForListStyle( const String sListStyleName ) const
{
SwList* pList = 0;
- std::hash_map< String, SwList*, StringHash >::const_iterator
+ boost::unordered_map< String, SwList*, StringHash >::const_iterator
aListIter = maListStyleLists.find( sListStyleName );
if ( aListIter != maListStyleLists.end() )
{
@@ -2907,7 +2589,7 @@ void SwDoc::deleteListForListStyle( const String sListStyleName )
String sListId;
{
SwList* pList = getListForListStyle( sListStyleName );
- ASSERT( pList,
+ OSL_ENSURE( pList,
"<SwDoc::deleteListForListStyle(..)> - misusage of method: no list found for given list style name" );
if ( pList )
{
@@ -2920,13 +2602,12 @@ void SwDoc::deleteListForListStyle( const String sListStyleName )
deleteList( sListId );
}
}
-// <--
-// --> OD 2008-07-08 #i91400#
+
void SwDoc::trackChangeOfListStyleName( const String sListStyleName,
const String sNewListStyleName )
{
SwList* pList = getListForListStyle( sListStyleName );
- ASSERT( pList,
+ OSL_ENSURE( pList,
"<SwDoc::changeOfListStyleName(..)> - misusage of method: no list found for given list style name" );
if ( pList != 0 )
@@ -2935,9 +2616,7 @@ void SwDoc::trackChangeOfListStyleName( const String sListStyleName,
maListStyleLists[sNewListStyleName] = pList;
}
}
-// <--
-// --> OD 2008-03-13 #refactorlists#
namespace listfunc
{
const String MakeListIdUnique( const SwDoc& rDoc,
@@ -2956,17 +2635,16 @@ namespace listfunc
}
const String CreateUniqueListId( const SwDoc& rDoc )
{
- // --> OD 2008-08-06 #i92478#
+ // #i92478#
String aNewListId = String::CreateFromAscii( "list" );
- // <--
sal_Int64 n = Time().GetTime();
n += Date().GetDate();
n += rand();
- // --> OD 2008-08-06 #i92478#
+ // #i92478#
aNewListId += String::CreateFromInt64( n );
- // <--
return MakeListIdUnique( rDoc, aNewListId );
}
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index d18d2166dd96..e409ec3462d8 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,14 +58,9 @@ using namespace com::sun::star;
TYPEINIT1(SwRedlineHint, SfxHint);
-#ifndef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
- #define _CHECK_REDLINE( pDoc )
- #define _DEBUG_REDLINE( pDoc )
-
-#else
-
-#define _ERROR_PREFIX "redline table corrupted: "
+ #define _ERROR_PREFIX "redline table corrupted: "
// helper function for lcl_CheckRedline
// 1. make sure that pPos->nContent points into pPos->nNode
@@ -154,6 +150,12 @@ TYPEINIT1(SwRedlineHint, SfxHint);
#define _DEBUG_REDLINE( pDoc ) lcl_DebugRedline( pDoc );
+
+#else
+
+ #define _CHECK_REDLINE( pDoc )
+ #define _DEBUG_REDLINE( pDoc )
+
#endif
SV_IMPL_OP_PTRARR_SORT( _SwRedlineTbl, SwRedlinePtr )
@@ -307,10 +309,6 @@ Verhalten von Delete-Redline:
bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
-#if 0
-// #i93179# disabled: ASSERT in ~SwIndexReg #ifdef DBG_UTIL
- SwRedline aCopy( *pNewRedl );
-#endif
bool bError = true;
_CHECK_REDLINE( this )
@@ -384,9 +382,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
for( ; pNewRedl && n < pRedlineTbl->Count(); bDec ? n : ++n )
{
bDec = false;
-#ifdef DVO_TEST
- _CHECK_REDLINE( this )
-#endif
SwRedline* pRedl = (*pRedlineTbl)[ n ];
SwPosition* pRStt = pRedl->Start(),
@@ -452,12 +447,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #107164# own insert-over-insert
- // redlines: just scrap the inside ones
+ // own insert-over-insert redlines:
+ // just scrap the inside ones
pRedlineTbl->Remove( n );
bDec = true;
}
- // <- #107164#
+ // <--
else if( POS_OVERLAP_BEHIND == eCmpPos )
{
*pStt = *pREnd;
@@ -506,8 +501,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #102366# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
// split up the new redline, since it covers the
// existing redline. Insert the first part, and
@@ -525,14 +519,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OVERLAP_BEHIND == eCmpPos )
{
- // #107164# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
pNewRedl->SetStart( *pREnd );
}
else if ( POS_OVERLAP_BEFORE == eCmpPos )
{
- // #107164# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
*pEnd = *pRStt;
if( ( *pStt == *pEnd ) &&
( pNewRedl->GetContentIdx() == NULL ) )
@@ -569,8 +561,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_OUTSIDE == eCmpPos )
{
- // #102366# handle overlapping redlines in broken
- // documents
+ // handle overlapping redlines in broken documents
// split up the new redline, since it covers the
// existing redline. Insert the first part, and
@@ -588,13 +579,13 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
}
else if ( POS_EQUAL == eCmpPos )
{
- // #112895# handle identical redlines in broken
- // documents - delete old (delete) redline
+ // handle identical redlines in broken documents
+ // delete old (delete) redline
pRedlineTbl->DeleteAndDestroy( n );
bDec = true;
}
else if ( POS_OVERLAP_BEHIND == eCmpPos )
- { // Another workaround for broken redlines (#107164#)
+ { // Another workaround for broken redlines
pNewRedl->SetStart( *pREnd );
}
break;
@@ -709,7 +700,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_COLLIDE_START:
case POS_COLLIDE_END:
if( pRedl->IsOwnRedline( *pNewRedl ) &&
-// 1 == pRedl->GetStackCount() &&
pRedl->CanCombine( *pNewRedl ) )
{
if( IsHideChanges( eRedlineMode ))
@@ -738,8 +728,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
sal_uInt16 nToBeDeleted = n;
bDec = true;
- // #107359# Do it again, Sam!
- // If you can do it for them, you can do it for me.
if( *(pNewRedl->Start()) <= *pREnd )
{
// Whoooah, we just extended the new 'redline'
@@ -786,7 +774,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
eRedlineMode = (RedlineMode_t)(eRedlineMode | nsRedlineMode_t::REDLINE_IGNOREDELETE_REDLINES);
- // #98863# DeleteAndJoin does not yield the
+ // DeleteAndJoin does not yield the
// desired result if there is no paragraph to
// join with, i.e. at the end of the document.
// For this case, we completely delete the
@@ -1030,14 +1018,12 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
// insert the pNew part (if it exists)
if( pNew )
{
- // AppendRedline( pNew, bCallDelete );
- //sal_Bool bRet =
pRedlineTbl->Insert( pNew );
// pNew must be deleted if Insert() wasn't
// successful. But that can't happen, since pNew is
// part of the original pRedl redline.
- // ASSERT( bRet, "Can't insert existing redline?" );
+ // OSL_ENSURE( bRet, "Can't insert existing redline?" );
// restart (now with pRedl being split up)
n = 0;
@@ -1567,13 +1553,33 @@ const SwRedline* SwDoc::GetRedline( const SwPosition& rPos,
? *pStt == rPos
: ( *pStt <= rPos && rPos < *pEnd ) )
{
- /* #107318# returned wrong redline ???*/
while( nM && rPos == *(*pRedlineTbl)[ nM - 1 ]->End() &&
rPos == *(*pRedlineTbl)[ nM - 1 ]->Start() )
{
--nM;
pRedl = (*pRedlineTbl)[ nM ];
}
+ // if there are format and insert changes in the same position
+ // show insert change first.
+ // since the redlines are sorted by position, only check the redline
+ // before and after the current redline
+ if( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
+ {
+ if( nM && rPos >= *(*pRedlineTbl)[ nM - 1 ]->Start() &&
+ rPos <= *(*pRedlineTbl)[ nM - 1 ]->End() &&
+ ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM - 1 ]->GetType() ) )
+ {
+ --nM;
+ pRedl = (*pRedlineTbl)[ nM ];
+ }
+ else if( ( nM + 1 ) <= nO && rPos >= *(*pRedlineTbl)[ nM + 1 ]->Start() &&
+ rPos <= *(*pRedlineTbl)[ nM + 1 ]->End() &&
+ ( nsRedlineType_t::REDLINE_INSERT == (*pRedlineTbl)[ nM + 1 ]->GetType() ) )
+ {
+ ++nM;
+ pRedl = (*pRedlineTbl)[ nM ];
+ }
+ }
if( pFndPos )
*pFndPos = nM;
@@ -1994,13 +2000,12 @@ const SwRedline* lcl_FindCurrRedline( const SwPosition& rSttPos,
return pFnd;
}
-// #111827#
int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
SwRedlineTbl& rArr, sal_Bool bCallDelete,
const SwPaM& rPam)
{
sal_uInt16 n = 0;
- int nCount = 0; // #111827#
+ int nCount = 0;
const SwPosition* pStt = rPam.Start(),
* pEnd = pStt == rPam.GetPoint() ? rPam.GetMark()
@@ -2011,7 +2016,7 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
{
// dann nur die TeilSelektion aufheben
if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
- nCount++; // #111827#
+ nCount++;
++n;
}
@@ -2023,7 +2028,7 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
if( *pTmp->End() <= *pEnd )
{
if( (*fn_AcceptReject)( rArr, n, bCallDelete, 0, 0 ))
- nCount++; // #111827#
+ nCount++;
}
else
{
@@ -2031,13 +2036,13 @@ int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject,
{
// dann nur in der TeilSelektion aufheben
if( (*fn_AcceptReject)( rArr, n, bCallDelete, pStt, pEnd ))
- nCount++; // #111827#
+ nCount++;
}
break;
}
}
}
- return nCount; // #111827#
+ return nCount;
}
void lcl_AdjustRedlineRange( SwPaM& rPam )
@@ -2091,7 +2096,6 @@ bool SwDoc::AcceptRedline( sal_uInt16 nPos, bool bCallDelete )
{
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
@@ -2163,7 +2167,6 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
GetIDocumentUndoRedo().AppendUndo( new SwUndoAcceptRedline( aPam ));
}
- // #111827#
int nRet = lcl_AcceptRejectRedl( lcl_AcceptRedline, *pRedlineTbl,
bCallDelete, aPam );
if( nRet > 0 )
@@ -2173,7 +2176,6 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete )
}
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
String aTmpStr;
{
@@ -2204,7 +2206,6 @@ bool SwDoc::RejectRedline( sal_uInt16 nPos, bool bCallDelete )
{
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, pTmp->GetDescr());
@@ -2276,7 +2277,6 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
GetIDocumentUndoRedo().AppendUndo( new SwUndoRejectRedline(aPam) );
}
- // #111827#
int nRet = lcl_AcceptRejectRedl( lcl_RejectRedline, *pRedlineTbl,
bCallDelete, aPam );
if( nRet > 0 )
@@ -2286,7 +2286,6 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete )
}
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #111827#
String aTmpStr;
{
@@ -2631,7 +2630,7 @@ sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_Bool bIns )
bRet = InsertWithValidRanges( p );
else
{
- ASSERT( !this, "Redline: falscher Bereich" );
+ OSL_ENSURE( !this, "Redline: falscher Bereich" );
}
return bRet;
}
@@ -2648,7 +2647,7 @@ sal_Bool SwRedlineTbl::Insert( SwRedlinePtr& p, sal_uInt16& rP, sal_Bool bIns )
bRet = InsertWithValidRanges( p, &rP );
else
{
- ASSERT( !this, "Redline: falscher Bereich" );
+ OSL_ENSURE( !this, "Redline: falscher Bereich" );
}
return bRet;
}
@@ -3008,8 +3007,6 @@ int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) co
return nRet;
}
-/* */
-
SwRedlineData::SwRedlineData( RedlineType_t eT, sal_uInt16 nAut )
: pNext( 0 ), pExtraData( 0 ), eType( eT ), nAuthor( nAut ), nSeqNo( 0 )
{
@@ -3052,7 +3049,6 @@ void SwRedlineData::SetExtraData( const SwRedlineExtraData* pData )
pExtraData = 0;
}
-// #111827#
String SwRedlineData::GetDescr() const
{
String aResult;
@@ -3062,8 +3058,6 @@ String SwRedlineData::GetDescr() const
return aResult;
}
-/* */
-
SwRedline::SwRedline(RedlineType_t eTyp, const SwPaM& rPam )
: SwPaM( *rPam.GetMark(), *rPam.GetPoint() ),
pRedlineData( new SwRedlineData( eTyp, GetDoc()->GetRedlineAuthor() ) ),
@@ -3125,9 +3119,8 @@ sal_Bool SwRedline::HasValidRange() const
* pMkNd = &GetMark()->nNode.GetNode();
if( pPtNd->StartOfSectionNode() == pMkNd->StartOfSectionNode() &&
!pPtNd->StartOfSectionNode()->IsTableNode() &&
- // JP 18.5.2001: Bug 87222 - invalid if points on the end of content
- // DVO 25.03.2002: #96530# end-of-content only invalid if no content
- // index exists
+ // invalid if points on the end of content
+ // end-of-content only invalid if no content index exists
( pPtNd != pMkNd || GetContentIdx() != NULL ||
pPtNd != &pPtNd->GetNodes().GetEndOfContent() )
)
@@ -3305,7 +3298,7 @@ void SwRedline::CalcStartEnd( sal_uLong nNdIdx, sal_uInt16& nStart, sal_uInt16&
}
else
{
- ASSERT( pREnd->nNode == nNdIdx,
+ OSL_ENSURE( pREnd->nNode == nNdIdx,
"SwRedlineItr::Seek: GetRedlinePos Error" );
nStart = 0; // Absatz wird vorne ueberlappt
nEnd = pREnd->nContent.GetIndex();
@@ -3418,11 +3411,11 @@ void SwRedline::CopyToSection()
bSaveRdlMoveFlg = pDoc->IsRedlineMove();
pDoc->SetCopyIsMove( sal_True );
- // #100619# The IsRedlineMove() flag causes the behaviour of the
+ // The IsRedlineMove() flag causes the behaviour of the
// SwDoc::_CopyFlyInFly method to change, which will eventually be
// called by the pDoc->Copy line below (through SwDoc::_Copy,
- // SwDoc::CopyWithFlyInFly). This rather obscure bugfix was introduced
- // for #63198# and #64896#, and apparently never really worked.
+ // SwDoc::CopyWithFlyInFly). This rather obscure bugfix
+ // apparently never really worked.
pDoc->SetRedlineMove( pStt->nContent == 0 );
if( pCSttNd )
@@ -3440,7 +3433,7 @@ void SwRedline::CopyToSection()
SwPosition aPos( aNdIdx, SwIndex( pTxtNd ));
pDoc->CopyRange( *this, aPos, false );
- // JP 08.10.98: die Vorlage vom EndNode ggfs. mit uebernehmen
+ // die Vorlage vom EndNode ggfs. mit uebernehmen
// - ist im Doc::Copy nicht erwuenscht
if( pCEndNd && pCEndNd != pCSttNd )
{
@@ -3508,10 +3501,8 @@ void SwRedline::DelCopyOfSection()
if( pCSttNd && pCEndNd )
{
- // --> OD 2009-08-20 #i100466#
- // force a <join next> on <delete and join> operation
+ // #i100466# - force a <join next> on <delete and join> operation
pDoc->DeleteAndJoin( aPam, true );
- // <--
}
else if( pCSttNd || pCEndNd )
{
@@ -3521,7 +3512,7 @@ void SwRedline::DelCopyOfSection()
if( bDelLastPara )
{
- // #100611# To prevent dangling references to the paragraph to
+ // To prevent dangling references to the paragraph to
// be deleted, redline that point into this paragraph should be
// moved to the new end position. Since redlines in the redline
// table are sorted and the pEnd position is an endnode (see
@@ -3529,7 +3520,7 @@ void SwRedline::DelCopyOfSection()
// current ones can be affected.
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
sal_uInt16 n = rTbl.GetPos( this );
- ASSERT( n != USHRT_MAX, "How strange. We don't exist!" );
+ OSL_ENSURE( n != USHRT_MAX, "How strange. We don't exist!" );
for( sal_Bool bBreak = sal_False; !bBreak && n > 0; )
{
--n;
@@ -3577,7 +3568,7 @@ void SwRedline::MoveFromSection()
const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
SvPtrarr aBeforeArr( 16, 16 ), aBehindArr( 16, 16 );
sal_uInt16 nMyPos = rTbl.GetPos( this );
- ASSERT( this, "this nicht im Array?" );
+ OSL_ENSURE( this, "this nicht im Array?" );
sal_Bool bBreak = sal_False;
sal_uInt16 n;
@@ -3615,9 +3606,7 @@ void SwRedline::MoveFromSection()
}
}
- // --> OD 2009-03-17 #i95711#
- const SwNode* pKeptCntntSectNode( &pCntntSect->GetNode() );
- // <--
+ const SwNode* pKeptCntntSectNode( &pCntntSect->GetNode() ); // #i95711#
{
SwPaM aPam( pCntntSect->GetNode(),
*pCntntSect->GetNode().EndOfSectionNode(), 1,
@@ -3666,7 +3655,7 @@ void SwRedline::MoveFromSection()
if( pColl && pCNd )
pCNd->ChgFmtColl( pColl );
}
- // --> OD 2009-03-17 #i95771#
+ // #i95771#
// Under certain conditions the previous <SwDoc::Move(..)> has already
// remove the change tracking section of this <SwRedline> instance from
// the change tracking nodes area.
@@ -3681,7 +3670,7 @@ void SwRedline::MoveFromSection()
// <--
delete pCntntSect, pCntntSect = 0;
- // #100611# adjustment of redline table positions must take start and
+ // adjustment of redline table positions must take start and
// end into account, not point and mark.
for( n = 0; n < aBeforeArr.Count(); ++n )
*(SwPosition*)aBeforeArr[ n ] = *Start();
@@ -3705,9 +3694,9 @@ void SwRedline::SetContentIdx( const SwNodeIndex* pIdx )
delete pCntntSect, pCntntSect = 0;
bIsVisible = sal_False;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !this, "das ist keine gueltige Operation" );
+ OSL_ENSURE( !this, "das ist keine gueltige Operation" );
#endif
}
@@ -3719,8 +3708,6 @@ sal_Bool SwRedline::CanCombine( const SwRedline& rRedl ) const
void SwRedline::PushData( const SwRedline& rRedl, sal_Bool bOwnAsNext )
{
-// SwRedlineData* pNew = new SwRedlineData( rRedl.GetType(),
-// rRedl.GetAuthor() );
SwRedlineData* pNew = new SwRedlineData( *rRedl.pRedlineData, sal_False );
if( bOwnAsNext )
{
@@ -3753,7 +3740,6 @@ sal_uInt16 SwRedline::GetStackCount() const
return nRet;
}
-// -> #111827#
sal_uInt16 SwRedline::GetAuthor( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).nAuthor;
@@ -3778,7 +3764,6 @@ const String& SwRedline::GetComment( sal_uInt16 nPos ) const
{
return GetRedlineData(nPos).sComment;
}
-// <- #111827#
int SwRedline::operator==( const SwRedline& rCmp ) const
{
@@ -3798,7 +3783,6 @@ int SwRedline::operator<( const SwRedline& rCmp ) const
return nResult;
}
-// -> #111827#
const SwRedlineData & SwRedline::GetRedlineData(sal_uInt16 nPos) const
{
SwRedlineData * pCur = pRedlineData;
@@ -3810,7 +3794,7 @@ const SwRedlineData & SwRedline::GetRedlineData(sal_uInt16 nPos) const
nPos--;
}
- ASSERT( 0 == nPos, "Pos angabe ist zu gross" );
+ OSL_ENSURE( 0 == nPos, "Pos angabe ist zu gross" );
return *pCur;
}
@@ -3854,7 +3838,6 @@ String SwRedline::GetDescr(sal_uInt16 nPos)
return aResult;
}
-// <- #111827#
bool SwDoc::IsInRedlines(const SwNode & rNode) const
@@ -3866,3 +3849,5 @@ bool SwDoc::IsInRedlines(const SwNode & rNode) const
return aPam.ContainsPosition(aPos) ? true : false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index c8703ab6adcb..564e8d7e6989 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -298,28 +299,7 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_
case UnicodeType::OTHER_LETTER:
bChkNxtWrd = sal_True;
- // no break!
-// case UnicodeType::UNASSIGNED:
-// case UnicodeType::MODIFIER_LETTER:
-// case UnicodeType::NON_SPACING_MARK:
-// case UnicodeType::ENCLOSING_MARK:
-// case UnicodeType::COMBINING_SPACING_MARK:
-// case UnicodeType::LETTER_NUMBER:
-// case UnicodeType::OTHER_NUMBER:
-// case UnicodeType::LINE_SEPARATOR:
-// case UnicodeType::PARAGRAPH_SEPARATOR:
-// case UnicodeType::FORMAT:
-// case UnicodeType::SURROGATE:
-// case UnicodeType::DASH_PUNCTUATION:
-// case UnicodeType::CONNECTOR_PUNCTUATION:
-///*?? */case UnicodeType::OTHER_PUNCTUATION:
-//--> char '!' is to ignore!
-// case UnicodeType::MATH_SYMBOL:
-// case UnicodeType::CURRENCY_SYMBOL:
-// case UnicodeType::MODIFIER_SYMBOL:
-// case UnicodeType::OTHER_SYMBOL:
-// case UnicodeType::INITIAL_PUNCTUATION:
-// case UnicodeType::FINAL_PUNCTUATION:
+
default:
bIsAlphaNum = sal_False;
break;
@@ -359,3 +339,5 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_
SwRubyListEntry::~SwRubyListEntry()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 497e00b70125..62b9560151c6 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,11 +58,6 @@
#include <node2lay.hxx>
#include <unochart.hxx>
-#if OSL_DEBUG_LEVEL > 1
-//nur zum debugen
-#include <cellatr.hxx>
-#endif
-
using namespace ::com::sun::star::lang;
SwSortOptions* SwSortElement::pOptions = 0;
@@ -74,16 +70,13 @@ LocaleDataWrapper* SwSortElement::pLclData = 0;
SV_IMPL_OP_PTRARR_SORT( SwSortElements, SwSortElementPtr );
-
/*--------------------------------------------------------------------
Beschreibung: Ein Sortierelement fuers Sort konstruieren
--------------------------------------------------------------------*/
-
-
void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
FlatFndBox* pFltBx )
{
- ASSERT( !pDoc && !pOptions && !pBox, "wer hat das Finit vergessen?" );
+ OSL_ENSURE( !pDoc && !pOptions && !pBox, "wer hat das Finit vergessen?" );
pDoc = pD;
pOptions = new SwSortOptions( rOpt );
pBox = pFltBx;
@@ -100,11 +93,8 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
pSortCollator = new CollatorWrapper(
::comphelper::getProcessServiceFactory() );
-// pSortCollator->loadCollatorAlgorithm( sAlgorithm, aLocale,
-// rOpt.bIgnoreCase ? SW_COLLATOR_IGNORES : 0 );
}
-
void SwSortElement::Finit()
{
delete pOptions, pOptions = 0;
@@ -116,12 +106,10 @@ void SwSortElement::Finit()
pBox = 0;
}
-
SwSortElement::~SwSortElement()
{
}
-
double SwSortElement::StrToDouble( const String& rStr ) const
{
if( !pLclData )
@@ -143,8 +131,6 @@ double SwSortElement::StrToDouble( const String& rStr ) const
/*--------------------------------------------------------------------
Beschreibung: Operatoren zum Vergleichen
--------------------------------------------------------------------*/
-
-
sal_Bool SwSortElement::operator==(const SwSortElement& )
{
return sal_False;
@@ -153,7 +139,6 @@ sal_Bool SwSortElement::operator==(const SwSortElement& )
/*--------------------------------------------------------------------
Beschreibung: Kleiner-Operator fuers sortieren
--------------------------------------------------------------------*/
-
sal_Bool SwSortElement::operator<(const SwSortElement& rCmp)
{
@@ -211,24 +196,18 @@ double SwSortElement::GetValue( sal_uInt16 nKey ) const
/*--------------------------------------------------------------------
Beschreibung: SortierElemente fuer Text
--------------------------------------------------------------------*/
-
-
SwSortTxtElement::SwSortTxtElement(const SwNodeIndex& rPos)
: nOrg(rPos.GetIndex()), aPos(rPos)
{
}
-
SwSortTxtElement::~SwSortTxtElement()
{
}
-
/*--------------------------------------------------------------------
Beschreibung: Key ermitteln
--------------------------------------------------------------------*/
-
-
String SwSortTxtElement::GetKey(sal_uInt16 nId) const
{
SwTxtNode* pTxtNd = aPos.GetNode().GetTxtNode();
@@ -255,17 +234,14 @@ String SwSortTxtElement::GetKey(sal_uInt16 nId) const
return rStr.Copy( nStart, nEnd-nStart );
}
-
/*--------------------------------------------------------------------
Beschreibung: Sortier-Elemente fuer Tabellen
--------------------------------------------------------------------*/
-
SwSortBoxElement::SwSortBoxElement( sal_uInt16 nRC )
: nRow( nRC )
{
}
-
SwSortBoxElement::~SwSortBoxElement()
{
}
@@ -273,8 +249,6 @@ SwSortBoxElement::~SwSortBoxElement()
/*--------------------------------------------------------------------
Beschreibung: Schluessel zu einer Zelle ermitteln
--------------------------------------------------------------------*/
-
-
String SwSortBoxElement::GetKey(sal_uInt16 nKey) const
{
const _FndBox* pFndBox;
@@ -290,7 +264,7 @@ String SwSortBoxElement::GetKey(sal_uInt16 nKey) const
if( pFndBox )
{ // StartNode holen und ueberlesen
const SwTableBox* pMyBox = pFndBox->GetBox();
- ASSERT(pMyBox, "Keine atomare Box");
+ OSL_ENSURE(pMyBox, "Keine atomare Box");
if( pMyBox->GetSttNd() )
{
@@ -332,8 +306,6 @@ double SwSortBoxElement::GetValue( sal_uInt16 nKey ) const
/*--------------------------------------------------------------------
Beschreibung: Text sortieren im Document
--------------------------------------------------------------------*/
-
-
sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
{
// pruefen ob Rahmen im Text
@@ -519,11 +491,10 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
/*--------------------------------------------------------------------
Beschreibung: Tabelle sortieren im Document
--------------------------------------------------------------------*/
-
sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
{
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -649,8 +620,6 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
/*--------------------------------------------------------------------
Beschreibung: Zeilenweise verschieben
--------------------------------------------------------------------*/
-
-
void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
@@ -697,8 +666,6 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
/*--------------------------------------------------------------------
Beschreibung: Spaltenweise verschieben
--------------------------------------------------------------------*/
-
-
void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
SwMovedBoxes& rMovedList, SwUndoSort* pUD)
{
@@ -745,12 +712,10 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT,
/*--------------------------------------------------------------------
Beschreibung: Eine einzelne Zelle verschieben
--------------------------------------------------------------------*/
-
-
void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
sal_Bool bMovedBefore, SwUndoSort* pUD)
{
- ASSERT(pSource && pTar,"Fehlende Quelle oder Ziel");
+ OSL_ENSURE(pSource && pTar,"Fehlende Quelle oder Ziel");
if(pSource == pTar)
return;
@@ -780,7 +745,7 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
sal_Bool bDelFirst = sal_False;
if( nCount == 2 )
{
- ASSERT( pNd->GetCntntNode(), "Kein ContentNode");
+ OSL_ENSURE( pNd->GetCntntNode(), "Kein ContentNode");
bDelFirst = !pNd->GetCntntNode()->Len() && bMovedBefore;
}
@@ -803,8 +768,6 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar,
/*--------------------------------------------------------------------
Beschreibung: Zweidimensionales Array aus FndBoxes generieren
--------------------------------------------------------------------*/
-
-
FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
pDoc(pDocPtr),
rBoxRef(rBox),
@@ -829,7 +792,6 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
}
}
-
FlatFndBox::~FlatFndBox()
{
_FndBox** ppTmp = (_FndBox**)pArr;
@@ -842,8 +804,6 @@ FlatFndBox::~FlatFndBox()
/*--------------------------------------------------------------------
Beschreibung: Alle Lines einer Box muessen gleichviel Boxen haben
--------------------------------------------------------------------*/
-
-
sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
{
const _FndLines &rLines = rBox.GetLines();
@@ -870,8 +830,6 @@ sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox)
Beschreibung: Box auf Symmetrie pruefen
Alle Boxen einer Line muessen gleichviele Lines haben
--------------------------------------------------------------------*/
-
-
sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
{
const _FndBoxes &rBoxes = rLn.GetBoxes();
@@ -897,8 +855,6 @@ sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn)
/*--------------------------------------------------------------------
Beschreibung: max Anzahl der Spalten (Boxes)
--------------------------------------------------------------------*/
-
-
sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
@@ -926,8 +882,6 @@ sal_uInt16 FlatFndBox::GetColCount(const _FndBox& rBox)
/*--------------------------------------------------------------------
Beschreibung: max Anzahl der Zeilen (Lines)
--------------------------------------------------------------------*/
-
-
sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
{
const _FndLines& rLines = rBox.GetLines();
@@ -952,8 +906,6 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox)
/*--------------------------------------------------------------------
Beschreibung: lineares Array aus atomaren FndBoxes erzeugen
--------------------------------------------------------------------*/
-
-
void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox)
{
sal_Bool bModRow = sal_False;
@@ -1015,22 +967,20 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox)
/*--------------------------------------------------------------------
Beschreibung: Zugriff auf eine bestimmte Zelle
--------------------------------------------------------------------*/
-
-
const _FndBox* FlatFndBox::GetBox(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
sal_uInt16 nOff = n_Row * nCols + n_Col;
const _FndBox* pTmp = *(pArr + nOff);
- ASSERT(n_Col < nCols && n_Row < nRows && pTmp, "unzulaessiger Array-Zugriff");
+ OSL_ENSURE(n_Col < nCols && n_Row < nRows && pTmp, "unzulaessiger Array-Zugriff");
return pTmp;
}
const SfxItemSet* FlatFndBox::GetItemSet(sal_uInt16 n_Col, sal_uInt16 n_Row) const
{
- ASSERT( !ppItemSets || ( n_Col < nCols && n_Row < nRows), "unzulaessiger Array-Zugriff");
+ OSL_ENSURE( !ppItemSets || ( n_Col < nCols && n_Row < nRows), "unzulaessiger Array-Zugriff");
return ppItemSets ? *(ppItemSets + (n_Row * nCols + n_Col )) : 0;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docstat.cxx b/sw/source/core/doc/docstat.cxx
index ee44bf142de3..0b79d817a436 100644
--- a/sw/source/core/doc/docstat.cxx
+++ b/sw/source/core/doc/docstat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,7 @@ SwDocStat::SwDocStat() :
nAllPara(1),
nWord(0),
nChar(0),
+ nCharExcludingSpaces(0),
bModified(sal_True)
{}
@@ -62,6 +64,8 @@ void SwDocStat::Reset()
nAllPara= 1;
nWord = 0;
nChar = 0;
+ nCharExcludingSpaces = 0;
bModified = sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 79fcfc60049d..00d425324f25 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,7 +82,7 @@ using namespace ::com::sun::star;
const sal_Unicode cNumRepl = '@';
const sal_Unicode cEndPageNum = '~';
-const sal_Char __FAR_DATA sPageDeli[] = ", ";
+const sal_Char sPageDeli[] = ", ";
SV_IMPL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr)
@@ -136,8 +137,6 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const
/*--------------------------------------------------------------------
Beschreibung: aktuelle Verzeichnismarkierungen ermitteln
--------------------------------------------------------------------*/
-
-
sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
SwTOXMarks& rArr ) const
{
@@ -178,15 +177,14 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
/*--------------------------------------------------------------------
Beschreibung: Marke loeschen
--------------------------------------------------------------------*/
-
void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
{
// hole den TextNode und
const SwTxtTOXMark* pTxtTOXMark = pTOXMark->GetTxtTOXMark();
- ASSERT( pTxtTOXMark, "Kein TxtTOXMark, kann nicht geloescht werden" );
+ OSL_ENSURE( pTxtTOXMark, "Kein TxtTOXMark, kann nicht geloescht werden" );
SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode());
- ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
+ OSL_ENSURE( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" );
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -213,7 +211,6 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
/*--------------------------------------------------------------------
Beschreibung: Traveln zwischen TOXMarks
--------------------------------------------------------------------*/
-
class CompareNodeCntnt
{
sal_uLong nNode;
@@ -222,20 +219,20 @@ public:
CompareNodeCntnt( sal_uLong nNd, xub_StrLen nCnt )
: nNode( nNd ), nCntnt( nCnt ) {}
- int operator==( const CompareNodeCntnt& rCmp )
+ int operator==( const CompareNodeCntnt& rCmp ) const
{ return nNode == rCmp.nNode && nCntnt == rCmp.nCntnt; }
- int operator!=( const CompareNodeCntnt& rCmp )
+ int operator!=( const CompareNodeCntnt& rCmp ) const
{ return nNode != rCmp.nNode || nCntnt != rCmp.nCntnt; }
- int operator< ( const CompareNodeCntnt& rCmp )
+ int operator< ( const CompareNodeCntnt& rCmp ) const
{ return nNode < rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt < rCmp.nCntnt); }
- int operator<=( const CompareNodeCntnt& rCmp )
+ int operator<=( const CompareNodeCntnt& rCmp ) const
{ return nNode < rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt <= rCmp.nCntnt); }
- int operator> ( const CompareNodeCntnt& rCmp )
+ int operator> ( const CompareNodeCntnt& rCmp ) const
{ return nNode > rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt > rCmp.nCntnt); }
- int operator>=( const CompareNodeCntnt& rCmp )
+ int operator>=( const CompareNodeCntnt& rCmp ) const
{ return nNode > rCmp.nNode ||
( nNode == rCmp.nNode && nCntnt >= rCmp.nCntnt); }
};
@@ -244,7 +241,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
SwTOXSearch eDir, sal_Bool bInReadOnly )
{
const SwTxtTOXMark* pMark = rCurTOXMark.GetTxtTOXMark();
- ASSERT(pMark, "pMark==0 Ungueltige TxtTOXMark");
+ OSL_ENSURE(pMark, "pMark==0 Ungueltige TxtTOXMark");
const SwTxtNode *pTOXSrc = pMark->GetpTxtNd();
@@ -356,8 +353,6 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
return *pNew;
}
-/* */
-
const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SwTOXBase& rTOX,
const SfxItemSet* pSet,
@@ -378,7 +373,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
if( bExpand )
{
- // OD 19.03.2003 #106329# - add value for 2nd parameter = true to
+ // add value for 2nd parameter = true to
// indicate, that a creation of a new table of content has to be performed.
// Value of 1st parameter = default value.
pNewSection->Update( 0, true );
@@ -410,8 +405,6 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
return pNewSection;
}
-
-
const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
const SwTOXBase& rTOX,
const SfxItemSet* pSet )
@@ -456,7 +449,6 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd
/*--------------------------------------------------------------------
Beschreibung: Aktuelles Verzeichnis ermitteln
--------------------------------------------------------------------*/
-
const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
{
const SwNode& rNd = rPos.nNode.GetNode();
@@ -466,7 +458,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
SectionType eT = pSectNd->GetSection().GetType();
if( TOX_CONTENT_SECTION == eT )
{
- ASSERT( pSectNd->GetSection().ISA( SwTOXBaseSection ),
+ OSL_ENSURE( pSectNd->GetSection().ISA( SwTOXBaseSection ),
"keine TOXBaseSection!" );
SwTOXBaseSection& rTOXSect = (SwTOXBaseSection&)
pSectNd->GetSection();
@@ -476,20 +468,16 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
}
return 0;
}
-/* -----------------01.09.99 16:01-------------------
- --------------------------------------------------*/
const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
- ASSERT( pFmt, "invalid TOXBaseSection!" );
+ OSL_ENSURE( pFmt, "invalid TOXBaseSection!" );
return pFmt->GetAttrSet();
}
-/* -----------------02.09.99 07:48-------------------
- --------------------------------------------------*/
const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
{
SwTOXBase** prBase = 0;
@@ -511,9 +499,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
}
return (*prBase);
}
-/* -----------------02.09.99 08:06-------------------
- --------------------------------------------------*/
void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
{
SwTOXBase** prBase = 0;
@@ -535,13 +521,11 @@ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
/*--------------------------------------------------------------------
Beschreibung: Verzeichnis loeschen
--------------------------------------------------------------------*/
-
-
sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
{
// its only delete the TOX, not the nodes
sal_Bool bRet = sal_False;
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
SwSectionFmt* pFmt = rTOXSect.GetFmt();
@@ -629,7 +613,6 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes )
/*--------------------------------------------------------------------
Beschreibung: Verzeichnistypen verwalten
--------------------------------------------------------------------*/
-
sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
@@ -639,9 +622,7 @@ sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
++nCnt;
return nCnt;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
@@ -652,18 +633,13 @@ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
return 0;
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp )
{
SwTOXType * pNew = new SwTOXType( rTyp );
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
return pNew;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
const String* pChkStr ) const
{
@@ -718,12 +694,9 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
return aName += String::CreateFromInt32( ++nNum );
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ),
"keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase;
@@ -738,8 +711,6 @@ sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
return bRet;
}
-/* */
-
const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
const SwNode* pNd = &rNd;
@@ -754,17 +725,15 @@ const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, sal_uInt8 nLvl = 0 )
{
SwPosition aPos( *pNd );
pNd = GetBodyTxtNode( *pNd->GetDoc(), aPos, *pFrm );
- ASSERT( pNd, "wo steht der Absatz" );
+ OSL_ENSURE( pNd, "wo steht der Absatz" );
}
}
return pNd ? pNd->FindOutlineNodeOfLevel( nLvl ) : 0;
}
-
/*--------------------------------------------------------------------
Beschreibung: Verzeichnis-Klasse
--------------------------------------------------------------------*/
-
SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt)
: SwTOXBase( rBase )
, SwSection( TOX_CONTENT_SECTION, aEmptyStr, rFmt )
@@ -773,12 +742,10 @@ SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt)
SetSectionName( GetTOXName() );
}
-
SwTOXBaseSection::~SwTOXBaseSection()
{
}
-
sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart ) const
{
sal_Bool bRet = sal_False;
@@ -807,7 +774,6 @@ sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt zusammensammeln
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
const bool _bNewTOX )
{
@@ -825,8 +791,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
if(pAttr && pDoc && GetFmt())
pDoc->ChgFmt(*GetFmt(), *pAttr);
- // OD 18.03.2003 #106329# - determine default page description, which
- // will be used by the content nodes, if no approriate one is found.
+ // determine default page description, which will be used by the content nodes,
+ // if no approriate one is found.
const SwPageDesc* pDefaultPageDesc;
{
pDefaultPageDesc =
@@ -842,8 +808,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
pDefaultPageDesc = 0;
}
}
- // OD 28.04.2003 #109166# - consider end node of content section in the
- // node array.
+ // consider end node of content section in the node array.
if ( !pDefaultPageDesc &&
( pSectNd->EndOfSectionNode()->GetIndex() <
(pSectNd->GetNodes().GetEndOfContent().GetIndex() - 1) )
@@ -861,8 +826,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
pDefaultPageDesc = pNdAfterTOX->FindPageDesc( sal_False );
}
}
- // OD 28.04.2003 #109166# - consider start node of content section in
- // the node array.
+ // consider start node of content section in the node array.
if ( !pDefaultPageDesc &&
( pSectNd->GetIndex() >
(pSectNd->GetNodes().GetEndOfContent().StartOfSectionIndex() + 1) )
@@ -1053,8 +1017,8 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
pNextMark->GetSecondaryKey() == sSecKey)
nRange++;
}
- // OD 18.03.2003 #106329# - pass node index of table-of-content section
- // and default page description to method <GenerateText(..)>.
+ // pass node index of table-of-content section and default page description
+ // to method <GenerateText(..)>.
GenerateText( nCnt, nRange, aStrArr, pSectNd->GetIndex(), pDefaultPageDesc );
nCnt += nRange - 1;
}
@@ -1098,8 +1062,6 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
/*--------------------------------------------------------------------
Beschreibung: AlphaDelimitter einfuegen
--------------------------------------------------------------------*/
-
-
void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1144,7 +1106,6 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
/*--------------------------------------------------------------------
Beschreibung: Template auswerten
--------------------------------------------------------------------*/
-
SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1192,11 +1153,9 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
return pColl;
}
-
/*--------------------------------------------------------------------
Beschreibung: Aus Markierungen erzeugen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
const SwTxtNode* pOwnChapterNode )
{
@@ -1270,12 +1229,9 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
}
}
-
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt aus Gliederungsebene generieren
--------------------------------------------------------------------*/
-
-
void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1287,8 +1243,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
::SetProgressState( 0, pDoc->GetDocShell() );
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
- //sal_uInt16(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
- sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
+ sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() &&
pTxtNd->GetFrm() &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
@@ -1304,7 +1259,6 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt aus Vorlagenbereichen generieren
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1321,8 +1275,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
if( !pColl ||
( TOX_CONTENT == SwTOXBase::GetType() &&
GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL &&
- //NO_NUMBERING != pColl->GetOutlineLevel() ) )//#outline level,zhaojianwei
- pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei
+ pColl->IsAssignedToListLevelOfOutlineStyle()) )
continue;
SwClientIter aIter( *pColl );
@@ -1344,7 +1297,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
}
}
-/* -----------------14.07.99 09:59-------------------
+/* --------------------------------------------------
Description: generate content from sequence fields
--------------------------------------------------*/
void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
@@ -1384,9 +1337,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
}
}
}
-/* -----------------15.09.99 14:18-------------------
- --------------------------------------------------*/
void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1405,11 +1356,8 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
::SetProgressState( 0, pDoc->GetDocShell() );
-// const SwTxtNode* pChapterCompareNode = 0;
-
if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
- rTxtNode.GetNodes().IsDocNodes() /*&&
- (!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */)
+ rTxtNode.GetNodes().IsDocNodes() )
{
//#106485# the body node has to be used!
SwCntntFrm *pFrm = rTxtNode.GetFrm();
@@ -1526,7 +1474,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
}
else
{
- DBG_ERROR("OLE-object nicht geladen?");
+ OSL_FAIL("OLE-object nicht geladen?");
bInclude = sal_False;
}
}
@@ -1553,9 +1501,6 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
MAXLEVEL - 1 );
if( pOutlNd )
{
- //sal_uInt16 nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
- //if( nTmp < NO_NUMBERING )
- // nSetLevel = nTmp + 1;
if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
nSetLevel = pOutlNd->GetTxtColl()->GetAttrOutlineLevel() ;//<-end,zhaojianwei
}
@@ -1579,7 +1524,6 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
/*--------------------------------------------------------------------
Beschreibung: Tabelleneintraege zusammensuchen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1612,9 +1556,6 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
if( pOutlNd )
{
- //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();
@@ -1634,7 +1575,6 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
Beschreibung: String generieren anhand der Form
SonderZeichen 0-31 und 255 entfernen
--------------------------------------------------------------------*/
-
String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal_uInt8 nLevel )
{
String sRet;
@@ -1653,8 +1593,8 @@ String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal
return sRet;
}
-// OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
-// in order to control, which page description is used, no appropriate one is found.
+// add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc> in order to control,
+// which page description is used, no appropriate one is found.
void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
sal_uInt16 nCount,
SvStringsDtor& ,
@@ -1676,7 +1616,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
// String mit dem Pattern aus der Form initialisieren
const SwTOXSortTabBase& rBase = *aSortArr[nIndex];
sal_uInt16 nLvl = rBase.GetLevel();
- ASSERT( nLvl < GetTOXForm().GetFormMax(), "ungueltiges FORM_LEVEL");
+ OSL_ENSURE( nLvl < GetTOXForm().GetFormMax(), "ungueltiges FORM_LEVEL");
SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
xub_StrLen nLinkStartPosition = STRING_NOTFOUND;
@@ -1758,7 +1698,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
{
// dann hilft alles nichts, wir muessen ueber die Seiten-
// vorlage gehen.
- // OD 18.03.2003 #106329# - call
sal_uInt32 nPgDescNdIdx = pTOXNd->GetIndex() + 1;
sal_uInt32* pPgDescNdIdx = &nPgDescNdIdx;
pPageDesc = pTOXNd->FindPageDesc( sal_False, pPgDescNdIdx );
@@ -1815,9 +1754,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
aInsStr += cEndPageNum;
rTxt.Append( aInsStr );
}
-// // Tab entfernen, wenn keine Seitennummer
-// else if( rTxt.Len() && '\t' == rTxt.GetChar( rTxt.Len() - 1 ))
-// rTxt.Erase( rTxt.Len()-1, 1 );
}
break;
@@ -1828,12 +1764,9 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
if(rBase.aTOXSources.Count())
pTOXSource = &rBase.aTOXSources[0];
- // --> OD 2008-02-14 #i53420#
-// if( pTOXSource && pTOXSource->pNd
-// pTOXSource->pNd->IsTxtNode() )
+ // #i53420#
if ( pTOXSource && pTOXSource->pNd &&
pTOXSource->pNd->IsCntntNode() )
- // <--
{
const SwCntntFrm* pFrm = pTOXSource->pNd->GetFrm();
if( pFrm )
@@ -1841,14 +1774,13 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
SwChapterFieldType aFldTyp;
SwChapterField aFld( &aFldTyp, aToken.nChapterFormat );
aFld.SetLevel( static_cast<sal_uInt8>(aToken.nOutlineLevel - 1) );
- // --> OD 2008-02-14 #i53420#
-// aFld.ChangeExpansion( pFrm, (SwTxtNode*)pTOXSource->pNd, sal_True );
+ // #i53420#
aFld.ChangeExpansion( pFrm,
dynamic_cast<const SwCntntNode*>(pTOXSource->pNd),
sal_True );
// <--
- //---> i89791
- // OD 2008-06-26 - continue to support CF_NUMBER
+ //---> #i89791#
+ // continue to support CF_NUMBER
// and CF_NUM_TITLE in order to handle ODF 1.0/1.1
// written by OOo 3.x in the same way as OOo 2.x
// would handle them.
@@ -1937,7 +1869,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
}
}
- aIt++; // #i21237#
+ ++aIt; // #i21237#
}
pTOXNd->SetAttr( aTStops );
@@ -1956,7 +1888,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
Beschreibung: Seitennummer errechnen und nach dem Formatieren
eintragen
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::UpdatePageNum()
{
if( !aSortArr.Count() )
@@ -2011,7 +1942,7 @@ void SwTOXBaseSection::UpdatePageNum()
if( rTOXSource.pNd )
{
SwCntntFrm* pFrm = rTOXSource.pNd->GetFrm();
- ASSERT( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
+ OSL_ENSURE( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
if( !pFrm )
continue;
if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->HasFollow() )
@@ -2054,7 +1985,7 @@ void SwTOXBaseSection::UpdatePageNum()
if(pBase->pTOXNd)
{
const SwTxtNode* pTxtNd = pBase->pTOXNd->GetTxtNode();
- ASSERT( pTxtNd, "kein TextNode, falsches Verzeichnis" );
+ OSL_ENSURE( pTxtNd, "kein TextNode, falsches Verzeichnis" );
_UpdatePageNum( (SwTxtNode*)pTxtNd, aNums, aDescs, pMainNums,
aIntl );
@@ -2068,11 +1999,9 @@ void SwTOXBaseSection::UpdatePageNum()
aSortArr.DeleteAndDestroy( 0, aSortArr.Count() );
}
-
/*--------------------------------------------------------------------
Beschreibung: Austausch der Seitennummer-Platzhalter
--------------------------------------------------------------------*/
-
// search for the page no in the array of main entry page numbers
sal_Bool lcl_HasMainEntry( const SvUShorts* pMainEntryNums, sal_uInt16 nToFind )
{
@@ -2248,11 +2177,9 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
delete pCharStyleIdx;
}
-
/*--------------------------------------------------------------------
Beschreibung: Sortiert einfuegen in das SortArr
--------------------------------------------------------------------*/
-
void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
{
Range aRange(0, aSortArr.Count());
@@ -2328,9 +2255,9 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
delete pNew;
return;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- DBG_ERROR("Bibliography entries cannot be found here");
+ OSL_FAIL("Bibliography entries cannot be found here");
#endif
}
if(*pNew < *pOld)
@@ -2348,7 +2275,6 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
/*--------------------------------------------------------------------
Beschreibung: Schluessel-Bereich suchen und evtl einfuegen
--------------------------------------------------------------------*/
-
Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReading,
const SwTOXSortTabBase& rNew,
sal_uInt16 nLevel, const Range& rRange )
@@ -2363,7 +2289,7 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
sToCompare.Erase( 0, 1 ).Insert( sUpper, 0 );
}
- ASSERT(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
+ OSL_ENSURE(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
const sal_uInt16 nMin = (sal_uInt16)rRange.Min();
const sal_uInt16 nMax = (sal_uInt16)rRange.Max();
@@ -2408,7 +2334,6 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
return Range(nStart, nEnd);
}
-
sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
@@ -2426,9 +2351,7 @@ sal_Bool SwTOXBase::IsTOXBaseInReadonly() const
}
return bRet;
}
-/* -----------------17.08.99 13:29-------------------
- --------------------------------------------------*/
const SfxItemSet* SwTOXBase::GetAttrSet() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
@@ -2459,6 +2382,4 @@ sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
return sal_True;
}
-/* */
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index febab662a8fa..bf34f2a64699 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
DBG_UNHANDLED_EXCEPTION();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 93d177aed548..6ed12fd4cce5 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -292,9 +293,10 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd,
SwExtTextInput* SwDoc::GetExtTextInput() const
{
- ASSERT( !pExtInputRing || pExtInputRing == pExtInputRing->GetNext(),
+ OSL_ENSURE( !pExtInputRing || pExtInputRing == pExtInputRing->GetNext(),
"more then one InputEngine available" );
return (SwExtTextInput*)pExtInputRing;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index c43e363e3a72..cbbb1afaeef3 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,16 +28,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <sal/macros.h>
#include <hintids.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <doc.hxx> // fuer GetAttrPool
-#include <errhdl.hxx>
#include <fmtcol.hxx>
-// --> OD 2006-11-22 #i71574#
-#include <fmtcolfunc.hxx>
-// <--
+#include <fmtcolfunc.hxx> // #i71574#
#include <hints.hxx>
#include <calc.hxx>
#include <node.hxx>
@@ -44,9 +44,7 @@
#include <paratr.hxx>
//--> #outlinelevel added by zhaojianwei
-#ifndef _SFXINTITEM_HXX
#include <svl/intitem.hxx>
-#endif
//<--end
TYPEINIT1( SwTxtFmtColl, SwFmtColl );
@@ -56,11 +54,10 @@ TYPEINIT1( SwCollCondition, SwClient );
SV_IMPL_PTRARR( SwFmtCollConditions, SwCollConditionPtr );
-// --> OD 2008-03-04 #refactorlists#
namespace TxtFmtCollFunc
{
- // --> OD 2006-11-22 #i71574#
+ // #i71574#
void CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
SwFmt* pFmt,
const SwNumRuleItem* pNewNumRuleItem )
@@ -69,14 +66,13 @@ namespace TxtFmtCollFunc
if ( !pTxtFmtColl )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
+ OSL_ENSURE( false,
"<TxtFmtCollFunc::CheckTxtFmtCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTxtFmtColl>" );
#endif
return;
}
- // --> OD 2007-01-24 #i73790#
- // if ( pTxtFmtColl->AssignedToListLevelOfOutlineStyle() )
+ // #i73790#
if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle() &&
pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
// <--
@@ -149,16 +145,13 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
return;
}
- // --> OD 2006-06-16 #i66431# - adjust type of <bNewParent>
- bool bNewParent( false );
- // <--
+ bool bNewParent( false ); // #i66431# - adjust type of <bNewParent>
SvxULSpaceItem *pNewULSpace = 0, *pOldULSpace = 0;
SvxLRSpaceItem *pNewLRSpace = 0, *pOldLRSpace = 0;
SvxFontHeightItem* aFontSizeArr[3] = {0,0,0};
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
const bool bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());//#outline level ,zhaojianwei
const SwNumRuleItem* pNewNumRuleItem( 0L );
- // <--
SwAttrSetChg *pNewChgSet = 0, *pOldChgSet = 0;
@@ -178,8 +171,7 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
sal_False, (const SfxPoolItem**)&(aFontSizeArr[1]) );
pNewChgSet->GetChgSet()->GetItemState( RES_CHRATR_CTL_FONTSIZE,
sal_False, (const SfxPoolItem**)&(aFontSizeArr[2]) );
- // --> OD 2006-10-17 #i70223#
- // --> OD 2007-12-19 #i84745#
+ // #i70223#, #i84745#
// check, if attribute set is applied to this paragraph style
if ( bAssignedToListLevelOfOutlineStyle &&
pNewChgSet->GetTheChgdSet() == &GetAttrSet() )
@@ -200,10 +192,8 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
aFontSizeArr[0] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_FONTSIZE );
aFontSizeArr[1] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_CJK_FONTSIZE );
aFontSizeArr[2] = (SvxFontHeightItem*)&pParent->Get( RES_CHRATR_CTL_FONTSIZE );
- // --> OD 2006-06-16 #i66431#
- // modify has to be propagated, because of new parent format.
+ // #i66431# - modify has to be propagated, because of new parent format.
bNewParent = true;
- // <--
}
break;
@@ -222,7 +212,7 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_CHRATR_CTL_FONTSIZE:
aFontSizeArr[2] = (SvxFontHeightItem*)pNew;
break;
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
case RES_PARATR_NUMRULE:
{
if ( bAssignedToListLevelOfOutlineStyle )
@@ -234,7 +224,7 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
break;
}
- // --> OD 2006-10-17 #i70223#
+ // #i70223#
if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
{
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
@@ -318,7 +308,7 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
- for( int nC = 0, nArrLen = sizeof(aFontSizeArr) / sizeof( aFontSizeArr[0]);
+ for( int nC = 0, nArrLen = SAL_N_ELEMENTS(aFontSizeArr);
nC < nArrLen; ++nC )
{
SvxFontHeightItem *pFSize = aFontSizeArr[ nC ], *pOldFSize;
@@ -370,7 +360,6 @@ sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const
return sal_False;
}
-// --> OD 2008-03-04 #refactorlists#
sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr )
{
const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
@@ -426,12 +415,12 @@ sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
}
// <--
-// --> OD 2007-01-24 #i73790#
+// #i73790#
sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
{
const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
mbStayAssignedToListLevelOfOutlineStyle = true;
- // --> OD 2008-12-16 #i70748#
+ // #i70748#
// Outline level is no longer a member, it is a attribute now.
// Thus, it needs to be restored, if the paragraph style is assigned
// to the outline style
@@ -442,7 +431,7 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
sal_uInt16 nRet = SwFmtColl::ResetAllFmtAttr();
- // --> OD 2008-12-16 #i70748#
+ // #i70748#
if ( nAssignedOutlineStyleLevel != -1 )
{
AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
@@ -455,7 +444,6 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
}
// <--
-// --> OD 2008-02-13 #newlistlevelattrs#
bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
{
bool bAreListLevelIndentsApplicable( true );
@@ -501,7 +489,7 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
}
pColl = dynamic_cast<const SwTxtFmtColl*>(pColl->DerivedFrom());
- ASSERT( pColl,
+ OSL_ENSURE( pColl,
"<SwTxtFmtColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
}
}
@@ -661,7 +649,7 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
//#outline level, zhaojianwei
void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
{
- ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
+ OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
SetFmtAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
static_cast<sal_uInt16>(nLevel) ) );
}
@@ -673,7 +661,7 @@ int SwTxtFmtColl::GetAttrOutlineLevel() const
int SwTxtFmtColl::GetAssignedOutlineStyleLevel() const
{
- ASSERT( IsAssignedToListLevelOfOutlineStyle(),
+ OSL_ENSURE( IsAssignedToListLevelOfOutlineStyle(),
"<SwTxtFmtColl::GetAssignedOutlineStyleLevel()> - misuse of method");
return GetAttrOutlineLevel() - 1;
}
@@ -683,7 +671,7 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
mbAssignedToOutlineStyle = true;
SetAttrOutlineLevel(nAssignedListLevel+1);
- // --> OD 2009-03-18 #i100277#
+ // #i100277#
SwClientIter aIter( *this );
SwTxtFmtColl* pDerivedTxtFmtColl =
dynamic_cast<SwTxtFmtColl*>(aIter.First( TYPE( SwTxtFmtColl ) ));
@@ -715,3 +703,5 @@ void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()
//<-end,zhaojianwei
//FEATURE::CONDCOLL
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 7395e7ae7449..e0e257505ba7 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -396,3 +397,4 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::ChkNumber( const SwTxtFtn& rTxtFtn )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 607bb4f79c2e..eb1864073088 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -396,7 +397,7 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
SwTableLines& rLns = *pGCPara->pLns;
const SwTableLine* pTmp = pLn;
sal_uInt16 nInsPos = rLns.GetPos( pTmp );
- ASSERT( USHRT_MAX != nInsPos, "Line nicht gefunden!" );
+ OSL_ENSURE( USHRT_MAX != nInsPos, "Line nicht gefunden!" );
SwTableBox* pUpper = pLn->GetUpper();
@@ -449,3 +450,4 @@ void SwTable::GCLines()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 9cef646cffce..8252e86feb2b 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,17 +30,8 @@
#include "precompiled_sw.hxx"
#include "hintids.hxx"
-//#define TEST_DELAYED_RESIZE
-
-#ifdef TEST_DELAYED_RESIZE
-#include <vcl/sound.hxx>
-#endif
-#ifndef _WRKWIN_HXX //autogen
#include <vcl/wrkwin.hxx>
-#endif
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <sot/storage.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
@@ -65,8 +57,6 @@ using namespace ::com::sun::star;
#define MAX_TABWIDTH (USHRT_MAX - 2001)
-/* */
-
class SwHTMLTableLayoutConstraints
{
sal_uInt16 nRow; // Start-Zeile
@@ -95,7 +85,6 @@ public:
sal_uInt16 GetColumn() const { return nCol; }
};
-/* */
SwHTMLTableLayoutCnts::SwHTMLTableLayoutCnts( const SwStartNode *pSttNd,
SwHTMLTableLayout* pTab,
@@ -117,8 +106,6 @@ const SwStartNode *SwHTMLTableLayoutCnts::GetStartNode() const
}
-/* */
-
SwHTMLTableLayoutCell::SwHTMLTableLayoutCell( SwHTMLTableLayoutCnts *pCnts,
sal_uInt16 nRSpan, sal_uInt16 nCSpan,
sal_uInt16 nWidth, sal_Bool bPrcWidth,
@@ -137,7 +124,6 @@ SwHTMLTableLayoutCell::~SwHTMLTableLayoutCell()
}
}
-/* */
SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
sal_Bool bRelWidth,
@@ -150,8 +136,6 @@ SwHTMLTableLayoutColumn::SwHTMLTableLayoutColumn( sal_uInt16 nWidth,
{}
-/* */
-
SwHTMLTableLayoutConstraints::SwHTMLTableLayoutConstraints(
sal_uLong nMin, sal_uLong nMax, sal_uInt16 nRw, sal_uInt16 nColumn, sal_uInt16 nColSp ):
nRow( nRw ), nCol( nColumn ), nColSpan( nColSp ),
@@ -193,7 +177,6 @@ SwHTMLTableLayoutConstraints *SwHTMLTableLayoutConstraints::InsertNext(
return pConstr;
}
-/* */
typedef SwHTMLTableLayoutColumn *SwHTMLTableLayoutColumnPtr;
typedef SwHTMLTableLayoutCell *SwHTMLTableLayoutCellPtr;
@@ -276,7 +259,7 @@ sal_uInt16 SwHTMLTableLayout::GetLeftCellSpace( sal_uInt16 nCol, sal_uInt16 nCol
else if( nCol+nColSpan == nCols && nRightBorderWidth &&
nSpace < MIN_BORDER_DIST )
{
- ASSERT( !nCellPadding, "GetLeftCellSpace: CELLPADDING!=0" );
+ OSL_ENSURE( !nCellPadding, "GetLeftCellSpace: CELLPADDING!=0" );
// Wenn die Gegenueberliegende Seite umrandet ist muessen
// wir zumindest den minimalen Abstand zum Inhalt
// beruecksichtigen. (Koennte man zusaetzlich auch an
@@ -302,7 +285,7 @@ sal_uInt16 SwHTMLTableLayout::GetRightCellSpace( sal_uInt16 nCol, sal_uInt16 nCo
else if( bSwBorders && GetColumn(nCol)->HasLeftBorder() &&
nSpace < MIN_BORDER_DIST )
{
- ASSERT( !nCellPadding, "GetRightCellSpace: CELLPADDING!=0" );
+ OSL_ENSURE( !nCellPadding, "GetRightCellSpace: CELLPADDING!=0" );
// Wenn die Gegenueberliegende Seite umrandet ist muessen
// wir zumindest den minimalen Abstand zum Inhalt
// beruecksichtigen. (Koennte man zusaetzlich auch an
@@ -377,7 +360,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
return (sal_uInt16)pPageFrm->Prt().Width();
}
- // --> OD 2010-05-12 #i91658#
+ // #i91658#
// Assertion removed which state that no browse width is available.
// Investigation reveals that all calls can handle the case that no browse
// width is provided.
@@ -441,9 +424,9 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const
const SwTableBox* pBox = pSwTable->GetTabLines()[0]->GetTabBoxes()[0];
while( 0 == (pBoxSttNd = pBox->GetSttNd()) )
{
- ASSERT( pBox->GetTabLines().Count() > 0,
+ OSL_ENSURE( pBox->GetTabLines().Count() > 0,
"Box ohne Start-Node und Lines" );
- ASSERT( pBox->GetTabLines()[0]->GetTabBoxes().Count() > 0,
+ OSL_ENSURE( pBox->GetTabLines()[0]->GetTabBoxes().Count() > 0,
"Line ohne Boxen" );
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
}
@@ -454,22 +437,19 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const
SwFrmFmt *SwHTMLTableLayout::FindFlyFrmFmt() const
{
const SwTableNode *pTblNd = GetAnyBoxStartNode()->FindTableNode();
- ASSERT( pTblNd, "Kein Table-Node?" );
+ OSL_ENSURE( pTblNd, "Kein Table-Node?" );
return pTblNd->GetFlyFmt();
}
static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlignCnts,
sal_uLong& rAbsMinNoAlignCnts,
-#ifdef FIX41370
- sal_Bool& rHR,
-#endif
SwTxtNode *pTxtNd, sal_uLong nIdx, sal_Bool bNoBreak )
{
pTxtNd->GetMinMaxSize( nIdx, rMinNoAlignCnts, rMaxNoAlignCnts,
rAbsMinNoAlignCnts );
- ASSERT( rAbsMinNoAlignCnts <= rMinNoAlignCnts,
+ OSL_ENSURE( rAbsMinNoAlignCnts <= rMinNoAlignCnts,
"GetMinMaxSize: absmin > min" );
- ASSERT( rMinNoAlignCnts <= rMaxNoAlignCnts,
+ OSL_ENSURE( rMinNoAlignCnts <= rMaxNoAlignCnts,
"GetMinMaxSize: max > min" );
//Bei einen <PRE>-Absatz entspricht die maximale Breite der
@@ -488,14 +468,6 @@ static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlig
rMinNoAlignCnts = rMaxNoAlignCnts;
rAbsMinNoAlignCnts = rMaxNoAlignCnts;
}
-#ifdef FIX41370
- else if( pColl && RES_POOLCOLL_HTML_HR==pColl->GetPoolFmtId() )
- {
- rHR |= !pTxtNd->HasSwAttrSet() ||
- SFX_ITEM_SET != pTxtNd->GetpSwAttrSet()
- ->GetItemState( RES_LR_SPACE, sal_False );
- }
-#endif
}
void SwHTMLTableLayout::AutoLayoutPass1()
@@ -523,7 +495,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
SwHTMLTableLayoutCell *pCell = GetCell(j,i);
SwHTMLTableLayoutCnts *pCnts = pCell->GetContents();
- // fix #31488#: Zum Ermitteln der naechsten zu berechnenden
+ // Zum Ermitteln der naechsten zu berechnenden
// Spalte muessen alle Zeilen herangezogen werden
sal_uInt16 nColSpan = pCell->GetColSpan();
if( nColSpan < nColSkip )
@@ -541,9 +513,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
sal_uLong nAbsMinNoAlignCell = 0;
sal_uLong nMaxTableCell = 0;
sal_uLong nAbsMinTableCell = 0;
-#ifdef FIX41370
- sal_Bool bHR = sal_False;
-#endif
while( pCnts )
{
@@ -564,9 +533,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
lcl_GetMinMaxSize( nMinNoAlignCnts,
nMaxNoAlignCnts,
nAbsMinNoAlignCnts,
-#ifdef FIX41370
- bHR,
-#endif
pTxtNd, nIdx,
pCnts->HasNoBreakTag() );
@@ -618,7 +584,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
else
{
- ASSERT( !this, "Sub tables in HTML import?" )
+ OSL_ENSURE( !this, "Sub tables in HTML import?" );
SwHTMLTableLayout *pChild = pCnts->GetTable();
pChild->AutoLayoutPass1();
sal_uLong nMaxTableCnts = pChild->nMax;
@@ -687,24 +653,6 @@ void SwHTMLTableLayout::AutoLayoutPass1()
nAbsMinNoAlignCell = nWidth;
}
}
-#ifdef FIX41370
- else if( bHR && nWidth>0 && !bRelWidth )
- {
- // Ein kleiner Hack, um einen Bug in Netscape 4.0
- // nachzubilden (siehe #41370#). Wenn eine Zelle eine
- // fixe Breite besitzt und gleichzeitig ein HR, wird
- // sie nie schmaler als die angegebene Breite.
- // (Genaugenomen scheint die Zelle nie schmaler zu werden
- // als die HR-Linie, denn wenn man fuer die Linie eine
- // Breite angibt, die breiter ist als die der Zelle, dann
- // wird die Zelle so breit wie die Linie. Das bekommen wir
- // natuerlich nicht hin.)
- if( nWidth>nMinNoAlignCell )
- nMinNoAlignCell = nWidth;
- if( nWidth>nAbsMinNoAlignCell )
- nAbsMinNoAlignCell = nWidth;
- }
-#endif
// Mindestbreite fuer Inhalt einhalten
if( nMinNoAlignCell < MINLAY )
@@ -773,9 +721,9 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
}
- ASSERT( nMinColSpan>0 && nColSkip>0 && nColSkip <= nMinColSpan,
+ OSL_ENSURE( nMinColSpan>0 && nColSkip>0 && nColSkip <= nMinColSpan,
"Layout Pass 1: Da werden Spalten vergessen!" );
- ASSERT( nMinColSpan!=USHRT_MAX,
+ OSL_ENSURE( nMinColSpan!=USHRT_MAX,
"Layout Pass 1: unnoetiger Schleifendurchlauf oder Bug" );
if( 1==nMinColSpan )
@@ -893,7 +841,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
: nDiff;
nColMin += nAdd;
nMin += nColMin;
- ASSERT( nDiff >= nAdd, "Ooops: nDiff stimmt nicht mehr" );
+ OSL_ENSURE( nDiff >= nAdd, "Ooops: nDiff stimmt nicht mehr" );
nDiff -= nAdd;
if( nColMax < nColMin )
@@ -921,8 +869,8 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->AddToMin( nDiff );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
- "Wieso ist die SPalte auf einmal zu schmal?" )
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
+ "Wieso ist die SPalte auf einmal zu schmal?" );
nMin += nDiff;
nMinD -= nDiff;
@@ -994,7 +942,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
}
}
}
- ASSERT( 0==nRel || nQuot!=ULONG_MAX,
+ OSL_ENSURE( 0==nRel || nQuot!=ULONG_MAX,
"Wo sind die relativen Spalten geblieben?" );
for( i=0; i<nCols; i++ )
{
@@ -1005,7 +953,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->SetMax( pColumn->GetMax() / nQuot );
else
pColumn->SetMax( pColumn->GetMin() );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
"Maximale Spaltenbreite kleiner als Minimale" );
nMax += pColumn->GetMax();
}
@@ -1018,7 +966,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
sal_uLong nRelMax = 0; // Anteil am Maximum dieser Spalten
for( i=0; i<nCols; i++ )
{
- ASSERT( nRel<=100, "relative Breite aller Spalten>100%" );
+ OSL_ENSURE( nRel<=100, "relative Breite aller Spalten>100%" );
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
if( pColumn->IsRelWidthOption() && pColumn->GetWidthOption() )
{
@@ -1105,7 +1053,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
pColumn->SetMax( pColumn->GetMin() );
}
// und durch den Quotienten teilen
- ASSERT( nQuotMax!=ULONG_MAX, "Wo sind die relativen Spalten geblieben?" );
+ OSL_ENSURE( nQuotMax!=ULONG_MAX, "Wo sind die relativen Spalten geblieben?" );
for( i=0; i<nCols; i++ )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( i );
@@ -1114,7 +1062,7 @@ void SwHTMLTableLayout::AutoLayoutPass1()
if( pColumn->GetWidthOption() )
{
pColumn->SetMax( pColumn->GetMax() / nQuotMax );
- ASSERT( pColumn->GetMax() >= pColumn->GetMin(),
+ OSL_ENSURE( pColumn->GetMax() >= pColumn->GetMin(),
"Minimalbreite ein Spalte Groesser Maximum" );
if( pColumn->GetMax() < pColumn->GetMin() )
pColumn->SetMax( pColumn->GetMin() );
@@ -1141,16 +1089,16 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Eine abolute zur Verfuegung stehende Breite muss immer uebergeben
// werden.
- ASSERT( nAbsAvail, "AutoLayout Pass 2: Keine absolute Breite gegeben" );
+ OSL_ENSURE( nAbsAvail, "AutoLayout Pass 2: Keine absolute Breite gegeben" );
// Eine realtive zur Verfuegung stehende Breite darf nur und muss fuer
// Tabellen in Tabellen uebergeben
- ASSERT( IsTopTable() == (nRelAvail==0),
+ OSL_ENSURE( IsTopTable() == (nRelAvail==0),
"AutoLayout Pass 2: Rel. Breite bei Tab in Tab oder umgekehrt" );
// Die Minimalbreite der Tabelle darf natuerlich nie groesser sein
// als das die Maximalbreite.
- ASSERT( nMin<=nMax, "AutoLayout Pass2: nMin > nMax" );
+ OSL_ENSURE( nMin<=nMax, "AutoLayout Pass2: nMin > nMax" );
// Die verfuegbare Breite, fuer die die Tabelle berechnet wurde, merken.
// (Dies ist ein guter Ort, denn hier kommer wir bei der Erstberechnung
@@ -1219,7 +1167,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
{
if( bPrcWidthOption )
{
- ASSERT( nWidthOption<=100, "Prozentangabe zu gross" );
+ OSL_ENSURE( nWidthOption<=100, "Prozentangabe zu gross" );
if( nWidthOption > 100 )
nWidthOption = 100;
@@ -1233,7 +1181,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Weil bei Tabellen in Rahmen kein Resize aufgerufen wird,
// wenn der Rahmen eine nicht-relative Breite besitzt, koennen
// wir da solche Spielchen nicht spielen
- // MIB 19.2.98: Wegen fix #47394# spielen wir solche Spielchen
+ // Spielen wir solche Spielchen
// jetzt doch. Dort war eine Grafik in einer 1%-breiten
// Tabelle und hat da natuerlich nicht hineingepasst.
nAbsTabWidth = (sal_uInt16)( ((sal_uLong)nAbsAvail * nWidthOption) / 100 );
@@ -1257,9 +1205,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
}
}
- ASSERT( IsTopTable() || nAbsTabWidth<=nAbsAvail,
+ OSL_ENSURE( IsTopTable() || nAbsTabWidth<=nAbsAvail,
"AutoLayout Pass2: nAbsTabWidth > nAbsAvail fuer Tab in Tab" );
- ASSERT( !nRelAvail || nAbsTabWidth<=nAbsAvail,
+ OSL_ENSURE( !nRelAvail || nAbsTabWidth<=nAbsAvail,
"AutoLayout Pass2: nAbsTabWidth > nAbsAvail fuer relative Breite" );
// Catch fuer die beiden Asserts von oben (man weiss ja nie!)
@@ -1383,7 +1331,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Eine Top-Table darf auch beriter werden als der verfuegbare Platz.
if( nAbsTabWidth > nAbsAvail )
{
- ASSERT( IsTopTable(),
+ OSL_ENSURE( IsTopTable(),
"Tabelle in Tabelle soll breiter werden als umgebende Zelle" );
nAbsAvail = nAbsTabWidth;
}
@@ -1413,7 +1361,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// die ihre Maximalbreite genau einhalten, also weder
// schmaler noch breiter werden. Beim zurueckrechnen der
// absoluten Breite aus der relativen Breite kann es
- // zu Rundungsfehlern kommen (bug #45598#). Um die auszugeleichen
+ // zu Rundungsfehlern kommen. Um die auszugeleichen
// werden zuerst die fixen Breiten entsprechend korrigiert
// eingestellt und erst danach die relativen.
@@ -1450,7 +1398,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// absoluten Breiten. nFixMax entspricht an dieser Stelle
// nAbs, so dass man gleich nFixMax haette nehmen koennen.
// Der Code ist so aber verstaendlicher.
- ASSERT( nFixMax == nAbs, "Zwei Schleifen, zwei Summen?" )
+ OSL_ENSURE( nFixMax == nAbs, "Zwei Schleifen, zwei Summen?" );
sal_uLong nDistMax = nMax - nFixMax;
sal_uInt16 nDistAbsTabWidth = nAbsTabWidth - nAbs;
sal_uInt16 nDistRelTabWidth = nRelTabWidth - nRel;
@@ -1479,7 +1427,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
nRel = nRel + pColumn->GetRelColWidth();
}
}
- ASSERT( nCols==nFixedCols, "Spalte vergessen!" );
+ OSL_ENSURE( nCols==nFixedCols, "Spalte vergessen!" );
}
else
{
@@ -1506,7 +1454,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nAbsTabWidth > nAbsAvail )
{
- ASSERT( IsTopTable(),
+ OSL_ENSURE( IsTopTable(),
"Tabelle in Tabelle soll breiter werden als Platz da ist" );
nAbsAvail = nAbsTabWidth;
}
@@ -1578,9 +1526,9 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
break;
}
- ASSERT( !pLeftFillerBox || nRelLeftFill>0,
+ OSL_ENSURE( !pLeftFillerBox || nRelLeftFill>0,
"Fuer linke Filler-Box ist keine Breite da!" );
- ASSERT( !pRightFillerBox || nRelRightFill>0,
+ OSL_ENSURE( !pRightFillerBox || nRelRightFill>0,
"Fuer rechte Filler-Box ist keine Breite da!" );
// Filler-Breiten werden auf die ausseren Spalten geschlagen, wenn
@@ -1591,7 +1539,6 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nRelLeftFill && !pLeftFillerBox &&
( nWidthSet>0 || nAbsLeftFill<MINLAY+nInhLeftBorderWidth ||
(HasColTags() && nAbsLeftFill < nAbsLeftSpace+nParentInhAbsLeftSpace+20) ) )
-// (nAbsLeftFill<MINLAY || nAbsLeftFill<=nAbsLeftSpace) )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( 0 );
pColumn->SetAbsColWidth( pColumn->GetAbsColWidth()+nAbsLeftFill );
@@ -1602,7 +1549,6 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
if( nRelRightFill && !pRightFillerBox &&
( nWidthSet>0 || nAbsRightFill<MINLAY+nInhRightBorderWidth ||
(HasColTags() && nAbsRightFill < nAbsRightSpace+nParentInhAbsRightSpace+20) ) )
-// (nAbsRightFill<MINLAY || nAbsRightFill<=nAbsRightSpace) )
{
SwHTMLTableLayoutColumn *pColumn = GetColumn( nCols-1 );
pColumn->SetAbsColWidth( pColumn->GetAbsColWidth()+nAbsRightFill );
@@ -1637,14 +1583,14 @@ static sal_Bool lcl_ResizeBox( const SwTableBox*& rpBox, void* pPara )
static sal_Bool lcl_ResizeLine( const SwTableLine*& rpLine, void* pPara )
{
sal_uInt16 *pWidth = (sal_uInt16 *)pPara;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nOldWidth = *pWidth;
#endif
*pWidth = 0;
((SwTableLine *)rpLine)->GetTabBoxes().ForEach( &lcl_ResizeBox, pWidth );
-#ifdef DBG_UTIL
- ASSERT( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY,
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !nOldWidth || Abs(*pWidth-nOldWidth) < COLFUZZY,
"Zeilen einer Box sind unterschiedlich lang" );
#endif
@@ -1718,7 +1664,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail,
sal_uInt16 nCalcTabWidth = 0;
((SwTable *)pSwTable)->GetTabLines().ForEach( &lcl_ResizeLine,
&nCalcTabWidth );
- ASSERT( Abs( nRelTabWidth-nCalcTabWidth ) < COLFUZZY,
+ OSL_ENSURE( Abs( nRelTabWidth-nCalcTabWidth ) < COLFUZZY,
"Tabellebreite stimmt nicht mit Zeilenbreite ueberein." );
// Beim Anpassen des Tabellen-Formats dieses locken, weil sonst
@@ -1754,7 +1700,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail,
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
// steht im tblrwcl.cxx
extern void _CheckBoxWidth( const SwTableLine&, SwTwips );
@@ -1805,9 +1751,6 @@ void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
{
-#ifdef TEST_DELAYED_RESIZE
- Sound::Beep( SOUND_WARNING );
-#endif
pThis->aResizeTimer.Stop();
pThis->_Resize( pThis->nDelayedResizeAbsAvail,
pThis->bDelayedResizeRecalc );
@@ -1821,7 +1764,7 @@ sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
{
if( 0 == nAbsAvail )
return sal_False;
- ASSERT( IsTopTable(), "Resize darf nur an Top-Tabellen aufgerufen werden" );
+ OSL_ENSURE( IsTopTable(), "Resize darf nur an Top-Tabellen aufgerufen werden" );
// Darf die Tabelle uberhaupt Resized werden oder soll sie es trotzdem?
if( bMustNotResize && !bForce )
@@ -1881,9 +1824,6 @@ sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
bDelayedResizeRecalc = bRecalc;
aResizeTimer.SetTimeout( nDelay );
aResizeTimer.Start();
-#ifdef TEST_DELAYED_RESIZE
- Sound::Beep( SOUND_DEFAULT );
-#endif
}
else
{
@@ -1901,3 +1841,4 @@ void SwHTMLTableLayout::BordersChanged( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 7490cf9f0719..8addb27cf01e 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "lineinfo.hxx"
#include "charfmt.hxx"
@@ -135,7 +134,7 @@ SwCharFmt* SwLineNumberInfo::GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) cons
void SwLineNumberInfo::SetCharFmt( SwCharFmt *pChFmt )
{
- ASSERT( pChFmt, "SetCharFmt, 0 is not a valid pointer" );
+ OSL_ENSURE( pChFmt, "SetCharFmt, 0 is not a valid pointer" );
pChFmt->Add( this );
}
@@ -152,3 +151,4 @@ void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index 81f139bba99e..3fc2ee0500dd 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -289,15 +290,4 @@ bool SwList::IsListLevelMarked( const int nListLevel ) const
return mpListImpl->IsListLevelMarked( nListLevel );
}
-//void SwList::ContinueList( SwList& rList )
-//{
-// mpListImpl->ContinueList( rList );
-//}
-//const SwList* SwList::GetContinuedList() const
-//{
-// return mpListImpl->GetContinuedList();
-//}
-//void SwList::ClearContinuation()
-//{
-// mpListImpl->ClearContinuation();
-//}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 8721d5d21164..15aaccd7c9a1 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,9 +79,7 @@
#include <svtools/embedhlp.hxx>
#include <svtools/chartprettypainter.hxx>
-// --> OD 2009-03-05 #i99665#
-#include <dview.hxx>
-// <--
+#include <dview.hxx> // #i99665#
using namespace com::sun::star;
@@ -153,10 +152,6 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
|*
|* SwGrfFrm::SwGrfFrm(ViewShell * const,SwGrfNode *)
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 03. Mar. 93
-|*
*************************************************************************/
@@ -183,10 +178,6 @@ void SwNoTxtFrm::InitCtor()
|*
|* SwNoTxtNode::MakeFrm()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 03. Mar. 93
-|*
*************************************************************************/
@@ -199,10 +190,6 @@ SwCntntFrm *SwNoTxtNode::MakeFrm()
|*
|* SwNoTxtFrm::~SwNoTxtFrm()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 30. Apr. 96
-|*
*************************************************************************/
SwNoTxtFrm::~SwNoTxtFrm()
@@ -214,10 +201,6 @@ SwNoTxtFrm::~SwNoTxtFrm()
|*
|* void SwNoTxtFrm::Modify( SwHint * pOld, SwHint * pNew )
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung JP 05.03.91
-|*
*************************************************************************/
void SetOutDev( ViewShell *pSh, OutputDevice *pOut )
@@ -243,7 +226,6 @@ void lcl_ClearArea( const SwFrm &rFrm,
::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
else
{
- // OD 2004-04-23 #116347#
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
rOut.SetFillColor( rFrm.GetShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
@@ -258,10 +240,6 @@ void lcl_ClearArea( const SwFrm &rFrm,
|*
|* void SwNoTxtFrm::Paint()
|*
-|* Beschreibung
-|* Ersterstellung JP 05.03.91
-|* Letzte Aenderung MA 10. Jan. 97
-|*
*************************************************************************/
void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
@@ -273,7 +251,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
- // OD 10.01.2003 #i6467# - no paint of placeholder for page preview
+ // #i6467# - no paint of placeholder for page preview
if ( pSh->GetWin() && !pSh->IsPreView() )
{
const SwNoTxtNode* pNd = GetNode()->GetNoTxtNode();
@@ -305,7 +283,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( pGrfNd )
pGrfNd->SetFrameInPaint( sal_True );
- // OD 16.04.2003 #i13147# - add 2nd parameter with value <sal_True> to
+ // #i13147# - add 2nd parameter with value <sal_True> to
// method call <FindFlyFrm().GetContour(..)> to indicate that it is called
// for paint in order to avoid load of the intrinsic graphic.
if ( ( !pOut->GetConnectMetaFile() ||
@@ -342,7 +320,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( bClip )
pOut->IntersectClipRegion( aPaintArea.SVRect() );
- /// OD 25.09.2002 #99739# - delete unused 3rd parameter
+ /// delete unused 3rd parameter
PaintPicture( pOut, aGrfArea );
}
else
@@ -366,8 +344,6 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|* Parameter Point& die Position im Frame ( auch Return-Wert )
|* Size& die Groesse der Grafik ( auch Return-Wert )
|* MirrorGrf akt. Spiegelungs-Attribut
-|* Ersterstellung JP 04.03.91
-|* Letzte Aenderung JP 31.08.94
|*
*************************************************************************/
@@ -394,17 +370,13 @@ void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror )
|* Beschreibung Errechne die Position und die Groesse der Bitmap
|* innerhalb des uebergebenem Rechtecks.
|*
-|* Ersterstellung JP 03.09.91
-|* Letzte Aenderung MA 11. Oct. 94
-|*
*************************************************************************/
void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
sal_Bool ) const
{
- // JP 23.01.2001: currently only used for scaling, cropping and mirroring
- // the contour of graphics!
- // all other is handled by the GraphicObject
+ //currently only used for scaling, cropping and mirroring the contour of graphics!
+ //all other is handled by the GraphicObject
//In rRect wird das sichbare Rechteck der Grafik gesteckt.
//In pOrigRect werden Pos+Size der Gesamtgrafik gesteck.
@@ -522,8 +494,6 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
|*
|* Beschreibung Gebe die Groesse des umgebenen FLys und
|* damit die der Grafik zurueck.
-|* Ersterstellung JP 04.03.91
-|* Letzte Aenderung JP 31.08.94
|*
*************************************************************************/
@@ -541,9 +511,6 @@ const Size& SwNoTxtFrm::GetSize() const
|*
|* SwNoTxtFrm::MakeAll()
|*
-|* Ersterstellung MA 29. Nov. 96
-|* Letzte Aenderung MA 29. Nov. 96
-|*
*************************************************************************/
@@ -574,8 +541,6 @@ void SwNoTxtFrm::MakeAll()
|* SwNoTxtFrm::Format()
|*
|* Beschreibung Errechne die Groesse der Bitmap, wenn noetig
-|* Ersterstellung JP 11.03.91
-|* Letzte Aenderung MA 13. Mar. 96
|*
*************************************************************************/
@@ -598,10 +563,6 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * )
|*
|* SwNoTxtFrm::GetCharRect()
|*
-|* Beschreibung
-|* Ersterstellung SS 29-Apr-1991
-|* Letzte Aenderung MA 10. Oct. 94
-|*
|*************************************************************************/
@@ -665,7 +626,7 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
- // --> OD 2007-03-06 #i73788#
+ // #i73788#
// no <SwCntntFrm::Modify(..)> for RES_LINKED_GRAPHIC_STREAM_ARRIVED
if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich &&
RES_GRAPHIC_ARRIVED != nWhich &&
@@ -737,10 +698,8 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_GRAPHIC_PIECE_ARRIVED:
case RES_GRAPHIC_ARRIVED:
- // --> OD 2007-03-06 #i73788#
- // handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
+ // i73788# - handle RES_LINKED_GRAPHIC_STREAM_ARRIVED as RES_GRAPHIC_ARRIVED
case RES_LINKED_GRAPHIC_STREAM_ARRIVED:
- // <--
if ( GetNode()->GetNodeType() == ND_GRFNODE )
{
bComplete = sal_False;
@@ -766,7 +725,7 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
else if ( pSh->VisArea().IsOver( aRect ) &&
OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() )
{
- // OD 27.11.2002 #105519# - invalidate instead of painting
+ //invalidate instead of painting
pSh->GetWin()->Invalidate( aRect.SVRect() );
}
@@ -819,9 +778,9 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
// Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder
// eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird
// eine Ersatzdarstellung ausgegeben.
-/// OD 25.09.2002 #99739# - delete unused 3rd parameter.
-/// OD 25.09.2002 #99739# - use aligned rectangle for drawing graphic.
-/// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
+/// delete unused 3rd parameter.
+/// use aligned rectangle for drawing graphic.
+/// pixel-align coordinations for drawing graphic.
void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
{
ViewShell* pShell = GetShell();
@@ -835,7 +794,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
- /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
+ /// calculate aligned rectangle from parameter <rGrfArea>.
/// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
/// the following code.
SwRect aAlignedGrfArea = rGrfArea;
@@ -843,7 +802,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( !bIsChart )
{
- /// OD 25.09.2002 #99739#
/// Because for drawing a graphic left-top-corner and size coordinations are
/// used, these coordinations have to be determined on pixel level.
::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
@@ -868,14 +826,13 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
if( !bPrn )
{
- // --> OD 2007-01-02 #i73788#
+ // #i73788#
if ( pGrfNd->IsLinkedInputStreamReady() )
{
pGrfNd->UpdateLinkWithInputStream();
}
// <--
- // --> OD 2008-01-30 #i85717#
- // --> OD 2008-07-21 #i90395# - check, if asynchronous retrieval
+ // #i85717#, #i90395# - check, if asynchronous retrieval
// if input stream for the graphic is possible
// else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT ||
@@ -891,9 +848,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
!(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
!aTmpSz.Height() || !pGrfNd->GetAutoFmtLvl() )
{
- // --> OD 2006-12-22 #i73788#
- pGrfNd->TriggerAsyncRetrieveInputStream();
- // <--
+ pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
}
String aTxt( pGrfNd->GetTitle() );
if ( !aTxt.Len() )
@@ -936,7 +891,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
else
pVout = 0;
- ASSERT( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
+ OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
pShell->GetViewOptions()->IsPDFExport(),
"pOut sollte kein virtuelles Device sein" );
@@ -991,7 +946,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
}
else if( pOLENd )
{
- // --> OD 2009-03-05 #i99665#
+ // #i99665#
// Adjust AntiAliasing mode at output device for chart OLE
const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
if ( pOLENd->IsChart() &&
@@ -1014,18 +969,10 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pJobSetup = new JobSetup();
// #i42323#
- // The reason for #114233# is gone, so i remove it again
//TODO/LATER: is it a problem that the JopSetup isn't used?
//xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup );
- // get hi-contrast image, but never for printing
- Graphic* pGraphic = NULL;
- if (pOut && !bPrn && Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- pGraphic = pOLENd->GetHCGraphic();
-
- // when it is not possible to get HC-representation, the original image should be used
- if ( !pGraphic )
- pGraphic = pOLENd->GetGraphic();
+ Graphic* pGraphic = pOLENd->GetGraphic();
if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE )
{
@@ -1049,11 +996,11 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
{
const SwFlyFrm *pFly = FindFlyFrm();
- ASSERT( pFly, "OLE not in FlyFrm" );
+ OSL_ENSURE( pFly, "OLE not in FlyFrm" );
((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm());
}
- // --> OD 2009-03-05 #i99665#
+ // #i99665#
if ( pOLENd->IsChart() &&
pShell->Imp()->GetDrawView()->IsAntiAliasing() )
{
@@ -1096,3 +1043,4 @@ sal_Bool SwNoTxtFrm::HasAnimation() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 2333169f2222..1f6a31036de8 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,28 +45,23 @@
#include <frmfmt.hxx>
#include <ndtxt.hxx>
#include <docary.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <SwStyleNameMapper.hxx>
-// --> OD 2006-06-28 #b6440955#
+
// Needed to load default bullet list configuration
#include <unotools/configitem.hxx>
-// <--
+
#include <numrule.hxx>
#include <SwNodeNum.hxx>
-#include <hash_map>
-// --> OD 2008-02-19 #refactorlists#
+#include <boost/unordered_map.hpp>
+
#include <list.hxx>
#include <algorithm>
-// <--
-// --> OD 2008-06-06 #i89178#
+
#include <unotools/saveopt.hxx>
-// <--
-// --> OD 2008-07-08 #i91400#
+
#include <IDocumentListsAccess.hxx>
-// <--
using namespace ::com::sun::star;
@@ -73,14 +69,13 @@ using namespace ::com::sun::star;
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#
+
SwNumFmt* SwNumRule::aLabelAlignmentBaseFmts[ RULE_END ][ MAXLEVEL ] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
char sOutline[] = "Outline";
char* SwNumRule::pDefOutlineName = sOutline;
-// #i30312#
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,
@@ -89,21 +84,19 @@ sal_uInt16 SwNumRule::aDefNumIndents[ MAXLEVEL ] = {
const SwNumFmt& SwNumRule::Get( sal_uInt16 i ) const
{
- ASSERT_ID( i < MAXLEVEL && eRuleType < RULE_END, ERR_NUMLEVEL);
+ OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END );
return aFmts[ i ]
? *aFmts[ i ]
- // --> OD 2008-02-11 #newlistlevelattrs#
: ( meDefaultNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
? *aBaseFmts[ eRuleType ][ i ]
: *aLabelAlignmentBaseFmts[ eRuleType ][ i ] );
- // <--
}
const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
{
const SwNumFmt * pResult = NULL;
- ASSERT_ID( i < MAXLEVEL && eRuleType < RULE_END, ERR_NUMLEVEL);
+ OSL_ASSERT( i < MAXLEVEL && eRuleType < RULE_END );
if ( i < MAXLEVEL && eRuleType < RULE_END)
{
pResult = aFmts[ i ];
@@ -112,7 +105,7 @@ const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
return pResult;
}
-// --> OD 2008-07-08 #i91400#
+// #i91400#
void SwNumRule::SetName( const String & rName,
IDocumentListsAccess& rDocListAccess)
// <--
@@ -124,29 +117,29 @@ void SwNumRule::SetName( const String & rName,
pNumRuleMap->erase(sName);
(*pNumRuleMap)[rName] = this;
- // --> OD 2008-07-08 #i91400#
if ( GetDefaultListId().Len() > 0 )
{
rDocListAccess.trackChangeOfListStyleName( sName, rName );
}
- // <--
}
sName = rName;
}
}
-// --> OD 2008-02-19 #refactorlists#
+
void SwNumRule::GetTxtNodeList( SwNumRule::tTxtNodeList& rTxtNodeList ) const
{
rTxtNodeList = maTxtNodeList;
}
+
SwNumRule::tTxtNodeList::size_type SwNumRule::GetTxtNodeListSize() const
{
return maTxtNodeList.size();
}
+
void SwNumRule::AddTxtNode( SwTxtNode& rTxtNode )
{
tTxtNodeList::iterator aIter =
@@ -158,6 +151,7 @@ void SwNumRule::AddTxtNode( SwTxtNode& rTxtNode )
}
}
+
void SwNumRule::RemoveTxtNode( SwTxtNode& rTxtNode )
{
tTxtNodeList::iterator aIter =
@@ -168,9 +162,9 @@ void SwNumRule::RemoveTxtNode( SwTxtNode& rTxtNode )
maTxtNodeList.erase( aIter );
}
}
-// <--
-void SwNumRule::SetNumRuleMap(std::hash_map<String, SwNumRule *, StringHash> *
+
+void SwNumRule::SetNumRuleMap(boost::unordered_map<String, SwNumRule *, StringHash> *
_pNumRuleMap)
{
pNumRuleMap = _pNumRuleMap;
@@ -178,35 +172,29 @@ void SwNumRule::SetNumRuleMap(std::hash_map<String, SwNumRule *, StringHash> *
sal_uInt16 SwNumRule::GetNumIndent( sal_uInt8 nLvl )
{
- ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
+ OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
}
sal_uInt16 SwNumRule::GetBullIndent( sal_uInt8 nLvl )
{
- ASSERT( MAXLEVEL > nLvl, "NumLevel is out of range" );
+ OSL_ENSURE( MAXLEVEL > nLvl, "NumLevel is out of range" );
return aDefNumIndents[ nLvl ];
}
-
-
static void lcl_SetRuleChgd( SwTxtNode& rNd, sal_uInt8 nLevel )
{
if( rNd.GetActualListLevel() == nLevel )
rNd.NumRuleChgd();
}
-/* -----------------------------22.02.01 13:41--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt() :
SvxNumberFormat(SVX_NUM_ARABIC),
SwClient( 0 ),
pVertOrient(new SwFmtVertOrient( 0, text::VertOrientation::NONE))
{
}
-/* -----------------------------22.02.01 13:42--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SvxNumberFormat(rFmt),
SwClient( rFmt.pRegisteredIn ),
@@ -216,9 +204,7 @@ SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SetGraphicBrush( rFmt.GetBrush(), &rFmt.GetGraphicSize(),
&eMyVertOrient);
}
-/* -----------------------------22.02.01 13:58--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
SvxNumberFormat(rNumFmt),
pVertOrient(new SwFmtVertOrient( 0, rNumFmt.GetVertOrient()))
@@ -244,16 +230,12 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
pRegisteredIn->Remove( this );
}
-/* -----------------------------22.02.01 13:42--------------------------------
- ---------------------------------------------------------------------------*/
SwNumFmt::~SwNumFmt()
{
delete pVertOrient;
}
-/* -----------------------------02.07.01 15:37--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::NotifyGraphicArrived()
{
if( GetCharFmt() )
@@ -267,34 +249,9 @@ sal_Bool SwNumFmt::IsEnumeration() const
// using this code. Therefore HBRINKM and I agreed upon defining
// IsEnumeration() as !IsItemize()
return !IsItemize();
- // <--
-
- /*
- sal_Bool bResult;
-
- switch(GetNumberingType())
- {
- case SVX_NUM_CHARS_UPPER_LETTER:
- case SVX_NUM_CHARS_LOWER_LETTER:
- case SVX_NUM_ROMAN_UPPER:
- case SVX_NUM_ROMAN_LOWER:
- case SVX_NUM_ARABIC:
- case SVX_NUM_PAGEDESC:
- case SVX_NUM_CHARS_UPPER_LETTER_N:
- case SVX_NUM_CHARS_LOWER_LETTER_N:
- bResult = sal_True;
-
- break;
-
- default:
- bResult = sal_False;
- }
-
- return bResult;
- */
}
-// #i29560#
+
sal_Bool SwNumFmt::IsItemize() const
{
sal_Bool bResult;
@@ -315,10 +272,6 @@ sal_Bool SwNumFmt::IsItemize() const
}
-
-/* -----------------------------23.02.01 09:28--------------------------------
-
- ---------------------------------------------------------------------------*/
SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
{
SvxNumberFormat::operator=(rNumFmt);
@@ -328,9 +281,7 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
pRegisteredIn->Remove( this );
return *this;
}
-/* -----------------------------23.02.01 09:28--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) &&
@@ -338,9 +289,6 @@ sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
return bRet;
}
-/* -----------------------------22.02.01 13:44--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
{
if( pChFmt )
@@ -348,9 +296,7 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
else if( GetRegisteredIn() )
pRegisteredIn->Remove( this );
}
-/* -----------------------------22.02.01 13:45--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
// dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses
@@ -369,16 +315,12 @@ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
else
SwClient::Modify( pOld, pNew );
}
-/* -----------------------------23.02.01 11:08--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetCharFmtName(const String& rSet)
{
SvxNumberFormat::SetCharFmtName(rSet);
}
-/* -----------------------------22.02.01 13:47--------------------------------
- ---------------------------------------------------------------------------*/
const String& SwNumFmt::GetCharFmtName() const
{
if((SwCharFmt*)pRegisteredIn)
@@ -386,9 +328,7 @@ const String& SwNumFmt::GetCharFmtName() const
else
return aEmptyStr;
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize,
const sal_Int16* pOrient)
{
@@ -396,23 +336,17 @@ void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* p
pVertOrient->SetVertOrient( *pOrient );
SvxNumberFormat::SetGraphicBrush( pBrushItem, pSize, pOrient);
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::SetVertOrient(sal_Int16 eSet)
{
SvxNumberFormat::SetVertOrient(eSet);
}
-/* -----------------------------22.02.01 16:05--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 SwNumFmt::GetVertOrient() const
{
return SvxNumberFormat::GetVertOrient();
}
-/* -----------------------------22.02.01 13:54--------------------------------
- ---------------------------------------------------------------------------*/
void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
{
sal_Bool bDocIsModified = pDoc->IsModified();
@@ -424,33 +358,6 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
for( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
if( pRule->GetNumFmt( i ) == this )
{
- // --> OD 2008-02-19 #refactorlists#
-// const String& rRuleNm = pRule->GetName();
-
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 k, nMaxItems = pDoc->GetAttrPool().GetItemCount(
-// RES_PARATR_NUMRULE );
-// for( k = 0; k < nMaxItems; ++k )
-// if( 0 != (pItem = pDoc->GetAttrPool().GetItem(
-// RES_PARATR_NUMRULE, k ) ) &&
-// 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->
-// GetDefinedIn()) &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rRuleNm )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// {
-// SwNumRuleInfo aInfo( rRuleNm );
-// pMod->GetInfo( aInfo );
-
-// for( sal_uLong nFirst = 0, nLast = aInfo.GetList().Count();
-// nFirst < nLast; ++nFirst )
-// lcl_SetRuleChgd(
-// *aInfo.GetList().GetObject( nFirst ), i );
-// }
-// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
-// lcl_SetRuleChgd( *(SwTxtNode*)pMod, i );
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
pRule->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aIter = aTxtNodeList.begin();
@@ -467,9 +374,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
if( bFnd && !bDocIsModified )
pDoc->ResetModified();
}
-/* -----------------------------31.05.01 16:08--------------------------------
- ---------------------------------------------------------------------------*/
const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const
{
sal_Int16 eOrient = SvxNumberFormat::GetVertOrient();
@@ -482,20 +387,17 @@ const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
long int SwNumRule::nInstances = 0;
#endif
-// --> OD 2008-02-11 #newlistlevelattrs#
// handle new parameter <eDefaultNumberFormatPositionAndSpaceMode>
SwNumRule::SwNumRule( const String& rNm,
const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode,
SwNumRuleType eType,
sal_Bool bAutoFlg )
: maTxtNodeList(),
- // --> OD 2008-03-03 #refactorlists#
maParagraphStyleList(),
- // <--
pNumRuleMap(0),
sName( rNm ),
eRuleType( eType ),
@@ -506,17 +408,11 @@ SwNumRule::SwNumRule( const String& rNm,
bInvalidRuleFlag( sal_True ),
bContinusNum( sal_False ),
bAbsSpaces( sal_False ),
- // --> OD 2005-10-21 - initialize member <mbCountPhantoms>
mbCountPhantoms( true ),
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
meDefaultNumberFormatPositionAndSpaceMode( eDefaultNumberFormatPositionAndSpaceMode ),
- // <--
- // --> OD 2008-04-03 #refactorlists#
msDefaultListId()
- // <--
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nSerial = nInstances++;
#endif
@@ -536,12 +432,9 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetAbsLSpace( lNumIndent + SwNumRule::GetNumIndent( n ) );
pFmt->SetFirstLineOffset( lNumFirstLineOffset );
pFmt->SetSuffix( aDotStr );
- // --> OD 2006-06-29 #b6440955#
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
- // <--
SwNumRule::aBaseFmts[ NUM_RULE ][ n ] = pFmt;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
// position-and-space mode LABEL_ALIGNMENT
// first line indent of general numbering in inch: -0,25 inch
const long cFirstLineIndent = -1440/4;
@@ -556,18 +449,15 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt = new SwNumFmt;
pFmt->SetIncludeUpperLevels( 1 );
pFmt->SetStart( 1 );
- // --> OD 2008-01-15 #newlistlevelattrs#
pFmt->SetPositionAndSpaceMode( SvxNumberFormat::LABEL_ALIGNMENT );
pFmt->SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
pFmt->SetListtabPos( cIndentAt[ n ] );
pFmt->SetFirstLineIndent( cFirstLineIndent );
pFmt->SetIndentAt( cIndentAt[ n ] );
- // <--
pFmt->SetSuffix( aDotStr );
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
SwNumRule::aLabelAlignmentBaseFmts[ NUM_RULE ][ n ] = pFmt;
}
- // <--
// outline:
// position-and-space mode LABEL_WIDTH_AND_POSITION:
@@ -578,12 +468,9 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetIncludeUpperLevels( MAXLEVEL );
pFmt->SetStart( 1 );
pFmt->SetCharTextDistance( lOutlineMinTextDistance );
- // --> OD 2006-06-29 #b6440955#
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
- // <--
SwNumRule::aBaseFmts[ OUTLINE_RULE ][ n ] = pFmt;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
// position-and-space mode LABEL_ALIGNMENT:
// indent values of default outline numbering in inch:
// 0,3 0,4 0,5 0,6 0,7
@@ -605,17 +492,14 @@ SwNumRule::SwNumRule( const String& rNm,
pFmt->SetBulletChar( numfunc::GetBulletChar(n));
SwNumRule::aLabelAlignmentBaseFmts[ OUTLINE_RULE ][ n ] = pFmt;
}
- // <--
}
memset( aFmts, 0, sizeof( aFmts ));
- ASSERT( sName.Len(), "NumRule ohne Namen!" );
+ OSL_ENSURE( sName.Len(), "NumRule ohne Namen!" );
}
SwNumRule::SwNumRule( const SwNumRule& rNumRule )
: maTxtNodeList(),
- // --> OD 2008-03-03 #refactorlists#
maParagraphStyleList(),
- // <--
pNumRuleMap(0),
sName( rNumRule.sName ),
eRuleType( rNumRule.eRuleType ),
@@ -626,17 +510,11 @@ SwNumRule::SwNumRule( const SwNumRule& rNumRule )
bInvalidRuleFlag( sal_True ),
bContinusNum( rNumRule.bContinusNum ),
bAbsSpaces( rNumRule.bAbsSpaces ),
- // --> OD 2005-10-21 - initialize member <mbCountPhantoms>
mbCountPhantoms( true ),
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
meDefaultNumberFormatPositionAndSpaceMode( rNumRule.meDefaultNumberFormatPositionAndSpaceMode ),
- // <--
- // --> OD 2008-04-03 #refactorlists#
msDefaultListId( rNumRule.msDefaultListId )
- // <--
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nSerial = nInstances++;
#endif
@@ -670,19 +548,15 @@ SwNumRule::~SwNumRule()
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
- // --> OD 2008-02-11 #newlistlevelattrs#
ppFmts = (SwNumFmt**)SwNumRule::aLabelAlignmentBaseFmts;
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
for( n = 0; n < MAXLEVEL; ++n, ++ppFmts )
delete *ppFmts, *ppFmts = 0;
- // <--
}
- // --> OD 2008-02-19 #refactorlists#
maTxtNodeList.clear();
maParagraphStyleList.clear();
- // <--
}
void SwNumRule::CheckCharFmts( SwDoc* pDoc )
@@ -720,7 +594,6 @@ SwNumRule& SwNumRule::operator=( const SwNumRule& rNumRule )
return *this;
}
-
sal_Bool SwNumRule::operator==( const SwNumRule& rRule ) const
{
sal_Bool bRet = eRuleType == rRule.eRuleType &&
@@ -743,10 +616,9 @@ sal_Bool SwNumRule::operator==( const SwNumRule& rRule ) const
return bRet;
}
-
void SwNumRule::Set( sal_uInt16 i, const SwNumFmt& rNumFmt )
{
- ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
+ OSL_ENSURE( i < MAXLEVEL, "Serious defect, please inform OD" );
if( i < MAXLEVEL )
{
if( !aFmts[ i ] || !(rNumFmt == Get( i )) )
@@ -760,7 +632,7 @@ void SwNumRule::Set( sal_uInt16 i, const SwNumFmt& rNumFmt )
void SwNumRule::Set( sal_uInt16 i, const SwNumFmt* pNumFmt )
{
- ASSERT( i < MAXLEVEL, "Serious defect, please inform OD" )
+ OSL_ENSURE( i < MAXLEVEL, "Serious defect, please inform OD" );
if( i >= MAXLEVEL )
return;
SwNumFmt* pOld = aFmts[ i ];
@@ -778,7 +650,6 @@ void SwNumRule::Set( sal_uInt16 i, const SwNumFmt* pNumFmt )
*pOld = *pNumFmt, bInvalidRuleFlag = sal_True;
}
-
String SwNumRule::MakeNumString( const SwNodeNum& rNum, sal_Bool bInclStrings,
sal_Bool bOnlyArabic ) const
{
@@ -799,28 +670,22 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
String aStr;
unsigned int nLevel = rNumVector.size() - 1;
- // --> OD 2005-10-17 #126238#
+
if ( nLevel > _nRestrictToThisLevel )
{
nLevel = _nRestrictToThisLevel;
}
- // <--
if (nLevel < MAXLEVEL)
{
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() )
- // <--
+
{
sal_uInt8 i = static_cast<sal_uInt8>(nLevel);
if( !IsContinusNum() &&
- // --> OD 2006-09-19 #i69672#
// - do not include upper levels, if level isn't numbered.
rMyNFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE &&
- // <--
rMyNFmt.GetIncludeUpperLevels() ) // nur der eigene Level ?
{
sal_uInt8 n = rMyNFmt.GetIncludeUpperLevels();
@@ -872,7 +737,7 @@ String SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVector,
return aStr;
}
-// --> OD 2007-09-07 #i81002#
+
String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
const bool bInclSuperiorNumLabels,
const sal_uInt8 nRestrictInclToThisLevel ) const
@@ -932,7 +797,6 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum,
// eine Art Copy-Constructor, damit die Num-Formate auch an den
// richtigen CharFormaten eines Dokumentes haengen !!
// (Kopiert die NumFormate und returnt sich selbst)
-
SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
{
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -955,9 +819,7 @@ SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule )
bInvalidRuleFlag = sal_True;
return *this;
}
-/* -----------------30.10.98 08:33-------------------
- *
- * --------------------------------------------------*/
+
void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
{
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -970,9 +832,7 @@ void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
bInvalidRuleFlag = sal_True;
bContinusNum = rNumRule.IsContinuousNumbering();
}
-/* -----------------30.10.98 08:33-------------------
- *
- * --------------------------------------------------*/
+
SvxNumRule SwNumRule::MakeSvxNumRule() const
{
SvxNumRule aRule(NUM_CONTINUOUS|NUM_CHAR_TEXT_DISTANCE|NUM_CHAR_STYLE|
@@ -996,19 +856,14 @@ void SwNumRule::SetInvalidRule(sal_Bool bFlag)
{
if (bFlag)
{
- // --> OD 2008-03-13 #refactorlists#
-// tPamAndNums::iterator aIt;
-// for (aIt = aNumberRanges.begin(); aIt != aNumberRanges.end(); aIt++)
-// (*aIt).second->InvalidateTree();
std::set< SwList* > aLists;
tTxtNodeList::iterator aIter;
for ( aIter = maTxtNodeList.begin(); aIter != maTxtNodeList.end(); ++aIter )
{
const SwTxtNode* pTxtNode = *aIter;
- // --> OD 2010-06-04 #i111681# - applying patch from cmc
-// aLists.insert( pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() ) );
+ // #i111681# - applying patch from cmc
SwList* pList = pTxtNode->GetDoc()->getListByName( pTxtNode->GetListId() );
- ASSERT( pList, "<SwNumRule::SetInvalidRule(..)> - list at which the text node is registered at does not exist. This is a serious issue --> please inform OD.");
+ OSL_ENSURE( pList, "<SwNumRule::SetInvalidRule(..)> - list at which the text node is registered at does not exist. This is a serious issue --> please inform OD.");
if ( pList )
{
aLists.insert( pList );
@@ -1023,71 +878,6 @@ void SwNumRule::SetInvalidRule(sal_Bool bFlag)
bInvalidRuleFlag = bFlag;
}
-// --> OD 2008-06-16 #i90078#
-// #i23725#, #i23726#
-//void SwNumRule::Indent(short nAmount, int nLevel, int nReferenceLevel,
-// sal_Bool bRelative, sal_Bool bFirstLine, sal_Bool bCheckGtZero)
-//{
-// int nStartLevel = 0;
-// int nEndLevel = MAXLEVEL - 1;
-// sal_Bool bGotInvalid = sal_False;
-
-// if (nLevel >= 0)
-// nStartLevel = nEndLevel = nLevel;
-
-// int i;
-// short nRealAmount = nAmount;
-
-// if (! bRelative)
-// {
-// if (bFirstLine)
-// {
-// if (nReferenceLevel >= 0)
-// nAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetFirstLineOffset();
-// else
-// nAmount = nAmount - Get(static_cast<sal_uInt16>(nStartLevel)).GetFirstLineOffset();
-// }
-
-// sal_Bool bFirst = sal_True;
-
-// if (nReferenceLevel >= 0)
-// nRealAmount = nAmount - Get(static_cast<sal_uInt16>(nReferenceLevel)).GetAbsLSpace();
-// else
-// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// {
-// short nTmp = nAmount - Get(static_cast<sal_uInt16>(i)).GetAbsLSpace();
-
-// if (bFirst || nTmp > nRealAmount)
-// {
-// nRealAmount = nTmp;
-// bFirst = sal_False;
-// }
-// }
-// }
-
-// if (nRealAmount < 0)
-// for (i = nStartLevel; i < nEndLevel + 1; i++)
-// 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<sal_uInt16>(i)).GetAbsLSpace() + nRealAmount;
-
-// if (bCheckGtZero && nNew < 0)
-// nNew = 0;
-
-// SwNumFmt aTmpNumFmt(Get(static_cast<sal_uInt16>(i)));
-// aTmpNumFmt.SetAbsLSpace(nNew);
-
-// Set(static_cast<sal_uInt16>(i), aTmpNumFmt);
-
-// bGotInvalid = sal_True;
-// }
-
-// if (bGotInvalid)
-// SetInvalidRule(bGotInvalid);
-//}
// change indent of all list levels by given difference
void SwNumRule::ChangeIndent( const short nDiff )
@@ -1110,14 +900,13 @@ void SwNumRule::ChangeIndent( const short nDiff )
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- // --> OD 2009-01-20 #i93399#
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
const long nNewListTab = aTmpNumFmt.GetListtabPos() + nDiff;
aTmpNumFmt.SetListtabPos( nNewListTab );
}
- // <--
+
const long nNewIndent = nDiff +
aTmpNumFmt.GetIndentAt();
aTmpNumFmt.SetIndentAt( nNewIndent );
@@ -1143,7 +932,6 @@ void SwNumRule::SetIndent( const short nNewIndent,
}
else if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
- // --> OD 2009-01-20 #i93399#
// adjust also the list tab position, if a list tab stop is applied
if ( aTmpNumFmt.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
{
@@ -1151,7 +939,7 @@ void SwNumRule::SetIndent( const short nNewIndent,
( nNewIndent - aTmpNumFmt.GetIndentAt() );
aTmpNumFmt.SetListtabPos( nNewListTab );
}
- // <--
+
aTmpNumFmt.SetIndentAt( nNewIndent );
}
@@ -1183,14 +971,10 @@ void SwNumRule::SetIndentOfFirstListLevelAndChangeOthers( const short nNewIndent
ChangeIndent( nDiff );
}
}
-// <--
+
void SwNumRule::Validate()
{
- // --> OD 2008-03-13 #refactorlists#
-// tPamAndNums::iterator aIt;
-// for (aIt = aNumberRanges.begin(); aIt != aNumberRanges.end(); aIt++)
-// (*aIt).second->NotifyInvalidChildren();
std::set< SwList* > aLists;
tTxtNodeList::iterator aIter;
for ( aIter = maTxtNodeList.begin(); aIter != maTxtNodeList.end(); ++aIter )
@@ -1200,27 +984,30 @@ void SwNumRule::Validate()
}
std::for_each( aLists.begin(), aLists.end(),
std::mem_fun( &SwList::ValidateListTree ) );
- // <--
+
SetInvalidRule(sal_False);
}
+
bool SwNumRule::IsCountPhantoms() const
{
return mbCountPhantoms;
}
+
void SwNumRule::SetCountPhantoms(bool bCountPhantoms)
{
mbCountPhantoms = bCountPhantoms;
}
-// --> OD 2008-03-03 #refactorlists#
+
SwNumRule::tParagraphStyleList::size_type SwNumRule::GetParagraphStyleListSize() const
{
return maParagraphStyleList.size();
}
+
void SwNumRule::AddParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
{
tParagraphStyleList::iterator aIter =
@@ -1232,6 +1019,7 @@ void SwNumRule::AddParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
}
}
+
void SwNumRule::RemoveParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
{
tParagraphStyleList::iterator aIter =
@@ -1242,9 +1030,8 @@ void SwNumRule::RemoveParagraphStyle( SwTxtFmtColl& rTxtFmtColl )
maParagraphStyleList.erase( aIter );
}
}
-// <--
-// --> OD 2006-06-27 #b6440955#
+
namespace numfunc
{
/** class containing default bullet list configuration data
@@ -1268,20 +1055,22 @@ namespace numfunc
{
return msFontname;
}
- // --> OD 2008-06-02 #i63395#
+
inline bool IsFontnameUserDefined() const
{
return mbUserDefinedFontname;
}
- // <--
+
inline const Font& GetFont() const
{
return *mpFont;
}
+
inline short GetFontWeight() const
{
return static_cast<short>(meFontWeight);
}
+
inline short GetFontItalic() const
{
return static_cast<short>(meFontItalic);
@@ -1335,9 +1124,7 @@ namespace numfunc
// default bullet list configuration data
String msFontname;
- // --> OD 2008-06-02 #i63395#
bool mbUserDefinedFontname;
- // <--
FontWeight meFontWeight;
FontItalic meFontItalic;
sal_Unicode mnLevelChars[MAXLEVEL];
@@ -1349,12 +1136,10 @@ namespace numfunc
SwDefBulletConfig* SwDefBulletConfig::mpInstance = 0;
SwDefBulletConfig::SwDefBulletConfig()
- : ConfigItem( rtl::OUString::createFromAscii("Office.Writer/Numbering/DefaultBulletList") ),
- // --> OD 2008-06-02 #i63395#
+ : ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/DefaultBulletList")) ),
// default bullet font is now OpenSymbol
msFontname( String::CreateFromAscii("OpenSymbol") ),
mbUserDefinedFontname( false ),
- // <--
meFontWeight( WEIGHT_DONTKNOW ),
meFontItalic( ITALIC_NONE ),
mpFont( 0 )
@@ -1369,27 +1154,12 @@ namespace numfunc
void SwDefBulletConfig::SetToDefault()
{
- // --> OD 2008-06-02 #i63395#
- // default bullet font name is now OpenSymbol
-// msFontname = String::CreateFromAscii("StarSymbol");
msFontname = String::CreateFromAscii("OpenSymbol");
mbUserDefinedFontname = false;
// <--
meFontWeight = WEIGHT_DONTKNOW;
meFontItalic = ITALIC_NONE;
- // --> OD 2008-06-03 #i63395#
- // new bullet characters
-// mnLevelChars[0] = 0x25cf;
-// mnLevelChars[1] = 0x25cb;
-// mnLevelChars[2] = 0x25a0;
-// mnLevelChars[3] = 0x25cf;
-// mnLevelChars[4] = 0x25cb;
-// mnLevelChars[5] = 0x25a0;
-// mnLevelChars[6] = 0x25cf;
-// mnLevelChars[7] = 0x25cb;
-// mnLevelChars[8] = 0x25a0;
-// mnLevelChars[9] = 0x25cf;
mnLevelChars[0] = 0x2022;
mnLevelChars[1] = 0x25e6;
mnLevelChars[2] = 0x25aa;
@@ -1400,26 +1170,25 @@ namespace numfunc
mnLevelChars[7] = 0x25e6;
mnLevelChars[8] = 0x25aa;
mnLevelChars[9] = 0x2022;
- // <--
}
uno::Sequence<rtl::OUString> SwDefBulletConfig::GetPropNames() const
{
uno::Sequence<rtl::OUString> aPropNames(13);
rtl::OUString* pNames = aPropNames.getArray();
- pNames[0] = rtl::OUString::createFromAscii("BulletFont/FontFamilyname");
- pNames[1] = rtl::OUString::createFromAscii("BulletFont/FontWeight");
- pNames[2] = rtl::OUString::createFromAscii("BulletFont/FontItalic");
- pNames[3] = rtl::OUString::createFromAscii("BulletCharLvl1");
- pNames[4] = rtl::OUString::createFromAscii("BulletCharLvl2");
- pNames[5] = rtl::OUString::createFromAscii("BulletCharLvl3");
- pNames[6] = rtl::OUString::createFromAscii("BulletCharLvl4");
- pNames[7] = rtl::OUString::createFromAscii("BulletCharLvl5");
- pNames[8] = rtl::OUString::createFromAscii("BulletCharLvl6");
- pNames[9] = rtl::OUString::createFromAscii("BulletCharLvl7");
- pNames[10] = rtl::OUString::createFromAscii("BulletCharLvl8");
- pNames[11] = rtl::OUString::createFromAscii("BulletCharLvl9");
- pNames[12] = rtl::OUString::createFromAscii("BulletCharLvl10");
+ pNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontFamilyname"));
+ pNames[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontWeight"));
+ pNames[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletFont/FontItalic"));
+ pNames[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl1"));
+ pNames[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl2"));
+ pNames[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl3"));
+ pNames[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl4"));
+ pNames[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl5"));
+ pNames[8] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl6"));
+ pNames[9] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl7"));
+ pNames[10] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl8"));
+ pNames[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl9"));
+ pNames[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BulletCharLvl10"));
return aPropNames;
}
@@ -1430,8 +1199,8 @@ namespace numfunc
uno::Sequence<uno::Any> aValues =
GetProperties( aPropNames );
const uno::Any* pValues = aValues.getConstArray();
- ASSERT( aValues.getLength() == aPropNames.getLength(),
- "<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed")
+ OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
+ "<SwDefBulletConfig::SwDefBulletConfig()> - GetProperties failed");
if ( aValues.getLength() == aPropNames.getLength() )
{
for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
@@ -1445,9 +1214,7 @@ namespace numfunc
rtl::OUString aStr;
pValues[nProp] >>= aStr;
msFontname = aStr;
- // --> OD 2008-06-02 #i63395#
mbUserDefinedFontname = true;
- // <--
}
break;
case 1:
@@ -1509,12 +1276,10 @@ namespace numfunc
return SwDefBulletConfig::getInstance()->GetFontname();
}
- // --> OD 2008-06-02 #i63395#
bool IsDefBulletFontUserDefined()
{
return SwDefBulletConfig::getInstance()->IsFontnameUserDefined();
}
- // <--
const Font& GetDefBulletFont()
{
@@ -1528,8 +1293,6 @@ namespace numfunc
/** class containing configuration data about user interface behavior
regarding lists and list items.
-
- OD 2007-10-01 #b660435#
configuration item about behavior of <TAB>/<SHIFT-TAB>-key at first
position of first list item
@@ -1590,7 +1353,7 @@ namespace numfunc
SwNumberingUIBehaviorConfig* SwNumberingUIBehaviorConfig::mpInstance = 0;
SwNumberingUIBehaviorConfig::SwNumberingUIBehaviorConfig()
- : ConfigItem( rtl::OUString::createFromAscii("Office.Writer/Numbering/UserInterfaceBehavior") ),
+ : ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/UserInterfaceBehavior")) ),
mbChangeIndentOnTabAtFirstPosOfFirstListItem( sal_True )
{
SetToDefault();
@@ -1609,7 +1372,7 @@ namespace numfunc
{
com::sun::star::uno::Sequence<rtl::OUString> aPropNames(1);
rtl::OUString* pNames = aPropNames.getArray();
- pNames[0] = rtl::OUString::createFromAscii("ChangeIndentOnTabAtFirstPosOfFirstListItem");
+ pNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChangeIndentOnTabAtFirstPosOfFirstListItem"));
return aPropNames;
}
@@ -1622,8 +1385,8 @@ namespace numfunc
com::sun::star::uno::Sequence<com::sun::star::uno::Any> aValues =
GetProperties( aPropNames );
const com::sun::star::uno::Any* pValues = aValues.getConstArray();
- ASSERT( aValues.getLength() == aPropNames.getLength(),
- "<SwNumberingUIBehaviorConfig::LoadConfig()> - GetProperties failed")
+ OSL_ENSURE( aValues.getLength() == aPropNames.getLength(),
+ "<SwNumberingUIBehaviorConfig::LoadConfig()> - GetProperties failed");
if ( aValues.getLength() == aPropNames.getLength() )
{
for ( int nProp = 0; nProp < aPropNames.getLength(); ++nProp )
@@ -1639,8 +1402,8 @@ namespace numfunc
break;
default:
{
- ASSERT( false,
- "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property")
+ OSL_ENSURE( false,
+ "<SwNumberingUIBehaviorConfig::LoadConfig()> - unknown configuration property");
}
}
}
@@ -1660,7 +1423,6 @@ namespace numfunc
return SwNumberingUIBehaviorConfig::getInstance()->ChangeIndentOnTabAtFirstPosOfFirstListItem();
}
- // --> OD 2008-06-06 #i89178#
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
{
SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode;
@@ -1684,3 +1446,5 @@ namespace numfunc
// <--
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 5c3bb6659b4a..7f822c8c6afd 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,7 +95,7 @@ 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 sal_Char sKomma[] = ", ";
static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = {
// PT_16, PT_14, PT_14, PT_12, PT_12, // normal
@@ -226,17 +227,15 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
{
if( !( nOutLvlBits & ( 1 << nLevel )) )
{
- //pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei
pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei
if( !bHTMLMode )
{
SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
const SwNumFmt& rNFmt = pOutlineRule->Get( nLevel );
- // --> OD 2008-02-01 #newlistlevelattrs#
+
if ( rNFmt.GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION &&
( rNFmt.GetAbsLSpace() || rNFmt.GetFirstLineOffset() ) )
- // <--
{
SvxLRSpaceItem aLR( (SvxLRSpaceItem&)pColl->GetFmtAttr( RES_LR_SPACE ) );
aLR.SetTxtFirstLineOfstValue( rNFmt.GetFirstLineOffset() );
@@ -244,7 +243,7 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
pColl->SetFmtAttr( aLR );
}
- // --> OD 2006-11-20 #i71764#
+ // #i71764#
// Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
// All paragraph styles, which are assigned to a level of the
// outline style has to have the outline style set as its list style.
@@ -301,7 +300,7 @@ void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
rSet.Put( aLR );
rSet.Put( aUL );
- if( !pColl )
+ if( pColl )
pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( nNxt ));
}
@@ -321,7 +320,7 @@ SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage)
SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
- ASSERT(
+ OSL_ENSURE(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
@@ -338,8 +337,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
return pNewColl;
}
- //if( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei
- //nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() );
+
if( pNewColl->IsAssignedToListLevelOfOutlineStyle())
nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei
}
@@ -359,7 +357,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN;
- ASSERT( nResId, "Ungueltige Pool-ID" );
+ OSL_ENSURE( nResId, "Ungueltige Pool-ID" );
if( !nResId )
return GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
@@ -390,7 +388,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
// allgemeine Inhaltsformen
case RES_POOLCOLL_STANDARD:
- /* #111214# koreans do not like SvxScriptItem(sal_True) */
+ /* koreans do not like SvxScriptItem(TRUE) */
if (bRegardLanguage)
{
sal_uLong nAppLanguage = GetAppLanguage();
@@ -971,7 +969,6 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
aLR.SetLeft( GetMetricVal( CM_1 ));
aLR.SetRight( GetMetricVal( CM_1 ));
aSet.Put( aLR );
-// aSet.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, RES_PARATR_ADJUST ) );
SvxULSpaceItem aUL( RES_UL_SPACE );
aUL = pNewColl->GetULSpace();
aUL.SetLower( HTML_PARSPACE );
@@ -1050,9 +1047,6 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
{
pNewColl->SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewColl;
@@ -1064,7 +1058,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
// benutzt wird
bool SwDoc::IsPoolTxtCollUsed( sal_uInt16 nId ) const
{
- ASSERT(
+ OSL_ENSURE(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
@@ -1118,7 +1112,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
// -> returne das erste
if( RES_POOLCHR_BEGIN > nId || nId >= RES_POOLCHR_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLCHR_BEGIN;
}
}
@@ -1136,7 +1130,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
// -> returne das erste
if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLFRM_BEGIN;
}
}
@@ -1144,10 +1138,10 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
default:
// Fehlerfall, unbekanntes Format
- ASSERT( nId, "ungueltige Id" );
+ OSL_ENSURE( nId, "ungueltige Id" );
return 0;
}
- ASSERT( nRCId, "ungueltige Id" );
+ OSL_ENSURE( nRCId, "ungueltige Id" );
while( nArrCnt-- )
for( sal_uInt16 n = 0; n < (*pArray[nArrCnt]).Count(); ++n )
@@ -1211,10 +1205,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamily(),
rBulletFont.GetName(), rBulletFont.GetStyleName(),
rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
- // --> OD 2008-06-02 #i63395#
- // no font and no font size any more
-// SetAllScriptItem( aSet, SvxFontHeightItem( PT_9, 100, RES_CHRATR_FONTSIZE ));
- // <--
}
break;
@@ -1284,10 +1274,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
case RES_POOLCHR_VERT_NUM:
aSet.Put( SvxCharRotateItem( 900, sal_False, RES_CHRATR_ROTATE ) );
break;
-//nichts besonderes
-// case RES_POOLCHR_HTML_DEFINSTANCE:
-// break;
-
case RES_POOLFRM_FRAME:
{
@@ -1375,9 +1361,6 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
{
{
pNewFmt->SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewFmt;
@@ -1414,7 +1397,7 @@ bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const
}
else
{
- ASSERT( sal_False, "ungueltige Id" );
+ OSL_ENSURE( sal_False, "ungueltige Id" );
bFnd = sal_False;
}
@@ -1459,7 +1442,7 @@ void lcl_GetStdPgSize( SwDoc* pDoc, SfxItemSet& rSet )
SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
{
- ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
+ OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc;
@@ -1474,7 +1457,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLPAGE_BEGIN;
}
@@ -1624,9 +1607,6 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
if( bSetLeft )
pNewPgDsc->GetLeft().SetFmtAttr( aSet );
pNewPgDsc->GetMaster().SetFmtAttr( aSet );
- // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
- // (Bug: 18545)
- // SetModified();
}
}
return pNewPgDsc;
@@ -1634,7 +1614,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
{
- ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
+ OSL_ENSURE( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
"Falsche AutoFormat-Id" );
SwNumRule* pNewRule;
@@ -1649,7 +1629,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
{
- ASSERT( !this, "ungueltige Id" );
+ OSL_ENSURE( !this, "ungueltige Id" );
nId = RES_POOLNUMRULE_BEGIN;
}
@@ -1658,17 +1638,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0;
- // --> OD 2008-02-11 #newlistlevelattrs#
const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
- // --> OD 2008-06-06 #i89178#
- = numfunc::GetDefaultPositionAndSpaceMode();
- // <--
+ = numfunc::GetDefaultPositionAndSpaceMode(); //#i89178#
// <--
{
sal_Bool bIsModified = IsModified();
- // --> OD 2008-02-11 #newlistlevelattrs#
+
n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode );
- // <--
+
pNewRule = GetNumRuleTbl()[ n ];
pNewRule->SetPoolFmtId( nId );
pNewRule->SetAutoRule( sal_False );
@@ -1689,9 +1666,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM1:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetStart( 1 );
@@ -1716,7 +1691,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -1726,10 +1700,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -1739,7 +1712,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -1770,22 +1743,20 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
- // <--
+
sal_uInt16 nSpace = 0;
for( n = 0; n < MAXLEVEL; ++n )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nSpace = nSpace + pArr[ n ] );
@@ -1797,7 +1768,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetIndentAt( nSpace );
aFmt.SetFirstLineIndent( - pArr[ n ] );
}
- // <--
+
aFmt.SetStart( n+1 );
pNewRule->Set( n, aFmt );
}
@@ -1806,15 +1777,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM3:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
sal_uInt16 nOffs = GetMetricVal( CM_1 ) * 3;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -1824,11 +1794,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( (n+1) * nOffs );
@@ -1838,7 +1806,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( (n+1) * nOffs );
aFmt.SetIndentAt( (n+1) * nOffs );
}
- // <--
+
aFmt.SetStart( n+1 );
pNewRule->Set( n, aFmt );
}
@@ -1847,9 +1815,8 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_NUM4:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER);
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
@@ -1873,7 +1840,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -1883,11 +1849,11 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
aFmt.SetStart( n + 1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -1897,7 +1863,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -1927,21 +1893,18 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr0to2 = aAbsSpace0to2;
#endif
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
- // <--
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm
@@ -1953,14 +1916,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[1] );
aFmt.SetIndentAt( pArr0to2[1] );
}
- // <--
aFmt.SetCharFmt( pNumCFmt );
pNewRule->Set( 0, aFmt );
aFmt.SetIncludeUpperLevels( 2 );
aFmt.SetStart( 2 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm
@@ -1972,14 +1934,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[3] );
aFmt.SetIndentAt( pArr0to2[3] );
}
- // <--
+
pNewRule->Set( 1, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER);
aFmt.SetSuffix( ')');
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetStart( 3 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm
@@ -1991,20 +1953,17 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( pArr0to2[5] );
aFmt.SetIndentAt( pArr0to2[5] );
}
- // <--
+
pNewRule->Set( 2, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( cBulletChar );
sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4,
nOffs2 = GetMetricVal( CM_1 ) * 2;
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -2013,12 +1972,12 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
{
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
+
aFmt.SetSuffix( aEmptyStr );
for( n = 3; n < MAXLEVEL; ++n )
{
aFmt.SetStart( n+1 );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
@@ -2028,7 +1987,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( nOffs2 + ((n-3) * nOffs) );
aFmt.SetIndentAt( nOffs2 + ((n-3) * nOffs) );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2037,16 +1996,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL1:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( cBulletChar );
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
@@ -2067,7 +2023,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2077,10 +2032,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2090,7 +2044,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2098,16 +2052,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL2:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
aFmt.SetBulletChar( 0x2013 );
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
@@ -2128,7 +2079,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2138,10 +2088,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2151,7 +2100,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2159,19 +2108,17 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL3:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
+
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
@@ -2181,12 +2128,11 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
- // <--
for( n = 0; n < MAXLEVEL; ++n )
{
aFmt.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) );
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( ((n & 1) +1) * nOffs );
@@ -2196,7 +2142,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( ((n & 1) +1) * nOffs );
aFmt.SetIndentAt( ((n & 1) +1) * nOffs );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2204,16 +2150,13 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL4:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
@@ -2233,7 +2176,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2243,7 +2185,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
switch( n )
@@ -2252,7 +2194,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case 1: aFmt.SetBulletChar( 0xE006 ); break;
default: aFmt.SetBulletChar( 0xE004 ); break;
}
- // --> OD 2008-02-11 #newlistlevelattrs#
+
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2262,7 +2204,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2270,17 +2212,14 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
case RES_POOLNUMRULE_BUL5:
{
SwNumFmt aFmt;
- // --> OD 2008-02-11 #newlistlevelattrs#
+
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
- // <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetBulletChar( 0x2717 );
- // --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
- // <--
static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
{
@@ -2300,7 +2239,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const sal_uInt16* pArr = aAbsSpace;
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
@@ -2310,10 +2248,9 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
- // <--
+
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
- // --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
@@ -2323,7 +2260,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
- // <--
+
pNewRule->Set( n, aFmt );
}
}
@@ -2339,7 +2276,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
// benutzt wird
bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const
{
- ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
+ OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc = 0;
sal_Bool bFnd = sal_False;
@@ -2372,36 +2309,6 @@ sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const
// erfrage ob die NumRule benutzt wird
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 = sal_False;
-// SwAutoFmtGetDocNode aGetHt( &aNodes );
-// SwModify* pMod;
-// const SfxPoolItem* pItem;
-// sal_uInt16 i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
-// for( i = 0; i < nMaxItems; ++i )
-// {
-// if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) &&
-// 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) &&
-// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
-// ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() )
-// {
-// if( pMod->IsA( TYPE( SwFmt )) )
-// {
-// bUsed = !pMod->GetInfo( aGetHt );
-// if( bUsed )
-// break;
-// }
-// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
-// {
-// bUsed = sal_True;
-// break;
-// }
-// }
-// }
-
-// return bUsed;
sal_Bool bUsed = rRule.GetTxtNodeListSize() > 0 ||
rRule.GetParagraphStyleListSize() > 0;
@@ -2413,7 +2320,7 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
// dann fuege neu ein
sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName )
{
- ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" );
+ OSL_ENSURE( rPatternName.Len(), "kein Dokument-Vorlagenname" );
sal_uInt16 nNewPos = aPatternNms.Count();
for( sal_uInt16 n = 0; n < aPatternNms.Count(); ++n )
@@ -2563,13 +2470,13 @@ sal_uInt16 GetPoolParent( sal_uInt16 nId )
void SwDoc::RemoveAllFmtLanguageDependencies()
{
- /* #106748# Restore the language independ pool defaults and styles. */
+ /* Restore the language independ pool defaults and styles. */
GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST );
SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST );
- /* #111214# koreans do not like SvxScriptItem(sal_True) */
+ /* koreans do not like SvxScriptItem(TRUE) */
pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE );
SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
@@ -2582,10 +2489,12 @@ void SwDoc::RemoveAllFmtLanguageDependencies()
rDesc.GetLeft().SetFmtAttr( aFrameDir );
}
- // OD 09.10.2003 #i18732# - restore static pool default for item
+ // #i18732# - restore static pool default for item
// RES_FOLLOW_TEXT_FLOW.
GetAttrPool().ResetPoolDefaultItem( RES_FOLLOW_TEXT_FLOW );
//#i16874# AutoKerning as default for new documents
GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index e845ec6f6897..eaee0fddd513 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,13 +34,11 @@
#include <i18npool/lang.h>
#include <sortopt.hxx>
-
SV_IMPL_PTRARR(SwSortKeys, SwSortKey*)
/*--------------------------------------------------------------------
Beschreibung: Sortier-Schluessel
--------------------------------------------------------------------*/
-
SwSortKey::SwSortKey() :
eSortOrder( SRT_ASCENDING ),
nColumnId( 0 ),
@@ -55,7 +54,6 @@ SwSortKey::SwSortKey(sal_uInt16 nId, const String& rSrtType, SwSortOrder eOrder)
{
}
-
SwSortKey::SwSortKey(const SwSortKey& rOld) :
sSortType( rOld.sSortType ),
eSortOrder( rOld.eSortOrder ),
@@ -67,8 +65,6 @@ SwSortKey::SwSortKey(const SwSortKey& rOld) :
/*--------------------------------------------------------------------
Beschreibung: Sortieroptionen fuers Sortieren
--------------------------------------------------------------------*/
-
-
SwSortOptions::SwSortOptions()
: eDirection( SRT_ROWS ),
cDeli( 9 ),
@@ -78,7 +74,6 @@ SwSortOptions::SwSortOptions()
{
}
-
SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
eDirection( rOpt.eDirection ),
cDeli( rOpt.cDeli ),
@@ -93,11 +88,9 @@ SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
}
}
-
SwSortOptions::~SwSortOptions()
{
aKeys.DeleteAndDestroy(0, aKeys.Count());
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 7903bffa2309..3359f1d9385a 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,9 +42,7 @@
#include <bookmrk.hxx>
#include <pam.hxx>
#include <shellio.hxx>
-#ifndef _SWERROR_H
#include <swerror.h>
-#endif
using namespace ::com::sun::star;
@@ -163,10 +162,6 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
SvLinkSource::NotifyDataChanged();
}
}
- // sonst melden wir uns ab !!
-// ????? JP 27.06.95: geht das so ????
-// else
-// Closed();
}
@@ -206,10 +201,6 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange )
SvLinkSource::NotifyDataChanged();
}
}
- // sonst melden wir uns ab !!
-// ????? JP 27.06.95: geht das so ????
-// else
-// Closed();
}
@@ -260,10 +251,6 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
// um Rekursionen zu Verhindern: ServerType umsetzen!
SwServerObject::ServerModes eSave = eType;
if( !pChkLnk )
-// sowas sollte man nicht tun, wer weiss schon, wie gross ein enum ist
-// ICC nimmt keinen int
-// #41723#
-// *((int*)&eType) = SECTION_SERVER+1;
((SwServerObject*)this)->eType = NONE_SERVER;
for( sal_uInt16 n = rLnks.Count(); n; )
{
@@ -369,3 +356,5 @@ SwDataChanged::~SwDataChanged()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index ea8ba9366c75..ac67fd7fb89a 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include "swstylemanager.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <svl/stylepool.hxx>
#include <doc.hxx>
#include <charfmt.hxx>
@@ -38,7 +39,7 @@
#include <swtypes.hxx>
#include <istyleaccess.hxx>
-typedef ::std::hash_map< const ::rtl::OUString,
+typedef ::boost::unordered_map< const ::rtl::OUString,
StylePool::SfxItemSet_Pointer_t,
::rtl::OUStringHash,
::std::equal_to< ::rtl::OUString > > SwStyleNameCache;
@@ -75,7 +76,6 @@ class SwStyleManager : public IStyleAccess
SwStyleCache *mpParaCache;
public:
- // --> OD 2008-03-07 #refactorlists#
// accept empty item set for ignorable paragraph items.
SwStyleManager( SfxItemSet* pIgnorableParagraphItems )
: aAutoCharPool(),
@@ -83,7 +83,6 @@ public:
mpCharCache(0),
mpParaCache(0)
{}
- // <--
virtual ~SwStyleManager();
virtual StylePool::SfxItemSet_Pointer_t getAutomaticStyle( const SfxItemSet& rSet,
IStyleAccess::SwAutoStyleFamily eFamily );
@@ -147,7 +146,7 @@ StylePool::SfxItemSet_Pointer_t SwStyleManager::getByName( const rtl::OUString&
{
// Ok, ok, it's allowed to ask for uncached styles (from UNO) but it should not be done
// during loading a document
- ASSERT( false, "Don't ask for uncached styles" );
+ OSL_ENSURE( false, "Don't ask for uncached styles" );
rpCache->addCompletePool( rAutoPool );
pStyle = rpCache->getByName( rName );
}
@@ -158,10 +157,8 @@ void SwStyleManager::getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t>
IStyleAccess::SwAutoStyleFamily eFamily )
{
StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
- // --> OD 2008-03-07 #refactorlists#
// setup <StylePool> iterator, which skips unused styles and ignorable items
IStylePoolIteratorAccess *pIter = rAutoPool.createIterator( true, true );
- // <--
StylePool::SfxItemSet_Pointer_t pStyle = pIter->getNext();
while( pStyle.get() )
{
@@ -171,3 +168,5 @@ void SwStyleManager::getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t>
}
delete pIter;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/swstylemanager.hxx b/sw/source/core/doc/swstylemanager.hxx
index 4997ce5c0770..486d751ba8d1 100644
--- a/sw/source/core/doc/swstylemanager.hxx
+++ b/sw/source/core/doc/swstylemanager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,11 +29,9 @@
#define _SWSTYLEMANAGER_HXX
class IStyleAccess;
-// --> OD 2008-03-07 #refactorlists#
class SfxItemSet;
-// <--
-// --> OD 2008-03-07 #refactorlists#
IStyleAccess *createStyleManager( SfxItemSet* pIgnorableParagraphItems = 0 );
-// <--
#endif //_SWSTYLEMANAGER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 647acfe9d9a4..9d16beb1b4d0 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <unotools/pathoptions.hxx>
#include <sfx2/app.hxx>
#include <svx/dialmgr.hxx>
-#ifndef _SVX_DIALOGS_HRC
#include <svx/dialogs.hrc>
-#endif
#define READ_OLDVERS // erstmal noch alte Versionen lesen
#include <swtypes.hxx>
@@ -73,11 +72,11 @@ const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002;
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
+// --- from 680/dr25 on: store strings as UTF-8
const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021;
const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022;
-// --- from DEV300/overline2 on: #5991# overline
+// --- from DEV300/overline2 on: overline
const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031;
const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032;
@@ -400,7 +399,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
if( 0 == rVersions.nNumFmtVersion )
{
sal_uInt16 eSys, eLge;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
rStream.ReadByteString( sNumFmtString, eCharSet )
>> eSys >> eLge;
@@ -486,7 +485,7 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const
aRotateAngle.Store( rStream, aRotateAngle.GetVersion(SOFFICE_FILEFORMAT_40) );
aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) );
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
rStream.WriteByteString( sNumFmtString, RTL_TEXTENCODING_UTF8 )
<< (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage;
@@ -587,7 +586,7 @@ SwTableAutoFmt::~SwTableAutoFmt()
void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren
@@ -599,7 +598,7 @@ void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos ) const
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren
@@ -620,7 +619,7 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
UpdateFlags eFlags,
SvNumberFormatter* pNFmtr )
{
- ASSERT( nPos < 16, "falscher Bereich" );
+ OSL_ENSURE( nPos < 16, "falscher Bereich" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( !pFmt ) // ist gesetzt -> kopieren
@@ -693,7 +692,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
rSet.Put( rChg.GetHeight() );
rSet.Put( rChg.GetWeight() );
rSet.Put( rChg.GetPosture() );
- // #103065# do not insert empty CJK font
+ // do not insert empty CJK font
const SvxFontItem& rCJKFont = rChg.GetCJKFont();
if( rCJKFont.GetStyleName().Len() )
{
@@ -708,7 +707,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
rSet.Put( rChg.GetWeight(), RES_CHRATR_CJK_WEIGHT );
rSet.Put( rChg.GetPosture(), RES_CHRATR_CJK_POSTURE );
}
- // #103065# do not insert empty CTL font
+ // do not insert empty CTL font
const SvxFontItem& rCTLFont = rChg.GetCTLFont();
if( rCTLFont.GetStyleName().Len() )
{
@@ -779,7 +778,7 @@ sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions
(AUTOFORMAT_DATA_ID_504 <= nVal && nVal <= AUTOFORMAT_DATA_ID)) )
{
sal_Bool b;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: 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 )
@@ -861,7 +860,7 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const
sal_uInt16 nVal = AUTOFORMAT_DATA_ID;
sal_Bool b;
rStream << nVal;
- // --- from 680/dr25 on: #21549# store strings as UTF-8
+ // --- from 680/dr25 on: store strings as UTF-8
rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
rStream << nStrResId;
rStream << ( b = bInclFont );
@@ -998,7 +997,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
// rStream >> nFileVers;
if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{
- ASSERT( !this, "Der Header enthaelt mehr/neuere Daten" );
+ OSL_ENSURE( !this, "Der Header enthaelt mehr/neuere Daten" );
rStream.Seek( nPos + nCnt );
}
rStream.SetStreamCharSet( (CharSet)nChrSet );
@@ -1080,9 +1079,7 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
rStream << nVal
<< (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();
//-----------------------------------------------------------
@@ -1104,3 +1101,4 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 51e1d455beb5..d83bf854c645 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -142,7 +143,7 @@ namespace
for( sal_uInt16 nLine = 0; nLine < rBox.GetTabLines().Count(); ++nLine )
pStartLn = insertSubLine( rSubTable, *rBox.GetTabLines()[nLine],
pStartLn );
- ASSERT( pStartLn == pEndLn, "Sub line confusion" );
+ OSL_ENSURE( pStartLn == pEndLn, "Sub line confusion" );
}
else
{
@@ -507,19 +508,6 @@ namespace
if( pBox && pBox->getRowSpan() > 0 )
lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
sal_True, pUndo );
- /* Idea: If target cell is a covered cell, append content
- to master cell.
- sal_Bool bReplace = sal_True;
- if( pBox->getRowSpan() < 0 )
- {
- if( rInfo.mpCopy->getRowSpan() < 0 )
- continue;
- pBox = &pBox->FindStartOfRowSpan( rDstTbl );
- bReplace = sal_False;
- }
- lcl_CpyBox( rSource, rInfo.mpCopy, rDstTbl, pBox,
- bReplace, pUndo );
- */
}
}
}
@@ -541,7 +529,7 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwTable& rDstTbl, SwTableBox* pDstBox,
sal_Bool bDelCntnt, SwUndoTblCpyTbl* pUndo )
{
- ASSERT( ( !pCpyBox || pCpyBox->GetSttNd() ) && pDstBox->GetSttNd(),
+ OSL_ENSURE( ( !pCpyBox || pCpyBox->GetSttNd() ) && pDstBox->GetSttNd(),
"Keine inhaltstragende Box" );
SwDoc* pCpyDoc = rCpyTbl.GetFrmFmt()->GetDoc();
@@ -616,7 +604,6 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
}
if( pCNd &&
- /*RES_POOLCOLL_TABLE == */
RES_POOLCOLL_TABLE_HDLN !=
pCNd->GetFmtColl()->GetPoolFmtId() )
bReplaceColl = sal_False;
@@ -748,8 +735,6 @@ sal_Bool SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBox
return sal_True;
}
-// ---------------------------------------------------------------
-
// kopiere die Tabelle in diese.
// Kopiere alle Boxen einer Line in entsprechenden Boxen. Der alte Inhalt
// wird dabei geloescht.
@@ -757,8 +742,6 @@ sal_Bool SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBox
// Box einer "GrundLine".
// Ist auch keine Line mehr vorhanden, -> auch in die letzte Box
// einer "GrundLine"
-
-
sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwUndoTblCpyTbl* pUndo )
{
@@ -772,7 +755,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
SwTableBox* pMyBox = (SwTableBox*)GetTblBox(
rSttBox.GetNode().FindTableBoxStartNode()->GetIndex() );
- ASSERT( pMyBox, "Index steht nicht in dieser Tabelle in einer Box" );
+ OSL_ENSURE( pMyBox, "Index steht nicht in dieser Tabelle in einer Box" );
// loesche erstmal die Frames der Tabelle
_FndBox aFndBox( 0, 0 );
@@ -839,18 +822,17 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
return sal_True;
}
-
sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
SwUndoTblCpyTbl* pUndo )
{
- ASSERT( rSelBoxes.Count(), "Missing selection" )
+ OSL_ENSURE( rSelBoxes.Count(), "Missing selection" );
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
if( IsNewModel() || rCpyTbl.IsNewModel() )
return InsNewTable( rCpyTbl, rSelBoxes, pUndo );
- ASSERT( !rCpyTbl.IsTblComplex(), "Table too complex" )
+ OSL_ENSURE( !rCpyTbl.IsTblComplex(), "Table too complex" );
SwDoc* pDoc = GetFrmFmt()->GetDoc();
SwDoc* pCpyDoc = rCpyTbl.GetFrmFmt()->GetDoc();
@@ -926,7 +908,7 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
// es ist also Platz fuer das zu kopierende vorhanden, also
// fuege entsprechend neue Zeilen ein.
SwTableBox* pInsBox = pLastLn->GetTabBoxes()[ nSttBox ];
- ASSERT( pInsBox && pInsBox->GetSttNd(),
+ OSL_ENSURE( pInsBox && pInsBox->GetSttNd(),
"kein CntntBox oder steht nicht in dieser Tabelle" );
SwSelBoxes aBoxes;
@@ -1061,8 +1043,6 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
return sal_True;
}
-
-
sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
{
SwTableBox* pBox = (SwTableBox*)rpBox;
@@ -1073,14 +1053,12 @@ sal_Bool _FndCntntBox( const SwTableBox*& rpBox, void* pPara )
return sal_True;
}
-
sal_Bool _FndCntntLine( const SwTableLine*& rpLine, void* pPara )
{
((SwTableLine*)rpLine)->GetTabBoxes().ForEach( &_FndCntntBox, pPara );
return sal_True;
}
-
// suche alle Inhaltstragenden-Boxen dieser Box
SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
SwSelBoxes& rBoxes, sal_Bool bToTop ) const
@@ -1096,4 +1074,4 @@ SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
return rBoxes;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index e4a522ce2960..92676eb272ab 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,15 +73,11 @@ using namespace com::sun::star::uno;
using namespace ::com::sun::star;
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 2
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
typedef SwTableLine* SwTableLinePtr;
SV_DECL_PTRARR_SORT( SwSortTableLines, SwTableLinePtr, 16, 16 )
@@ -195,7 +192,7 @@ sal_Bool lcl_DelOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
typedef sal_Bool (*FN_lcl_SetBoxWidth)(SwTableLine*, CR_SetBoxWidth&, SwTwips, sal_Bool );
-#if defined(DBG_UTIL) || defined( JP_DEBUG )
+#if OSL_DEBUG_LEVEL > 1
void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
@@ -221,8 +218,8 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
if ( pFrm && \
((SwRowFrm*)pFrm)->GetTabLine() == GetTabLines()[i] ) \
{ \
- ASSERT( pFrm->GetUpper()->IsTabFrm(), \
- "Table layout does not match table structure" ) \
+ OSL_ENSURE( pFrm->GetUpper()->IsTabFrm(), \
+ "Table layout does not match table structure" ); \
} \
} while ( 0 != ( pLast = aIter++ ) ); \
} \
@@ -236,7 +233,6 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
#endif
-
struct CR_SetLineHeight
{
SwSelBoxes aBoxes;
@@ -294,8 +290,6 @@ SV_IMPL_VARARR_SORT( _CpyTabFrms, _CpyTabFrm )
void lcl_DelCpyTabFrmFmts( _CpyTabFrm& rArr );
-// ---------------------------------------------------------------
-
struct _CpyPara
{
boost::shared_ptr< std::vector< std::vector< sal_uLong > > > pWidths;
@@ -339,7 +333,6 @@ struct _CpyPara
void SetBoxWidth( SwTableBox* pBox );
};
-
sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
{
_CpyPara* pCpyPara = (_CpyPara*)pPara;
@@ -401,7 +394,6 @@ sal_Bool lcl_CopyCol( const _FndBox*& rpFndBox, void* pPara )
else
{
aFindFrm = pCpyPara->rTabFrmArr[ nFndPos ];
-// aFindFrm.pNewFrmFmt->Add( pBox );
pBox->ChgFrmFmt( (SwTableBoxFmt*)aFindFrm.pNewFrmFmt );
}
}
@@ -493,8 +485,6 @@ sal_Bool lcl_CopyRow( const _FndLine*& rpFndLine, void* pPara )
return sal_True;
}
-//-----------------------------------------------------------
-
void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, sal_uInt16 nCpyCnt,
sal_Bool bBehind )
{
@@ -538,10 +528,9 @@ SwRowFrm* GetRowFrm( SwTableLine& rLine )
return 0;
}
-
sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
- ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -581,8 +570,8 @@ sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 n
//Layout updaten
aFndBox.MakeFrms( *this );
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
bRes = sal_True;
}
@@ -597,7 +586,7 @@ sal_Bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 n
sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
sal_uInt16 nCnt, sal_Bool bBehind )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -682,8 +671,8 @@ sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
aFndBox.MakeNewFrms( *this, nCnt, bBehind );
}
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
SwChartDataProvider *pPCD = pDoc->GetChartDataProvider();
if (pPCD && nCnt)
@@ -728,7 +717,6 @@ sal_Bool _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
return sal_True;
}
-
sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
{
SwTableNode* pTblNd = (SwTableNode*)aSortCntBoxes[0]->GetSttNd()->FindTableNode();
@@ -782,13 +770,12 @@ sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
// TL_CHART2: need to inform chart of probably changed cell names
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
- CHECKBOXWIDTH
- CHECKTABLELAYOUT
+ CHECKBOXWIDTH;
+ CHECKTABLELAYOUT;
return sal_True;
}
-
void lcl_LastBoxSetWidth( SwTableBoxes &rBoxes, const long nOffset,
sal_Bool bFirst, SwShareBoxFmts& rShareFmts );
@@ -1089,7 +1076,6 @@ void lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox,
}
}
-
sal_Bool SwTable::DeleteSel(
SwDoc* pDoc
,
@@ -1097,7 +1083,7 @@ sal_Bool SwTable::DeleteSel(
const SwSelBoxes* pMerged, SwUndo* pUndo,
const sal_Bool bDelMakeFrms, const sal_Bool bCorrBorder )
{
- ASSERT( pDoc, "No doc?" );
+ OSL_ENSURE( pDoc, "No doc?" );
SwTableNode* pTblNd = 0;
if( rBoxes.Count() )
{
@@ -1159,19 +1145,16 @@ sal_Bool SwTable::DeleteSel(
// TL_CHART2: now inform chart that sth has changed
pDoc->UpdateCharts( GetFrmFmt()->GetName() );
- CHECKTABLELAYOUT
- CHECK_TABLE( *this )
+ CHECKTABLELAYOUT;
+ CHECK_TABLE( *this );
return sal_True;
}
-
-// ---------------------------------------------------------------
-
sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt,
sal_Bool bSameHeight )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1193,7 +1176,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
const SwRowFrm* pRow = GetRowFrm( *pSelBox->GetUpper() );
- ASSERT( pRow, "wo ist der Frm von der SwTableLine?" )
+ OSL_ENSURE( pRow, "wo ist der Frm von der SwTableLine?" );
SWRECTFN( pRow )
pRowHeights[ n ] = (pRow->Frm().*fnRect->fnGetHeight)();
}
@@ -1207,7 +1190,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( rBoxes.GetData() + n );
- ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
+ OSL_ENSURE( pSelBox, "Box steht nicht in der Tabelle" );
// dann fuege in die Box nCnt neue Zeilen ein
SwTableLine* pInsLine = pSelBox->GetUpper();
@@ -1314,7 +1297,7 @@ sal_Bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{
- ASSERT( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
+ OSL_ENSURE( pDoc && rBoxes.Count() && nCnt, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1340,7 +1323,7 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n )
{
SwTableBox* pSelBox = *( aSelBoxes.GetData() + n );
- ASSERT( pSelBox, "Box steht nicht in der Tabelle" );
+ OSL_ENSURE( pSelBox, "Box steht nicht in der Tabelle" );
// We don't want to split small table cells into very very small cells
if( pSelBox->GetFrmFmt()->GetFrmSize().GetWidth()/( nCnt + 1 ) < 10 )
@@ -1422,8 +1405,6 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
return sal_True;
}
-// ---------------------------------------------------------------
-
/*
----------------------- >> MERGE << ------------------------
Algorithmus:
@@ -1438,7 +1419,6 @@ sal_Bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nC
----------------------- >> MERGE << ------------------------
*/
-
void lcl_CpyLines( sal_uInt16 nStt, sal_uInt16 nEnd,
SwTableLines& rLines,
SwTableBox* pInsBox,
@@ -1469,10 +1449,10 @@ void lcl_CalcWidth( SwTableBox* pBox )
{
// Annahme: jede Line in der Box ist gleich gross
SwFrmFmt* pFmt = pBox->ClaimFrmFmt();
- ASSERT( pBox->GetTabLines().Count(), "Box hat keine Lines" );
+ OSL_ENSURE( pBox->GetTabLines().Count(), "Box hat keine Lines" );
SwTableLine* pLine = pBox->GetTabLines()[0];
- ASSERT( pLine, "Box steht in keiner Line" );
+ OSL_ENSURE( pLine, "Box steht in keiner Line" );
long nWidth = 0;
for( sal_uInt16 n = 0; n < pLine->GetTabBoxes().Count(); ++n )
@@ -1485,8 +1465,6 @@ void lcl_CalcWidth( SwTableBox* pBox )
pFmt->ResetFmtAttr( RES_BOXATR_BEGIN, RES_BOXATR_END - 1 );
}
-
-
struct _InsULPara
{
SwTableNode* pTblNd;
@@ -1516,7 +1494,6 @@ struct _InsULPara
{ bUL_LR = sal_True; bUL = sal_False; if( pLine ) pInsLine = pLine; }
};
-
sal_Bool lcl_Merge_MoveBox( const _FndBox*& rpFndBox, void* pPara )
{
_InsULPara* pULPara = (_InsULPara*)pPara;
@@ -1597,8 +1574,6 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
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() ) )
if( !nLeft || nRight == pFndLn->GetTabBoxes().Count() )
{
if( pULPara->bUL ) // Upper ?
@@ -1728,7 +1703,7 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
lcl_CalcWidth( pRMBox ); // bereche die Breite der Box
}
else {
- ASSERT( sal_False , "Was denn nun" );
+ OSL_ENSURE( sal_False, "Was denn nun" );
}
}
// Left/Right
@@ -1758,11 +1733,10 @@ sal_Bool lcl_Merge_MoveLine( const _FndLine*& rpFndLine, void* pPara )
return sal_True;
}
-
sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo )
{
- ASSERT( rBoxes.Count() && pMergeBox, "keine gueltigen Werte" );
+ OSL_ENSURE( rBoxes.Count() && pMergeBox, "keine gueltigen Werte" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1869,8 +1843,6 @@ sal_Bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return sal_True;
}
-// ---------------------------------------------------------------
-
void lcl_CheckRowSpan( SwTable &rTbl )
{
sal_uInt16 nLineCount = rTbl.GetTabLines().Count();
@@ -2225,11 +2197,11 @@ sal_Bool SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
{ // The copied line must not contain any row span attributes > 1
SwTableLine* pLine = rTblNd.GetTable().GetTabLines()[0];
sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
- ASSERT( nColCount, "Empty Table Line" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pTableBox = pLine->GetTabBoxes()[nCurrCol];
- ASSERT( pTableBox, "Missing Table Box" );
+ OSL_ENSURE( pTableBox, "Missing Table Box" );
pTableBox->setRowSpan( 1 );
}
}
@@ -2269,7 +2241,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwNodeIndex aIdx( rPos.nNode, -1 );
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
aIdx++;
- ASSERT( pTblNd, "wo ist denn nun der TableNode?" );
+ OSL_ENSURE( pTblNd, "wo ist denn nun der TableNode?" );
pTblNd->GetTable().SetRowsToRepeat( GetRowsToRepeat() );
@@ -2279,7 +2251,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
// ist im neuen Dokument ueberhaupt der FeldTyp vorhanden ?
SwFieldType* pFldType = pInsDoc->InsertFldType(
*((SwDDETable*)this)->GetDDEFldType() );
- ASSERT( pFldType, "unbekannter FieldType" );
+ OSL_ENSURE( pFldType, "unbekannter FieldType" );
// tauschen am Node den Tabellen-Pointer aus
pNewTbl = new SwDDETable( *pNewTbl,
@@ -2377,10 +2349,6 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
return sal_True;
}
-
-
-// ---------------------------------------------------------------
-
// suche ab dieser Line nach der naechsten Box mit Inhalt
SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
const SwTableBox* pSrchBox, sal_Bool bOvrTblLns ) const
@@ -2401,7 +2369,7 @@ SwTableBox* SwTableLine::FindNextBox( const SwTable& rTbl,
if( GetUpper() )
{
nFndPos = GetUpper()->GetTabLines().GetPos( pLine );
- ASSERT( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
// gibts eine weitere Line
if( nFndPos+1 >= GetUpper()->GetTabLines().Count() )
return GetUpper()->GetUpper()->FindNextBox( rTbl, GetUpper(), bOvrTblLns );
@@ -2452,7 +2420,7 @@ SwTableBox* SwTableLine::FindPreviousBox( const SwTable& rTbl,
if( GetUpper() )
{
nFndPos = GetUpper()->GetTabLines().GetPos( pLine );
- ASSERT( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nFndPos, "Line nicht in der Tabelle" );
// gibts eine weitere Line
if( !nFndPos )
return GetUpper()->GetUpper()->FindPreviousBox( rTbl, GetUpper(), bOvrTblLns );
@@ -2504,7 +2472,6 @@ SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
bOvrTblLns );
}
-
sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* )
{
// in der HeadLine sind die Absaetze mit BedingtenVorlage anzupassen
@@ -2522,8 +2489,6 @@ sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* )
return sal_True;
}
-/* */
-
SwTwips lcl_GetDistance( SwTableBox* pBox, sal_Bool bLeft )
{
sal_Bool bFirst = sal_True;
@@ -2742,8 +2707,6 @@ sal_Bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam,
return sal_True;
}
-/* */
-
sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
SwTwips nDist, sal_Bool bCheck )
{
@@ -2827,7 +2790,7 @@ sal_Bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
}
else
{
- ASSERT( pBox->GetSttNd(), "Das muss eine EndBox sein!");
+ OSL_ENSURE( pBox->GetSttNd(), "Das muss eine EndBox sein!");
if( !rParam.bLeft && 3 != nCmp )
++n;
@@ -2926,8 +2889,8 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
(n < rBoxes.Count() &&
- (nDist + nWidth + rBoxes[ n+1 ]->
- GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+ (nDist + nWidth + rBoxes[ n+1 ]->
+ GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide
)
@@ -2991,8 +2954,8 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
(rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
(TBLFIX_CHGABS != rParam.nMode ||
(n < rBoxes.Count() &&
- (nDist + nWidth + rBoxes[ n+1 ]->
- GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+ (nDist + nWidth + rBoxes[ n+1 ]->
+ GetFrmFmt()->GetFrmSize().GetWidth() / 2)
> rParam.nSide) ))
: (nDist + nWidth / 2 ) > rParam.nSide ))
{
@@ -3028,7 +2991,6 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
return sal_True;
}
-
// das Ergebnis des Positions Vergleiches
// POS_BEFORE, // Box liegt davor
// POS_BEHIND, // Box liegt dahinter
@@ -3037,7 +2999,6 @@ sal_Bool lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
// POS_EQUAL, // Box und Start/End sind gleich
// POS_OVERLAP_BEFORE, // Box ueberlappt den Start
// POS_OVERLAP_BEHIND // Box ueberlappt das Ende
-
SwComparePosition _CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd,
sal_uInt16 nBoxStt, sal_uInt16 nBoxEnd )
{
@@ -3430,7 +3391,7 @@ sal_Bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam,
break;
default:
- ASSERT( !pBox, "hier sollte man nie hinkommen" );
+ OSL_ENSURE( !pBox, "hier sollte man nie hinkommen" );
break;
}
}
@@ -3483,8 +3444,6 @@ sal_Bool lcl_DelOtherBox( SwTableLine* , CR_SetBoxWidth& , SwTwips , sal_Bool )
return sal_True;
}
-/* */
-
void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
{
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
@@ -3504,7 +3463,7 @@ void lcl_AjustLines( SwTableLine* pLine, CR_SetBoxWidth& rParam )
}
}
-#if defined(DBG_UTIL) || defined( JP_DEBUG )
+#if OSL_DEBUG_LEVEL > 1
void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
{
@@ -3524,10 +3483,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize )
if( Abs( nAktSize - nSize ) > ( COLFUZZY * rBoxes.Count() ) )
{
- DBG_ERROR( "Boxen der Line zu klein/gross" );
-#if defined( WNT ) && defined( JP_DEBUG )
- __asm int 3;
-#endif
+ OSL_FAIL( "Boxen der Line zu klein/gross" );
}
}
@@ -3562,7 +3518,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetBoxWidth& rParam, SwUndo** ppUndo,
{
_FndPara aPara( rParam.aBoxes, pFndBox );
rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
- ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
+ OSL_ENSURE( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
if( ppUndo )
@@ -4072,7 +4028,6 @@ sal_Bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
return bRet;
}
-/* */
_FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
SwTableSortBoxes& rTmpLst )
@@ -4080,7 +4035,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
// suche alle Boxen / Lines
SwTable& rTbl = rParam.pTblNd->GetTable();
- ASSERT( rParam.aBoxes.Count(), "ohne Boxen ist nichts zu machen!" );
+ OSL_ENSURE( rParam.aBoxes.Count(), "ohne Boxen ist nichts zu machen!" );
// loeschen der gesamten Tabelle verhindern
if( !rParam.bBigger && rParam.aBoxes.Count() ==
@@ -4094,7 +4049,7 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
{
_FndPara aPara( rParam.aBoxes, pFndBox );
rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
- ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
+ OSL_ENSURE( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
if( ppUndo )
@@ -4113,7 +4068,7 @@ void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewHeight,
sal_Bool bMinSize )
{
SwLayoutFrm* pLineFrm = GetRowFrm( rLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
SwFrmFmt* pFmt = rLine.ClaimFrmFmt();
@@ -4160,7 +4115,7 @@ sal_Bool lcl_SetSelLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// anhand der alten Size die neue relative errechnen
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
SwTwips nRstHeight = CalcRowRstHeight( pLineFrm );
if( (nRstHeight + ROWFUZZY) < nDist )
bRet = sal_False;
@@ -4178,7 +4133,7 @@ sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
{
// anhand der alten Size die neue relative errechnen
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
if( TBLFIX_CHGPROP == rParam.nMode )
{
@@ -4195,7 +4150,7 @@ sal_Bool lcl_SetOtherLineHeight( SwTableLine* pLine, CR_SetLineHeight& rParam,
if( TBLFIX_CHGPROP == rParam.nMode )
{
SwLayoutFrm* pLineFrm = GetRowFrm( *pLine );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
// aus der alten Size die neue relative errechnen
// Wird die selektierte Box groesser ueber den MaxSpace anpassen,
@@ -4404,8 +4359,7 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
- // #110525# delete complete table when last row is
- // deleted
+ // delete complete table when last row is deleted
if( !bBigger &&
aParam.aBoxes.Count() == aSortCntBoxes.Count() )
{
@@ -4441,7 +4395,7 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
for( n = nStt; n < nEnd; ++n )
{
SwLayoutFrm* pLineFrm = GetRowFrm( *(*pLines)[ n ] );
- ASSERT( pLineFrm, "wo ist der Frm von der SwTableLine?" );
+ OSL_ENSURE( pLineFrm, "wo ist der Frm von der SwTableLine?" );
aParam.nMaxSpace += CalcRowRstHeight( pLineFrm );
aParam.nMaxHeight += pLineFrm->Frm().Height();
}
@@ -4569,8 +4523,6 @@ sal_Bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
return bRet;
}
-/* */
-
SwFrmFmt* SwShareBoxFmt::GetFormat( long nWidth ) const
{
SwFrmFmt *pRet = 0, *pTmp;
@@ -4642,10 +4594,6 @@ SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt,
void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
{
- // wenn das Format nicht geshared ist, braucht es auch nicht in die
- // Liste aufgenommen werden. Denn es gibt keinen 2. der es sucht.
-//leider werden auch die CellFrms gefunden
-// if( !rOld.IsLastDepend() )
{
sal_uInt16 nPos;
SwShareBoxFmt* pEntry;
@@ -4660,6 +4608,7 @@ void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
pEntry->AddFormat( rNew );
}
}
+
void SwShareBoxFmts::ChangeFrmFmt( SwTableBox* pBox, SwTableLine* pLn,
SwFrmFmt& rFmt )
{
@@ -4767,4 +4716,4 @@ sal_Bool SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, sal_uInt16* pPos ) co
return sal_False;
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index b5ca141e1fa2..a39ced3f767e 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -137,3 +138,4 @@ sal_Bool SwDoc::IsVisitedURL( const String& rURL ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/cancellablejob.cxx b/sw/source/core/docnode/cancellablejob.cxx
index e769949ab87c..ec32c602137f 100644
--- a/sw/source/core/docnode/cancellablejob.cxx
+++ b/sw/source/core/docnode/cancellablejob.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,3 +39,5 @@ void SAL_CALL CancellableJob::cancel() throw (com::sun::star::uno::RuntimeExcept
{
mrThread->join();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/cancellablejob.hxx b/sw/source/core/docnode/cancellablejob.hxx
index f2c26630bd81..d675159f757b 100644
--- a/sw/source/core/docnode/cancellablejob.hxx
+++ b/sw/source/core/docnode/cancellablejob.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,3 +52,5 @@ private:
::rtl::Reference< ObservableThread > mrThread;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index f4cedbbf8cdb..ec1a4c63ad4f 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,10 +28,7 @@
#include "precompiled_sw.hxx"
#include <finalthreadmanager.hxx>
-#ifndef _OSL_THREAD_HXX_
#include <osl/thread.hxx>
-#endif
-#include <errhdl.hxx>
#include <pausethreadstarting.hxx>
#include <swthreadjoiner.hxx>
@@ -61,21 +59,16 @@ class CancelJobsThread : public osl::Thread
virtual ~CancelJobsThread() {}
void addJobs( std::list< css::uno::Reference< css::util::XCancellable > >& rJobs );
-
bool allJobsCancelled() const;
-
void stopWhenAllJobsCancelled();
private:
-
bool existJobs() const;
css::uno::Reference< css::util::XCancellable > getNextJob();
bool stopped() const;
-
virtual void SAL_CALL run();
-
mutable osl::Mutex maMutex;
std::list< css::uno::Reference< css::util::XCancellable > > maJobs;
@@ -144,9 +137,7 @@ void SAL_CALL CancelJobsThread::run()
{
css::uno::Reference< css::util::XCancellable > aJob( getNextJob() );
if ( aJob.is() )
- {
aJob->cancel();
- }
}
mbAllJobsCancelled = true;
@@ -180,22 +171,17 @@ class TerminateOfficeThread : public osl::Thread
}
virtual ~TerminateOfficeThread() {}
-
void StopOfficeTermination();
private:
-
virtual void SAL_CALL run();
virtual void SAL_CALL onTerminated();
-
bool OfficeTerminationStopped();
-
void PerformOfficeTermination();
osl::Mutex maMutex;
const CancelJobsThread& mrCancelJobsThread;
-
bool mbStopOfficeTermination;
css::uno::Reference< css::uno::XComponentContext > mxContext;
@@ -222,15 +208,11 @@ void SAL_CALL TerminateOfficeThread::run()
osl::MutexGuard aGuard(maMutex);
if ( mrCancelJobsThread.allJobsCancelled() )
- {
break;
- }
}
if ( !OfficeTerminationStopped() )
- {
PerformOfficeTermination();
- }
}
void TerminateOfficeThread::PerformOfficeTermination()
@@ -242,14 +224,14 @@ void TerminateOfficeThread::PerformOfficeTermination()
css::uno::UNO_QUERY );
if ( !xTasksSupplier.is() )
{
- ASSERT( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XFramesSupplier!" );
+ OSL_ENSURE( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XFramesSupplier!" );
return;
}
css::uno::Reference< css::container::XElementAccess > xList( xTasksSupplier->getFrames(), css::uno::UNO_QUERY );
if ( !xList.is() )
{
- ASSERT( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XElementAccess!" );
+ OSL_ENSURE( false, "<TerminateOfficeThread::PerformOfficeTermination()> - no XElementAccess!" );
return;
}
@@ -257,18 +239,14 @@ void TerminateOfficeThread::PerformOfficeTermination()
{
css::uno::Reference< css::frame::XDesktop > xDesktop( xTasksSupplier, css::uno::UNO_QUERY );
if ( xDesktop.is() && !OfficeTerminationStopped() )
- {
xDesktop->terminate();
- }
}
}
void SAL_CALL TerminateOfficeThread::onTerminated()
{
if ( OfficeTerminationStopped() )
- {
delete this;
- }
}
@@ -297,9 +275,7 @@ void FinalThreadManager::registerAsListenerAtDesktop()
css::uno::UNO_QUERY );
if ( xDesktop.is() )
- {
xDesktop->addTerminateListener( css::uno::Reference< css::frame::XTerminateListener >( static_cast< cppu::OWeakObject* >( this ), css::uno::UNO_QUERY ) );
- }
}
FinalThreadManager::~FinalThreadManager()
@@ -318,16 +294,14 @@ FinalThreadManager::~FinalThreadManager()
if ( !maThreads.empty() )
{
- ASSERT( false, "<FinalThreadManager::~FinalThreadManager()> - still registered jobs are existing -> perform cancellation" );
+ OSL_ENSURE( false, "<FinalThreadManager::~FinalThreadManager()> - still registered jobs are existing -> perform cancellation" );
cancelAllJobs();
}
if ( mpCancelJobsThread != 0 )
{
if ( !mpCancelJobsThread->allJobsCancelled() )
- {
- ASSERT( false, "<FinalThreadManager::~FinalThreadManager()> - cancellation of registered jobs not yet finished -> wait for its finish" );
- }
+ OSL_ENSURE( false, "<FinalThreadManager::~FinalThreadManager()> - cancellation of registered jobs not yet finished -> wait for its finish" );
mpCancelJobsThread->stopWhenAllJobsCancelled();
mpCancelJobsThread->join();
@@ -397,8 +371,6 @@ void SAL_CALL FinalThreadManager::cancelAllJobs() throw (css::uno::RuntimeExcept
mpCancelJobsThread = new CancelJobsThread( aThreads );;
if ( !mpCancelJobsThread->create() )
{
- // error handling
- // ASSERT( false, "<FinalThreadManager::cancelAllJobs()> - thread to cancel jobs can't be setup --> synchron cancellation of jobs" );
delete mpCancelJobsThread;
mpCancelJobsThread = 0;
while ( !aThreads.empty() )
@@ -409,9 +381,7 @@ void SAL_CALL FinalThreadManager::cancelAllJobs() throw (css::uno::RuntimeExcept
}
}
else
- {
mpCancelJobsThread->addJobs( aThreads );
- }
}
}
@@ -438,20 +408,16 @@ void SAL_CALL FinalThreadManager::queryTermination( const css::lang::EventObject
if ( mpTerminateOfficeThread != 0 )
{
if ( mpTerminateOfficeThread->isRunning() )
- {
mpTerminateOfficeThread->StopOfficeTermination(); // thread kills itself.
- }
else
- {
delete mpTerminateOfficeThread;
- }
+
mpTerminateOfficeThread = 0;
}
mpTerminateOfficeThread = new TerminateOfficeThread( *mpCancelJobsThread,
m_xContext );
if ( !mpTerminateOfficeThread->create() )
{
- // ASSERT( false, "FinalThreadManager::queryTermination(..) - thread to terminate office can't be started!" );
delete mpTerminateOfficeThread;
mpTerminateOfficeThread = 0;
}
@@ -480,30 +446,18 @@ void SAL_CALL FinalThreadManager::notifyTermination( const css::lang::EventObjec
if ( mpTerminateOfficeThread != 0 )
{
if ( mpTerminateOfficeThread->isRunning() )
- {
- // ASSERT( false, "<FinalThreadManager::notifyTermination()> - office termination thread still running!" );
mpTerminateOfficeThread->StopOfficeTermination(); // thread kills itself.
- }
else
- {
delete mpTerminateOfficeThread;
- }
+
mpTerminateOfficeThread = 0;
}
if ( !maThreads.empty() )
- {
- // ASSERT( false, "<FinalThreadManager::notifyTermination()> - still registered jobs are existing" );
cancelAllJobs();
- }
if ( mpCancelJobsThread != 0 )
{
- if ( !mpCancelJobsThread->allJobsCancelled() )
- {
- // ASSERT( false, "<FinalThreadManager::notifyTermination()> - cancellation of registered jobs not yet finished -> wait for its finish" );
- }
-
mpCancelJobsThread->stopWhenAllJobsCancelled();
mpCancelJobsThread->join();
delete mpCancelJobsThread;
@@ -547,3 +501,5 @@ namespace comp_FinalThreadManager {
}
} // closing component helper namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 61e1f8eabeaa..2e73d1cb620b 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,15 +56,12 @@
#include <pagedesc.hxx>
#include <poolfmt.hxx>
#include <SwNodeNum.hxx>
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
namespace
{
@@ -119,11 +117,9 @@ namespace
nNdOff -= nDelCount;
xub_StrLen nCntntPos = rOrigPos.nContent.GetIndex();
- // --> OD, AMA 2008-07-07 #b6713815#
// Always adjust <nNode> at to be changed <SwPosition> instance <rChgPos>
rChgPos.nNode = nNdOff + rCpyStt.nNode.GetIndex();
if( !nNdOff )
- // <--
{
// dann nur den Content anpassen
if( nCntntPos > rOrigStt.nContent.GetIndex() )
@@ -255,7 +251,7 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// kopiere Attribute/Text
if( !pCpyAttrNd->HasSwAttrSet() )
// wurde ein AttrSet fuer die Numerierung angelegt, so loesche diesen!
- pTxtNd->ResetAllAttr();
+ pCpyAttrNd->ResetAllAttr();
// if Copy-Textnode unequal to Copy-Attrnode, then copy first
// the attributes into the new Node.
@@ -272,7 +268,7 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
}
// ??? reicht das ??? was ist mit PostIts/Feldern/FeldTypen ???
- // --> OD 2008-11-18 #i96213# - force copy of all attributes
+ // #i96213# - force copy of all attributes
pCpyTxtNd->CopyText( pTxtNd, SwIndex( pCpyTxtNd ),
pCpyTxtNd->GetTxt().Len(), true );
// <--
@@ -360,7 +356,7 @@ sal_Bool lcl_CopyTblBox( const SwTableBox*& rpBox, void* pPara )
{
SwNodeIndex aNewIdx( *pCT->pTblNd,
rpBox->GetSttIdx() - pCT->nOldTblSttIdx );
- ASSERT( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" );
+ OSL_ENSURE( aNewIdx.GetNode().IsStartNode(), "Index nicht auf einem StartNode" );
pNewBox = new SwTableBox( pBoxFmt, aNewIdx, pCT->pInsLine );
pNewBox->setRowSpan( rpBox->getRowSpan() );
}
@@ -416,17 +412,6 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SwNodes& rNds = (SwNodes&)GetNodes();
{
- // nicht in Fussnoten kopieren !!
-/*
-!! Mal ohne Frames
- SwCntntNode* pCNd = pDoc->GetNodes()[ rIdx ]->GetCntntNode();
- SwFrm* pFrm;
- if( (pCNd && 0 != ( pFrm = pCNd->GetFrm()))
- ? pFrm->FindFtnFrm()
- : rIdx < pDoc->GetNodes().EndOfInserts &&
- pDoc->GetNodes()[pDoc->GetNodes().EndOfInserts]->StartOfSection()
- < rIdx )
-*/
if( rIdx < pDoc->GetNodes().GetEndOfInserts().GetIndex() &&
rIdx >= pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex() )
return 0;
@@ -468,7 +453,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
pDoc->InsDeletedFldType( *pDDEType );
else
pDDEType = (SwDDEFieldType*)pDoc->InsertFldType( *pDDEType );
- ASSERT( pDDEType, "unbekannter FieldType" );
+ OSL_ENSURE( pDDEType, "unbekannter FieldType" );
// tauschen am Node den Tabellen-Pointer aus
SwDDETable* pNewTable = new SwDDETable( pTblNd->GetTable(), pDDEType );
@@ -727,8 +712,8 @@ SwDoc::CopyRange( SwPaM& rPam, SwPosition& rPos, const bool bCopyAll ) const
}
else
{
- ASSERT( this == pDoc, " falscher Copy-Zweig!" );
- ASSERT(false, "mst: i thought this could be dead code;"
+ OSL_ENSURE( this == pDoc, " falscher Copy-Zweig!" );
+ OSL_ENSURE(false, "mst: i thought this could be dead code;"
"please tell me what you did to get here!");
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
@@ -827,7 +812,7 @@ bool lcl_MarksWholeNode(const SwPaM & rPam)
return bResult;
}
-// --> OD 2009-08-25 #i86492#
+// #i86492#
bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam )
{
bool bRet = false;
@@ -899,6 +884,17 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// die Position nicht "verschoben"
aCpyPam.SetMark();
sal_Bool bCanMoveBack = aCpyPam.Move( fnMoveBackward, fnGoCntnt );
+ // If the position was shifted from more than one node, an end node has been skipped
+ bool bAfterTable = false;
+ if ( ( rPos.nNode.GetIndex() - aCpyPam.GetPoint()->nNode.GetIndex() ) > 1 )
+ {
+ // First go back to the original place
+ aCpyPam.GetPoint()->nNode = rPos.nNode;
+ aCpyPam.GetPoint()->nContent = rPos.nContent;
+
+ bCanMoveBack = false;
+ bAfterTable = true;
+ }
if( !bCanMoveBack )
aCpyPam.GetPoint()->nNode--;
@@ -920,7 +916,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
pDoc->SetOutlineNumRule(*GetOutlineNumRule());
}
- // --> OD 2009-08-25 #i86492#
+ // #i86492#
// Correct the search for a previous list:
// First search for non-outline numbering list. Then search for non-outline
// bullet list.
@@ -934,7 +930,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
pDoc->SearchNumRule( rPos, false, false, false, 0, aListIdToPropagate, true );
}
// <--
- // --> OD 2009-08-25 #i86492#
+ // #i86492#
// Do not propagate previous found list, if
// - destination is an empty paragraph which is not in a list and
// - source contains at least one paragraph which is not in a list
@@ -1008,9 +1004,8 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
}
}
- /* #107213#: Safe numrule item at destination. */
- // --> OD 2009-08-25 #i86492#
- // Safe also <ListId> item of destination.
+ // Safe numrule item at destination.
+ // #i86492# - Safe also <ListId> item of destination.
int aNumRuleState = SFX_ITEM_UNKNOWN;
SwNumRuleItem aNumRuleItem;
int aListIdState = SFX_ITEM_UNKNOWN;
@@ -1033,7 +1028,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
}
}
// <--
- /* #107213# */
if( !bCopyOk )
{
@@ -1053,10 +1047,9 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
{
pSttTxtNd->CopyCollFmt( *pDestTxtNd );
- /* #107213# If only a part of one paragraph is copied
+ /* If only a part of one paragraph is copied
restore the numrule at the destination. */
- // --> OD 2009-08-25 #i86492#
- // restore also <ListId> item
+ // #i86492# - restore also <ListId> item
if ( !lcl_MarksWholeNode(rPam) )
{
if (SFX_ITEM_SET == aNumRuleState)
@@ -1148,7 +1141,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
aDestIdx.Assign( pDestTxtNd, 0 );
aInsPos--;
- // #112756# #98130# if we have to insert an extra text node
+ // if we have to insert an extra text node
// at the destination, this node will be our new destination
// (text) node, and thus we set bStartisTxtNode to true. This
// will ensure that this node will be deleted during Undo
@@ -1157,9 +1150,8 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
bStartIsTxtNode = sal_True;
}
- /* #107213# Save numrule at destination */
- // --> OD 2009-08-25 #i86492#
- // Safe also <ListId> item of destination.
+ // Save numrule at destination
+ // #i86492# - Safe also <ListId> item of destination.
int aNumRuleState = SFX_ITEM_UNKNOWN;
SwNumRuleItem aNumRuleItem;
int aListIdState = SFX_ITEM_UNKNOWN;
@@ -1182,7 +1174,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
}
}
// <--
- /* #107213# */
const bool bEmptyDestNd = 0 == pDestTxtNd->GetTxt().Len();
pEndTxtNd->CopyText( pDestTxtNd, aDestIdx, SwIndex( pEndTxtNd ),
@@ -1195,10 +1186,9 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if ( bOneNode )
{
- /* #107213# If only a part of one paragraph is copied
+ /* If only a part of one paragraph is copied
restore the numrule at the destination. */
- // --> OD 2009-08-25 #i86492#
- // restore also <ListId> item
+ // #i86492# - restore also <ListId> item
if ( !lcl_MarksWholeNode(rPam) )
{
if (SFX_ITEM_SET == aNumRuleState)
@@ -1269,7 +1259,20 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
else
*aCpyPam.GetMark() = rPos;
- aCpyPam.Move( fnMoveForward, bCanMoveBack ? fnGoCntnt : fnGoNode );
+ if ( !bAfterTable )
+ aCpyPam.Move( fnMoveForward, bCanMoveBack ? fnGoCntnt : fnGoNode );
+ else
+ {
+ // Reset the offset to 0 as it was before the insertion
+ aCpyPam.GetPoint( )->nContent -= aCpyPam.GetPoint( )->nContent;
+
+ aCpyPam.GetPoint( )->nNode++;
+ // If the next node is a start node, then step back: the start node
+ // has been copied and needs to be in the selection for the undo
+ if ( aCpyPam.GetPoint()->nNode.GetNode().IsStartNode() )
+ aCpyPam.GetPoint( )->nNode--;
+
+ }
aCpyPam.Exchange();
// dann kopiere noch alle Bookmarks
@@ -1294,9 +1297,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
if ( pNumRuleToPropagate )
{
- // --> OD 2009-08-25 #i86492#
- // use <SwDoc::SetNumRule(..)>, because it also handles the <ListId>
-// pDoc->ReplaceNumRule(aCpyPam, *pNumRuleToPropagate);
+ // #i86492# - use <SwDoc::SetNumRule(..)>, because it also handles the <ListId>
pDoc->SetNumRule( aCpyPam, *pNumRuleToPropagate, false,
aListIdToPropagate, sal_True, true );
}
@@ -1327,7 +1328,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte
aRedlRest.Restore();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
//JP 17.06.99: Bug 66973 - check count only if the selection is in
// the same (or no) section. Becaus not full selected
@@ -1339,9 +1340,9 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte
!rRg.aStart.GetNode().IsSectionNode() &&
!aTmpI.GetNode().IsEndNode() )
{
- ASSERT( rInsPos.GetIndex() - aSavePos.GetIndex() ==
+ OSL_ENSURE( rInsPos.GetIndex() - aSavePos.GetIndex() ==
rRg.aEnd.GetIndex() - rRg.aStart.GetIndex(),
- "Es wurden zu wenig Nodes kopiert!" )
+ "Es wurden zu wenig Nodes kopiert!" );
}
}
#endif
@@ -1470,7 +1471,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
{
const _ZSortFly& rZSortFly = aArr[ n ];
- // --> OD 2006-01-04 #i59964#
+ // #i59964#
// correct determination of new anchor position
SwFmtAnchor aAnchor( *rZSortFly.GetAnchor() );
SwPosition* pNewPos = (SwPosition*)aAnchor.GetCntntAnchor();
@@ -1503,7 +1504,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
{
// This case can *not* happen, but to be robust take the first
// text node in the destination document.
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::_CopyFlyInFly(..)> - anchor text node in copied range not found" );
nAnchorTxtNdNumInRange = 1;
}
@@ -1529,7 +1530,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
{
// This case can *not* happen, but to be robust take the first
// text node in the destination document.
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDoc::_CopyFlyInFly(..)> - found anchor node index isn't a text node" );
aAnchorNdIdx = rStartIdx;
while ( !aAnchorNdIdx.GetNode().IsTxtNode() )
@@ -1585,7 +1586,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
//Alle chains, die im Original vorhanden sind, soweit wie moeglich wieder
//aufbauen.
- ASSERT( aArr.Count() == aNewArr.Count(), "Missing new Flys" );
+ OSL_ENSURE( aArr.Count() == aNewArr.Count(), "Missing new Flys" );
if ( aArr.Count() == aNewArr.Count() )
{
for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
@@ -1618,3 +1619,4 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndindex.cxx b/sw/source/core/docnode/ndindex.cxx
index a6b718df2d09..3b064674d7bd 100644
--- a/sw/source/core/docnode/ndindex.cxx
+++ b/sw/source/core/docnode/ndindex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-#include "errhdl.hxx" // fuers ASSERT
-#include "error.h" // fuers ASSERT
#include "ndindex.hxx"
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
int SwNodeIndex::nSerial = 0;
#endif
@@ -68,7 +65,7 @@ SwNodeIndex::SwNodeIndex( SwNodes& rNds, sal_uLong nIdx )
{
rNds.RegisterIndex( *this );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
}
@@ -83,7 +80,7 @@ SwNodeIndex::SwNodeIndex( const SwNodeIndex& rIdx, long nDiff )
pNd = rIdx.pNd;
pNd->GetNodes().RegisterIndex( *this );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
}
@@ -98,7 +95,7 @@ SwNodeIndex::SwNodeIndex( const SwNode& rNd, long nDiff )
pNd = (SwNode*)&rNd;
pNd->GetNodes().RegisterIndex( *this );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
MySerial = ++nSerial; // nur in der nicht PRODUCT-Version
#endif
}
@@ -166,3 +163,4 @@ SwNodeIndex& SwNodeIndex::Assign( const SwNode& rNd, long nOffset )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 6ad9605a18f2..c244e14267c4 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,7 @@
#include <istyleaccess.hxx>
#include <SwStyleNameMapper.hxx>
-// --> OD 2009-07-13 #i73249#
-#include <frmfmt.hxx>
-// <--
+#include <frmfmt.hxx> // #i73249#
SwNoTxtNode::SwNoTxtNode( const SwNodeIndex & rWhere,
const sal_uInt8 nNdType,
@@ -75,7 +74,7 @@ SwNoTxtNode::~SwNoTxtNode()
// fuer Frame- und Grafik-Attributen
void SwNoTxtNode::NewAttrSet( SwAttrPool& rPool )
{
- ASSERT( !mpAttrSet.get(), "AttrSet ist doch gesetzt" );
+ OSL_ENSURE( !mpAttrSet.get(), "AttrSet ist doch gesetzt" );
SwAttrSet aNewAttrSet( rPool, aNoTxtNodeSetRange );
// put names of parent style and conditional style:
@@ -120,7 +119,7 @@ void SwNoTxtNode::SetContour( const PolyPolygon *pPoly, sal_Bool bAutomatic )
void SwNoTxtNode::CreateContour()
{
- ASSERT( !pContour, "Contour available." );
+ OSL_ENSURE( !pContour, "Contour available." );
pContour = new PolyPolygon(SvxContourDlg::CreateAutoContour(GetGraphic()));
bAutomaticContour = sal_True;
bContourMapModeValid = sal_True;
@@ -136,7 +135,7 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM );
if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap )
{
- ASSERT( !bPixelGrf || aGrfMap == aContourMap,
+ OSL_ENSURE( !bPixelGrf || aGrfMap == aContourMap,
"scale factor for pixel unsupported" );
OutputDevice* pOutDev =
(bPixelGrf || bPixelContour) ? Application::GetDefaultDevice()
@@ -170,7 +169,7 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
void SwNoTxtNode::GetContour( PolyPolygon &rPoly ) const
{
- ASSERT( pContour, "Contour not available." );
+ OSL_ENSURE( pContour, "Contour not available." );
rPoly = *HasContour();
}
@@ -194,7 +193,7 @@ sal_Bool SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
{
const MapMode aGrfMap( GetGraphic().GetPrefMapMode() );
const MapMode aContourMap( MAP_100TH_MM );
- ASSERT( aGrfMap.GetMapUnit() != MAP_PIXEL ||
+ OSL_ENSURE( aGrfMap.GetMapUnit() != MAP_PIXEL ||
aGrfMap == MapMode( MAP_PIXEL ),
"scale factor for pixel unsupported" );
if( aGrfMap.GetMapUnit() != MAP_PIXEL &&
@@ -245,18 +244,18 @@ Graphic SwNoTxtNode::GetGraphic() const
}
else
{
- ASSERT( GetOLENode(), "new type of Node?" );
+ OSL_ENSURE( GetOLENode(), "new type of Node?" );
aRet = *((SwOLENode*)this)->SwOLENode::GetGraphic();
}
return aRet;
}
-// --> OD 2009-07-14 #i73249#
+// #i73249#
void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast )
{
// Title attribute of <SdrObject> replaces own AlternateText attribute
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt());
- ASSERT( pFlyFmt,
+ OSL_ENSURE( pFlyFmt,
"<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" );
if ( !pFlyFmt )
{
@@ -269,7 +268,7 @@ void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast )
const String SwNoTxtNode::GetTitle() const
{
const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt());
- ASSERT( pFlyFmt,
+ OSL_ENSURE( pFlyFmt,
"<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" );
if ( !pFlyFmt )
{
@@ -282,7 +281,7 @@ const String SwNoTxtNode::GetTitle() const
void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt());
- ASSERT( pFlyFmt,
+ OSL_ENSURE( pFlyFmt,
"<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" );
if ( !pFlyFmt )
{
@@ -295,7 +294,7 @@ void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast )
const String SwNoTxtNode::GetDescription() const
{
const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt());
- ASSERT( pFlyFmt,
+ OSL_ENSURE( pFlyFmt,
"<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" );
if ( !pFlyFmt )
{
@@ -305,3 +304,5 @@ const String SwNoTxtNode::GetDescription() const
return pFlyFmt->GetObjDescription();
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index 6e00748b618e..4ff342d9570c 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,13 +48,13 @@ sal_Bool SwOutlineNodes::Seek_Entry( const SwNodePtr rSrch, sal_uInt16* pFndPos
//JP 17.03.98: aufgrund des Bug 48592 - wo unter anderem nach Undo/Redo
// Nodes aus dem falschen NodesArray im OutlineArray standen,
// jetzt mal einen Check eingebaut.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
for( sal_uInt16 n = 1; n < nO; ++n )
if( &(*this)[ n-1 ]->GetNodes() !=
&(*this)[ n ]->GetNodes() )
{
- ASSERT( !this, "Node im falschen Outline-Array" );
+ OSL_ENSURE( !this, "Node im falschen Outline-Array" );
}
}
#endif
@@ -97,7 +98,6 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
{
if (! bFound)
{
- // --> OD 2005-11-02 #125329#
// assure that text is in the correct nodes array
if ( &(pTxtNd->GetNodes()) == this )
{
@@ -105,10 +105,9 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwNodes::UpdateOutlineNode(..)> - given text node isn't in the correct nodes array. This is a serious defect -> inform OD" );
}
- // <--
}
}
else
@@ -124,83 +123,6 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
}
}
-//void SwNodes::UpdateOutlineNode( const SwNode& rNd, sal_uInt8 nOldLevel, //#outline level,removed by zhaojianwei
-// sal_uInt8 nNewLevel )
-//{
-// const SwNodePtr pSrch = (SwNodePtr)&rNd;
-// sal_uInt16 nSttPos;
-// sal_Bool bSeekIdx = pOutlineNds->Seek_Entry( pSrch, &nSttPos );
-//
-// //if( NO_NUMBERING == nOldLevel ) //#outline level,zhaojianwei
-// if( 0 == nOldLevel ) //<-end, zhaojianwei
-// {
-// // nicht vorhanden, also einfuegen
-// //ASSERT( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" );
-//
-// //JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
-// sal_uLong nNd = rNd.GetIndex();
-// if( nNd < GetEndOfRedlines().GetIndex() &&
-// nNd > GetEndOfRedlines().StartOfSectionNode()->GetIndex() )
-// return ;
-//
-// // jetzt noch alle nachfolgende Outline-Nodes updaten
-// if (! bSeekIdx)
-// {
-// // --> OD 2005-11-03 #125329#
-// // assure that node <pSrch> is in the correct nodes array
-// if ( &(pSrch->GetNodes()) == this )
-// {
-// pOutlineNds->Insert( pSrch );
-// }
-// else
-// {
-// ASSERT( false,
-// "<SwNodes::UpdateOutlineNode(..)> - node <pSrch> isn't in correct nodes array. This is a serious defect -> inform OD" );
-// }
-// // <--
-// }
-//
-// }
-// //else if( NO_NUMBERING == nNewLevel ) //#outline level,removed by zhaojianwei
-// else if( 0 == nNewLevel ) //<-end,added by zhaojianwei // Level entfernen
-// {
-// if( !bSeekIdx )
-// return;
-//
-// // jetzt noch alle nachfolgende Outline-Nodes updaten
-// pOutlineNds->Remove( nSttPos );
-// }
-// else if( !bSeekIdx ) // Update und Index nicht gefunden ??
-// return ;
-//
-// {
-// SwTxtNode & rTxtNd = (SwTxtNode &) rNd;
-// SwPaM aPam(rTxtNd); // #115901#
-//
-// //if (nNewLevel != NO_NUMBERING) //#outline level,zhaojianwei // #115901#
-// if (nNewLevel != 0) //<-end,zhaojianwei // #115901#
-// {
-// //rTxtNd.SetLevel(rTxtNd.GetTxtColl()->GetOutlineLevel()); //#outline level,zhaojianwei
-// //rTxtNd.NumRuleChgd();
-// if(rTxtNd.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
-// {
-// rTxtNd.SetLevel(rTxtNd.GetTxtColl()->GetAssignedOutlineStyleLevel());
-// rTxtNd.NumRuleChgd();
-// }//<-end,zhaojianwei
-//
-// //GetDoc()->SetNumRule(aPam, *GetDoc()->GetOutlineNumRule());
-// }
-// else
-// {
-// GetDoc()->DelNumRules(aPam);
-// }
-// }
-//
-// // die Gliederungs-Felder Updaten
-// GetDoc()->GetSysFldType( RES_CHAPTERFLD )->UpdateFlds();
-// GetDoc()->ChkCondColls();
-//}//<-end,zhaojianwei
-
void SwNodes::UpdtOutlineIdx( const SwNode& rNd )
{
if( !pOutlineNds->Count() ) // keine OutlineNodes vorhanden ?
@@ -223,3 +145,5 @@ const SwOutlineNodes & SwNodes::GetOutLineNds() const
{
return *pOutlineNds;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index d61ad4f0b763..95d85a36d5fd 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,13 +62,13 @@
#include <doctxm.hxx>
#include <fmtftntx.hxx>
#include <comcore.hrc>
-// --> OD 2005-12-01 #i27138#
+// #i27138#
#include <viewsh.hxx>
#include <txtfrm.hxx>
// <--
-// OD 04.11.2003 #i21457# - new implementation of local method <lcl_IsInSameTblBox(..)>.
+// #i21457# - new implementation of local method <lcl_IsInSameTblBox(..)>.
// Method now determines the previous/next on its own. Thus, it can be controlled,
// for which previous/next is checked, if it's visible.
bool lcl_IsInSameTblBox( SwNodes& _rNds,
@@ -94,7 +95,7 @@ bool lcl_IsInSameTblBox( SwNodes& _rNds,
? !_rNds.GoPrevSection( &aChkIdx, sal_False, sal_False )
: !_rNds.GoNextSection( &aChkIdx, sal_False, sal_False ) )
{
- ASSERT( false, "<lcl_IsInSameTblBox(..)> - no previous/next!" );
+ OSL_ENSURE( false, "<lcl_IsInSameTblBox(..)> - no previous/next!" );
return false;
}
else
@@ -143,13 +144,13 @@ void lcl_CheckEmptyLayFrm( SwNodes& rNds, SwSectionData& rSectionData,
SwNodeIndex aIdx( rStt );
if( !rNds.GoPrevSection( &aIdx, sal_True, sal_False ) ||
!CheckNodesRange( rStt, aIdx, sal_True ) ||
- // OD 04.11.2003 #i21457#
+ // #i21457#
!lcl_IsInSameTblBox( rNds, rStt, true ))
{
aIdx = rEnd;
if( !rNds.GoNextSection( &aIdx, sal_True, sal_False ) ||
!CheckNodesRange( rEnd, aIdx, sal_True ) ||
- // OD 04.11.2003 #i21457#
+ // #i21457#
!lcl_IsInSameTblBox( rNds, rEnd, false ))
{
rSectionData.SetHidden( false );
@@ -167,7 +168,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
if( rRange.HasMark() &&
0 == ( nRegionRet = IsInsRegionAvailable( rRange, &pPrvNd ) ))
{
- ASSERT( !this, "Selection ueber verschiedene Sections" );
+ OSL_ENSURE( !this, "Selection ueber verschiedene Sections" );
return 0;
}
@@ -213,7 +214,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
*pEndPos = (SwPosition*)rRange.End();
if( pPrvNd && 3 == nRegionRet )
{
- ASSERT( pPrvNd, "der SectionNode fehlt" );
+ OSL_ENSURE( pPrvNd, "der SectionNode fehlt" );
SwNodeIndex aStt( pSttPos->nNode ), aEnd( pEndPos->nNode, +1 );
while( pPrvNd != aStt.GetNode().StartOfSectionNode() )
aStt--;
@@ -465,7 +466,6 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
aIdx++;
} while( aIdx.GetNode().IsEndNode() &&
0 != aIdx.GetNode().FindSectionNode() );
-// if( !aIdx.GetNode().IsEndNode() )
{
nRet = 2;
if( ppSttNd )
@@ -621,7 +621,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
{
SwSectionFmt* pFmt = (*pSectionFmtTbl)[ nPos ];
SwSection* pSection = pFmt->GetSection();
- /// OD 04.10.2002 #102894#
+
/// remember hidden condition flag of SwSection before changes
bool bOldCondHidden = pSection->IsCondHidden() ? true : false;
@@ -692,7 +692,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
// 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
+ // Der LinkFileName koennte auch nur aus Separatoren bestehen
String sCompareString = sfx2::cTokenSeperator;
sCompareString += sfx2::cTokenSeperator;
const bool bUpdate =
@@ -707,13 +707,12 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
else
sSectName.Erase();
- /// OD 04.10.2002 #102894# - NOTE
/// 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 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#.
+ /// could be very risky.
pSection->SetSectionData(rNewData);
if( pAttr )
@@ -732,7 +731,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
if( !pIdx )
pIdx = pFmt->GetCntnt().GetCntntIdx();
FldsToCalc( aCalc, pIdx->GetIndex(), USHRT_MAX );
- /// 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 sal_False, if hidden condition flag of <pFmt->GetSection()>
@@ -760,7 +759,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData,
SetModified();
}
-/* -----------------19.02.99 09:31-------------------
+/* --------------------------------------------------
* LockFrms wurde im InsertSection genutzt, um zu verhindern, dass
* SectionFrms durch das DelFrms zerstoert werden. Dies ist durch
* den Destroy-Listen-Mechanismus ueberfluessig geworden.
@@ -818,7 +817,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
if( !pEnde ) // kein Bereich also neue Section davor/hinter anlegen
{
// #i26762#
- ASSERT(!pEnde || rNdIdx <= *pEnde,
+ OSL_ENSURE(!pEnde || rNdIdx <= *pEnde,
"Section start and end in wrong order!");
if( bInsAtStart )
@@ -1041,7 +1040,7 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
SwFrm* pTmp = pFrm;
while( pTmp )
{
- ASSERT( !pTmp->GetUpper(), "SwClearDummies: No Upper allowed!" );
+ OSL_ENSURE( !pTmp->GetUpper(), "SwClearDummies: No Upper allowed!" );
if( pTmp->IsSctFrm() )
{
SwSectionFrm* pSectFrm = (SwSectionFrm*)pFrm;
@@ -1128,11 +1127,11 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
SwFrm *pFrm, *pNew;
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
- ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." );
+ OSL_ENSURE( pFrm->IsSctFrm(), "Depend von Section keine Section." );
pNew = rIdx.GetNode().GetCntntNode()->MakeFrm();
SwSectionNode* pS = rIdx.GetNode().FindSectionNode();
- // --> OD 2008-06-23 #156927#
+
// Assure that node is not inside a table, which is inside the
// found section.
if ( pS )
@@ -1144,25 +1143,24 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
pS = 0;
}
}
- // <--
+
// if the node is in a section, the sectionframe now
// has to be created..
- // OD 14.11.2002 #104684# - boolean to control <Init()> of a new
- // section frame.
+ // boolean to control <Init()> of a new section frame.
bool bInitNewSect = false;
if( pS )
{
SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection() );
- // OD 14.11.2002 #104684# - prepare <Init()> of new section frame.
+ // prepare <Init()> of new section frame.
bInitNewSect = true;
SwLayoutFrm* pUp = pSct;
while( pUp->Lower() ) // for columned sections
{
- ASSERT( pUp->Lower()->IsLayoutFrm(),"Who's in there?" );
+ OSL_ENSURE( pUp->Lower()->IsLayoutFrm(),"Who's in there?" );
pUp = (SwLayoutFrm*)pUp->Lower();
}
pNew->Paste( pUp, NULL );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1189,7 +1187,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
else
// der neue liegt hinter mir
pNew->Paste( pFrm->GetUpper(), pFrm->GetNext() );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1218,7 +1216,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
void SwSectionNode::MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx )
{
- ASSERT( pIdxBehind, "kein Index" );
+ OSL_ENSURE( pIdxBehind, "kein Index" );
SwNodes& rNds = GetNodes();
SwDoc* pDoc = rNds.GetDoc();
@@ -1242,8 +1240,6 @@ void SwSectionNode::DelFrms()
sal_uLong nStt = GetIndex()+1, nEnd = EndOfSectionIndex();
if( nStt >= nEnd )
{
- // unser Flag muessen wir noch aktualisieren
- // pSection->bHiddenFlag = sal_True;
return ;
}
@@ -1261,13 +1257,13 @@ void SwSectionNode::DelFrms()
SwNodeIndex aIdx( *this );
if( !rNds.GoPrevSection( &aIdx, sal_True, sal_False ) ||
!CheckNodesRange( *this, aIdx, sal_True ) ||
- // OD 04.11.2003 #i21457#
+ // #i21457#
!lcl_IsInSameTblBox( rNds, *this, true ))
{
aIdx = *EndOfSectionNode();
if( !rNds.GoNextSection( &aIdx, sal_True, sal_False ) ||
!CheckNodesRange( *EndOfSectionNode(), aIdx, sal_True ) ||
- // OD 04.11.2003 #i21457#
+ // #i21457#
!lcl_IsInSameTblBox( rNds, *EndOfSectionNode(), false ))
{
m_pSection->m_Data.SetHiddenFlag(false);
@@ -1288,7 +1284,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
::std::auto_ptr<SwTOXBase> pTOXBase;
if (TOX_CONTENT_SECTION == GetSection().GetType())
{
- ASSERT( GetSection().ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ OSL_ENSURE( GetSection().ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
SwTOXBaseSection const& rTBS(
dynamic_cast<SwTOXBaseSection const&>(GetSection()));
pTOXBase.reset( new SwTOXBase(rTBS, pDoc) );
@@ -1324,10 +1320,9 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
pNewSect->SetHidden( sal_True );
if( !pNewSect->IsProtectFlag() && GetSection().IsProtect() )
pNewSect->SetProtect( sal_True );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
if( !pNewSect->IsEditInReadonlyFlag() && GetSection().IsEditInReadonly() )
pNewSect->SetEditInReadonly( sal_True );
- // <--
SwNodeRange aRg( *this, +1, *EndOfSectionNode() ); // (wo stehe in denn nun ??)
rNds._Copy( aRg, aInsPos, sal_False );
@@ -1357,7 +1352,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
sal_Bool SwSectionNode::IsCntntHidden() const
{
- ASSERT( !m_pSection->IsHidden(),
+ OSL_ENSURE( !m_pSection->IsHidden(),
"That's simple: Hidden Section => Hidden Content" );
SwNodeIndex aTmp( *this, 1 );
sal_uLong nEnd = EndOfSectionIndex();
@@ -1374,7 +1369,7 @@ sal_Bool SwSectionNode::IsCntntHidden() const
{
if( aTmp.GetNode().IsCntntNode() || aTmp.GetNode().IsTableNode() )
return sal_False; // Nicht versteckter Inhalt wurde gefunden
- ASSERT( aTmp.GetNode().IsEndNode(), "EndNode expected" );
+ OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" );
}
aTmp++;
}
@@ -1418,7 +1413,7 @@ void SwSectionNode::NodesArrChgd()
// verschieben vom Nodes- ins UndoNodes-Array?
if( rNds.IsDocNodes() )
{
- ASSERT( pDoc == GetDoc(),
+ OSL_ENSURE( pDoc == GetDoc(),
"verschieben in unterschiedliche Documente?" );
if (m_pSection->IsLinkType())
{
@@ -1498,3 +1493,4 @@ String SwDoc::GetUniqueSectionName( const String* pChkStr ) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 29ecd0ef79f4..6cefc2cef949 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1,4 +1,4 @@
-
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,7 +37,8 @@
#include <editeng/brkitem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/boxitem.hxx>
-// OD 06.08.2003 #i17174#
+#include <svl/stritem.hxx>
+// #i17174#
#include <editeng/shaditem.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
@@ -58,7 +59,6 @@
#include <swcrsr.hxx>
#include <viscrs.hxx>
#include <swtable.hxx>
-#include <ndtxt.hxx>
#include <swundo.hxx>
#include <tblsel.hxx>
#include <fldbas.hxx>
@@ -67,6 +67,7 @@
#include <UndoCore.hxx>
#include <UndoRedline.hxx>
#include <UndoDelete.hxx>
+#include <UndoNumbering.hxx>
#include <UndoTable.hxx>
#include <hints.hxx>
#include <tblafmt.hxx>
@@ -89,7 +90,6 @@
#include <node2lay.hxx>
#include <comcore.hrc>
#include "docsh.hxx"
-#include <tabcol.hxx>
#include <unochart.hxx>
#include <node.hxx>
@@ -97,28 +97,17 @@
#include <map>
#include <algorithm>
-// --> OD 2005-12-05 #i27138#
-#include <rootfrm.hxx>
-// <--
+#include <rootfrm.hxx> // #i27138#
#include <fldupde.hxx>
-
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
-
using namespace ::com::sun::star;
-// #i17764# delete table redlines when modifying the table structure?
-// #define DEL_TABLE_REDLINES 1
-
const sal_Unicode T2T_PARA = 0x0a;
extern void ClearFEShellTabCols();
@@ -126,25 +115,6 @@ extern void ClearFEShellTabCols();
// steht im gctable.cxx
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, sal_Bool bCheckForOwnRedline );
- lcl_DelRedlines( SwPaM& rPam );
-
- ~lcl_DelRedlines() { pDoc->EndUndo(UNDO_EMPTY, NULL); }
-};
-
-lcl_DelRedlines::lcl_DelRedlines( SwPaM & rPam) : pDoc( rPam.GetDoc() )
-{
- pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
- if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
- pDoc->AcceptRedline( rPam, true );
-}
-#endif
-
void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId )
{
sal_Bool bTop = sal_False, bBottom = sal_False, bLeft = sal_False, bRight = sal_False;
@@ -280,7 +250,7 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
{
if( !nCnt )
return sal_False;
- ASSERT( pLine, "keine gueltige Zeile" );
+ OSL_ENSURE( pLine, "keine gueltige Zeile" );
// Index hinter die letzte Box der Line
sal_uLong nIdxPos = 0;
@@ -293,9 +263,12 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
pLine->GetTabBoxes()[ nInsPos ] )))
pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable() );
}
- else if( 0 == ( pNxtBox = pLine->FindNextBox( pTblNd->GetTable(),
- pLine->GetTabBoxes()[ nInsPos-1 ] )))
+ else
+ {
+ if( 0 == (pNxtBox = pLine->FindNextBox( pTblNd->GetTable(),
+ pLine->GetTabBoxes()[ pLine->GetTabBoxes().Count()-1 ] )))
pNxtBox = pLine->FindNextBox( pTblNd->GetTable() );
+ }
}
else if( 0 == ( pNxtBox = pLine->FindNextBox( pTblNd->GetTable() )))
pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable() );
@@ -344,7 +317,6 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd,
rTabBoxes.C40_INSERT( SwTableBox, pPrvBox, nRealInsPos );
- //if( NO_NUMBERING == pTxtColl->GetOutlineLevel()//#outline level,zhaojianwei
if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle()//<-end,zhaojianwei
//FEATURE::CONDCOLL
&& RES_CONDTXTFMTCOLL != pTxtColl->Which()
@@ -375,8 +347,8 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
sal_Bool bCalledFromShell,
sal_Bool bNewModel )
{
- ASSERT( nRows, "Tabelle ohne Zeile?" );
- ASSERT( nCols, "Tabelle ohne Spalten?" );
+ OSL_ENSURE( nRows, "Tabelle ohne Zeile?" );
+ OSL_ENSURE( nCols, "Tabelle ohne Spalten?" );
{
// nicht in Fussnoten kopieren !!
@@ -415,10 +387,10 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
rInsTblOpts.mnRowsToRepeat :
0;
- /* #106283# Save content node to extract FRAMEDIR from. */
+ /* Save content node to extract FRAMEDIR from. */
const SwCntntNode * pCntntNd = rPos.nNode.GetNode().GetCntntNode();
- /* #109161# If we are called from a shell pass the attrset from
+ /* If we are called from a shell pass the attrset from
pCntntNd (aka the node the table is inserted at) thus causing
SwNodes::InsertTable to propagate an adjust item if
necessary. */
@@ -435,7 +407,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwTableLineFmt* pLineFmt = MakeTableLineFmt();
SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, GetDfltFrmFmt() );
- /* #106283# If the node to insert the table at is a context node and has a
+ /* If the node to insert the table at is a context node and has a
non-default FRAMEDIR propagate it to the table. */
if (pCntntNd)
{
@@ -518,10 +490,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
for( sal_uInt16 i = 0; i < nBoxArrLen; ++i )
aBoxFmtArr.Insert( (void*)0, i );
}
- // --> OD 2008-02-25 #refactorlists#
-// SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_END-1 );
SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 );
- // <--
SwNodeIndex aNdIdx( *pTblNd, 1 ); // auf den ersten Box-StartNode
SwTableLines& rLines = pNdTbl->GetTabLines();
@@ -636,7 +605,6 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
SwTxtNode * pTmpNd = new SwTxtNode( aIdx, pTxtColl );
// --> FME 2006-04-13 #i60422# Propagate some more attributes.
- // Adjustment was done for #109161#
const SfxPoolItem* pItem = NULL;
if ( NULL != pAttrSet )
{
@@ -682,17 +650,13 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
return 0;
}
- /* #106283# Save first node in the selection if it is a context node. */
+ /* Save first node in the selection if it is a context node. */
SwCntntNode * pSttCntntNd = pStt->nNode.GetNode().GetCntntNode();
SwPaM aOriginal( *pStt, *pEnd );
pStt = aOriginal.GetMark();
pEnd = aOriginal.GetPoint();
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( aOriginal );
-#endif
-
SwUndoTxtToTbl* pUndo = 0;
if( GetIDocumentUndoRedo().DoesUndo() )
{
@@ -734,7 +698,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() )
{
- ASSERT( sal_False, "Kein Bereich" );
+ OSL_ENSURE( sal_False, "Kein Bereich" );
aRg.aEnd++;
}
@@ -755,7 +719,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
pTableFmt->SetFmtAttr( SwFmtLayoutSplit( sal_False ));
- /* #106283# If the first node in the selection is a context node and if it
+ /* 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
replacing table. */
if (pSttCntntNd)
@@ -775,7 +739,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ), pUndo );
SwTable * pNdTbl = &pTblNd->GetTable();
- ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
+ OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." );
const sal_uInt16 nRowsToRepeat =
tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
@@ -807,10 +771,8 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
aBoxFmtArr.Insert( (void*)0, i );
}
- // --> OD 2008-02-25 #refactorlists#
-// SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_END-1 );
SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 );
- // <--
+
SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : 0;
SwTableBoxFmt *pBoxF = 0;
@@ -954,7 +916,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
aSttIdx += 2, nLines++, nBoxes = 0 )
{
SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" );
+ OSL_ENSURE( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" );
if( !nLines && 0x0b == cCh )
{
@@ -976,7 +938,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
}
}
- aPosArr.Insert( /*aFInfo.GetFrm()->Frm().Left() +*/
+ aPosArr.Insert(
static_cast<sal_uInt16>(aFInfo.GetFrm()->IsVertical() ?
aFInfo.GetFrm()->Prt().Bottom() :
aFInfo.GetFrm()->Prt().Right()),
@@ -991,9 +953,6 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
const SfxItemSet* pSet = pTxtNd->GetpSwAttrSet();
if( pSet )
{
-// das entfernen der PageBreaks erst nach dem erzeugen der Tabelle
-// 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, sal_False, &pItem ) )
{
@@ -1115,7 +1074,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// damit die Tabelle die richtige Groesse bekommt, im BoxFormat die
// Groesse nach "oben" transportieren.
- ASSERT( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" );
+ OSL_ENSURE( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" );
pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos ));
}
else
@@ -1124,12 +1083,10 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// das wars doch wohl ??
return pTblNd;
}
-/*-- 18.05.2006 10:30:29---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes )
{
- /* #106283# Save first node in the selection if it is a content node. */
+ /* Save first node in the selection if it is a content node. */
SwCntntNode * pSttCntntNd = rTableNodes.begin()->begin()->aStart.GetNode().GetCntntNode();
/**debug**/
@@ -1146,18 +1103,10 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
const SwPosition *pStt = aOriginal.GetMark();
const SwPosition *pEnd = aOriginal.GetPoint();
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( aOriginal );
-#endif
-
// SwUndoTxtToTbl* pUndo = 0;
bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
if (bUndo)
{
-// GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE );
-// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt );
-// GetIDocumentUndoRedo().AppendUndo(pUndo);
-
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
GetIDocumentUndoRedo().DoUndo(false);
}
@@ -1191,7 +1140,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() )
{
- ASSERT( sal_False, "Kein Bereich" );
+ OSL_ENSURE( sal_False, "Kein Bereich" );
aRg.aEnd++;
}
@@ -1209,10 +1158,8 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
// die Tabelle bekommt USHRT_MAX als default SSize
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
-// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
-// pTableFmt->SetAttr( SwFmtLayoutSplit( sal_False ));
- /* #106283# If the first node in the selection is a context node and if it
+ /* 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
replacing table. */
if (pSttCntntNd)
@@ -1232,45 +1179,20 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
GetTxtCollFromPool( RES_POOLCOLL_STANDARD )/*, pUndo*/ );
SwTable * pNdTbl = &pTblNd->GetTable();
- ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
+ OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." );
pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-// const sal_uInt16 nRowsToRepeat =
-// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
-// rInsTblOpts.mnRowsToRepeat :
-// 0;
-// pNdTbl->SetRowsToRepeat( nRowsToRepeat );
-
- 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 = sal_True;
pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() );
delete pBoxFmt;
-// eAdjust = HORI_NONE;
}
- //Orientation am Fmt der Table setzen
-// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) );
-// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-
-
sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
- {
-// SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang
-// rTmp.DeleteMark();
-// rTmp.GetPoint()->nNode = *pTblNd;
-// SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode );
-// rTmp.GetPoint()->nContent.Assign( pCNd, 0 );
- }
-
-// if( pUndo )
-// GetIDocumentUndoRedo().EndUndo( UNDO_TEXTTOTABLE );
-
SetModified();
SetFieldsDirty( true, NULL, 0 );
return pNdTbl;
@@ -1338,9 +1260,6 @@ SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange)
return pResult;
}
-/*-- 18.05.2006 08:23:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
SwTableFmt* pTblFmt,
SwTableLineFmt* pLineFmt,
@@ -1375,9 +1294,6 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
SwTableBox* pBox;
sal_uInt16 nBoxes, nLines, nMaxBoxes = 0;
-// SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : 0;
-
-
SwNodeIndex aNodeIndex = rTableNodes.begin()->begin()->aStart;
// delete frames of all contained content nodes
for( nLines = 0; aNodeIndex <= rTableNodes.rbegin()->rbegin()->aEnd; ++aNodeIndex,++nLines )
@@ -1391,15 +1307,11 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
SwTxtNode& rTxtNode = static_cast<SwTxtNode&>(rNode);
// setze den bei allen TextNode in der Tabelle den TableNode
// als StartNode
-// FIXME: this is setting wrong node StartOfSections in nested tables.
-// rTxtNode.pStartOfSection = pTblNd;
+
// remove PageBreaks/PageDesc/ColBreak
const SwAttrSet* pSet = rTxtNode.GetpSwAttrSet();
if( pSet )
{
- // das entfernen der PageBreaks erst nach dem erzeugen der Tabelle
- // 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, sal_False, &pItem ) )
{
@@ -1422,38 +1334,18 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
}
}
-// SwNodeIndex aSttIdx( *pTblNd, 1 );
-// SwNodeIndex aEndIdx( rlNodes.rbegin()->aEnd, -1 );
std::vector<std::vector < SwNodeRange > >::const_iterator aRowIter = rTableNodes.begin();
for( nLines = 0, nBoxes = 0;
aRowIter != rTableNodes.end();
- ++aRowIter, /*aSttIdx += 2, */nLines++, nBoxes = 0 )
+ ++aRowIter, nLines++, nBoxes = 0 )
{
-// SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode();
-// ASSERT( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" );
-
pLine = new SwTableLine( pLineFmt, 1, 0 );
pTable->GetTabLines().C40_INSERT( SwTableLine, pLine, nLines );
-// SwStartNode* pSttNd;
-// SwPosition aCntPos( aSttIdx, SwIndex( pTxtNd ));
-
std::vector< SwNodeRange >::const_iterator aCellIter = aRowIter->begin();
-// SvULongs aBkmkArr( 15, 15 );
-// _SaveCntntIdx( pDoc, aCellIter->aStart.GetIndex(), pTxtNd->GetTxt().Len(), aBkmkArr );
-// const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer();
for( ; aCellIter != aRowIter->end(); ++aCellIter )
{
-// aCellIter->aStart aCellIter->aEnd
-// aCntPos.nContent = nChPos;
-// SwCntntNode* pNewNd = pTxtNd->SplitNode( aCntPos );
-
-// auch f?rs undo?
-// if( aBkmkArr.Count() )
-// _RestoreCntntIdx( aBkmkArr, *pNewNd, nChPos,
-// nChPos + 1 );
-
const SwNodeIndex aTmpIdx( aCellIter->aStart, 0 );
SwNodeIndex aCellEndIdx(aCellIter->aEnd);
@@ -1501,7 +1393,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
// damit die Tabelle die richtige Groesse bekommt, im BoxFormat die
// Groesse nach "oben" transportieren.
- ASSERT( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" );
+ OSL_ENSURE( !pBoxFmt->GetDepends(), "wer ist in dem Format noch angemeldet" );
pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos ));
}
else
@@ -1528,10 +1420,6 @@ sal_Bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
pESh->ClearMark();
// <--
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, sal_False );
-#endif
-
SwNodeRange aRg( *pTblNd, 0, *pTblNd->EndOfSectionNode() );
SwUndoTblToTxt* pUndo = 0;
SwNodeRange* pUndoRg = 0;
@@ -1584,7 +1472,7 @@ sal_Bool lcl_DelBox( const SwTableBox*&, void *pPara );
sal_Bool lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
{
- ASSERT( pPara, "die Parameter fehlen" );
+ OSL_ENSURE( pPara, "die Parameter fehlen" );
_DelTabPara aPara( *(_DelTabPara*)pPara );
((SwTableLine*&)rpLine)->GetTabBoxes().ForEach( &lcl_DelBox, &aPara );
if( rpLine->GetUpper() ) // gibt es noch eine uebergeordnete Box ??
@@ -1596,7 +1484,7 @@ sal_Bool lcl_DelLine( const SwTableLine*& rpLine, void* pPara )
sal_Bool lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
{
- ASSERT( pPara, "die Parameter fehlen" );
+ OSL_ENSURE( pPara, "die Parameter fehlen" );
// loesche erstmal die Lines der Box
_DelTabPara* pDelPara = (_DelTabPara*)pPara;
@@ -1792,7 +1680,7 @@ sal_Bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bB
sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1801,10 +1689,6 @@ sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b
if( rTbl.ISA( SwDDETable ))
return sal_False;
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
-#endif
-
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
if (GetIDocumentUndoRedo().DoesUndo())
@@ -1859,7 +1743,7 @@ sal_Bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bB
sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind )
{
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -1868,10 +1752,6 @@ sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b
if( rTbl.ISA( SwDDETable ))
return sal_False;
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
-#endif
-
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
if (GetIDocumentUndoRedo().DoesUndo())
@@ -2052,7 +1932,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
return sal_False;
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -2074,10 +1954,6 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
rTable.FindSuperfluousRows( aSelBoxes );
}
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
-#endif
-
// soll die gesamte Tabelle geloescht werden ??
const sal_uLong nTmpIdx1 = pTblNd->GetIndex();
const sal_uLong nTmpIdx2 = aSelBoxes[ aSelBoxes.Count()-1 ]->GetSttNd()->
@@ -2146,11 +2022,6 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
SwCntntNode* pNextNd = GetNodes()[ nNextNd ]->GetCntntNode();
if( pNextNd )
{
-//JP 24.08.98: will man wirklich den PageDesc/Break vom
-// nachfolgen Absatz ueberbuegeln?
-// const SwAttrSet& rAttrSet = pNextNd->GetSwAttrSet();
-// if( SFX_ITEM_SET != rAttrSet.GetItemState( RES_PAGEDESC ) &&
-// SFX_ITEM_SET != rAttrSet.GetItemState( RES_BREAK ))
{
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
const SfxPoolItem *pItem;
@@ -2271,7 +2142,7 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n
sal_Bool bSameHeight )
{
// uebers SwDoc fuer Undo !!
- ASSERT( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count() && nCnt, "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -2280,10 +2151,6 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n
if( rTbl.ISA( SwDDETable ))
return sal_False;
-#ifdef DEL_TABLE_REDLINES
- lcl_DelRedlines aDelRedl( *pTblNd, sal_True );
-#endif
-
SvULongs aNdsCnts;
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
@@ -2364,10 +2231,6 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam )
GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_MERGE, NULL );
// <--
-#ifdef DEL_TABLE_REDLINES
- if( !IsIgnoreRedline() && GetRedlineTbl().Count() )
- DeleteRedline( *pTblNd, true, USHRT_MAX );
-#endif
RedlineMode_t eOld = GetRedlineMode();
SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
@@ -2493,7 +2356,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx )
SwFrm *pFrm, *pNew;
SwCntntNode * pNode = rIdx.GetNode().GetCntntNode();
- ASSERT( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch.");
+ OSL_ENSURE( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch.");
sal_Bool bBefore = rIdx < GetIndex();
@@ -2517,7 +2380,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx )
void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
{
- ASSERT( pIdxBehind, "kein Index" );
+ OSL_ENSURE( pIdxBehind, "kein Index" );
*pIdxBehind = *this;
SwNode *pNd = GetNodes().FindPrvNxtFrmNode( *pIdxBehind, EndOfSectionNode() );
if( !pNd )
@@ -2530,7 +2393,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
{
SwTabFrm* pNew = MakeFrm();
pNew->Paste( pUpper, pFrm );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -2570,7 +2433,7 @@ void SwTableNode::DelFrms()
{
while ( pFrm->HasFollow() )
pFrm->JoinAndDelFollows();
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
@@ -2642,7 +2505,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
}
else if( !pCrsr && !pBoxFrm )
{
- ASSERT( !this, "einer von beiden muss angegeben werden!" );
+ OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" );
return ;
}
@@ -2696,12 +2559,11 @@ bool lcl_IsFrmInColumn( const SwCellFrm& rFrm, SwSelBoxes& rBoxes )
void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
const SwCellFrm* pBoxFrm ) const
{
- ASSERT( pBoxFrm, "GetTabRows called without pBoxFrm" )
+ OSL_ENSURE( pBoxFrm, "GetTabRows called without pBoxFrm" );
- // --> FME 2005-09-12 #121591# Make code robust:
+ // Make code robust:
if ( !pBoxFrm )
return;
- // <--
// --> FME 2005-01-06 #i39552# Collection of the boxes of the current
// column has to be done at the beginning of this function, because
@@ -2718,20 +2580,18 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
}
// <--
- // --> FME 2005-09-12 #121591# Make code robust:
+ // Make code robust:
if ( aDelCheck.HasBeenDeleted() )
{
- ASSERT( false, "Current box has been deleted during GetTabRows()" )
+ OSL_ENSURE( false, "Current box has been deleted during GetTabRows()" );
return;
}
- // <--
- // --> FME 2005-09-12 #121591# Make code robust:
+ // Make code robust:
const SwTabFrm* pTab = pBoxFrm->FindTabFrm();
- ASSERT( pTab, "GetTabRows called without a table" )
+ OSL_ENSURE( pTab, "GetTabRows called without a table" );
if ( !pTab )
return;
- // <--
const SwFrm* pFrm = pTab->GetNextLayoutLeaf();
@@ -2825,7 +2685,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
}
// delete first and last entry
- ASSERT( rFill.Count(), "Deleting from empty vector. Fasten your seatbelts!" )
+ OSL_ENSURE( rFill.Count(), "Deleting from empty vector. Fasten your seatbelts!" );
// --> FME 2006-01-19 #i60818# There may be only one entry in rFill. Make
// code robust by checking count of rFill.
if ( rFill.Count() ) rFill.Remove( 0, 1 );
@@ -2867,7 +2727,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
}
else if( !pCrsr && !pBoxFrm )
{
- ASSERT( !this, "einer von beiden muss angegeben werden!" );
+ OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" );
return ;
}
@@ -2876,7 +2736,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
SwTable& rTab = *pTab->GetTable();
const SwFmtFrmSize& rTblFrmSz = rTab.GetFrmFmt()->GetFrmSize();
SWRECTFN( pTab )
- // OD 06.08.2003 #i17174# - With fix for #i9040# the shadow size is taken
+ // #i17174# - With fix for #i9040# the shadow size is taken
// from the table width. Thus, add its left and right size to current table
// printing area width in order to get the correct table size attribute.
SwTwips nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)();
@@ -2916,7 +2776,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur
const SwTableBox* pBox;
SwTabFrm *pTab;
- ASSERT( pBoxFrm, "SetTabRows called without pBoxFrm" )
+ OSL_ENSURE( pBoxFrm, "SetTabRows called without pBoxFrm" );
pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm();
pBox = pBoxFrm->GetTabBox();
@@ -2953,7 +2813,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur
// check for differences between aOld and rNew:
const sal_uInt16 nCount = rNew.Count();
const SwTable* pTable = pTab->GetTable();
- ASSERT( pTable, "My colleague told me, this couldn't happen" );
+ OSL_ENSURE( pTable, "My colleague told me, this couldn't happen" );
for ( sal_uInt16 i = 0; i <= nCount; ++i )
{
@@ -3036,7 +2896,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur
::ClearFEShellTabCols();
}
-/* -----------------18.07.98 11:45-------------------
+/* --------------------------------------------------
* Direktzugriff fuer UNO
* --------------------------------------------------*/
void SwDoc::SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld,
@@ -3213,7 +3073,7 @@ sal_Bool lcl_BoxSetSplitBoxFmts( const SwTableBox*& rpBox, void* pPara )
}
else
{
-sal_uInt16 __FAR_DATA aTableSplitBoxSetRange[] = {
+sal_uInt16 aTableSplitBoxSetRange[] = {
RES_LR_SPACE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW,
RES_PROTECT, RES_PROTECT,
@@ -3299,9 +3159,6 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode,
aFndBox.SetTableLines( rTbl );
aFndBox.DelFrms( rTbl );
- // TL_CHART2: need to inform chart of probably changed cell names
- //pDoc->UpdateCharts( rTbl.GetFrmFmt()->GetName() );
-
SwTableNode* pNew = GetNodes().SplitTable( rPos.nNode, sal_False, bCalcNewSize );
if( pNew )
@@ -3531,7 +3388,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
SwTableNode * pNewTblNd;
{
SwEndNode* pOldTblEndNd = (SwEndNode*)pTNd->EndOfSectionNode()->GetEndNode();
- ASSERT( pOldTblEndNd, "wo ist der EndNode?" )
+ OSL_ENSURE( pOldTblEndNd, "wo ist der EndNode?" );
SwNodeIndex aIdx( *pBox->GetSttNd() );
new SwEndNode( aIdx, *pTNd );
@@ -3543,7 +3400,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
SwNode* pBoxNd = aIdx.GetNode().GetStartNode();
do {
- ASSERT( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" );
+ OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" );
pBoxNd->pStartOfSection = pNewTblNd;
pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ];
} while( pBoxNd != pOldTblEndNd );
@@ -3670,10 +3527,10 @@ 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?" );
+ OSL_ENSURE( pDelTblNd, "wo ist der TableNode geblieben?" );
SwTableNode* pTblNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode();
- ASSERT( pTblNd, "wo ist der TableNode geblieben?" );
+ OSL_ENSURE( pTblNd, "wo ist der TableNode geblieben?" );
if( !pDelTblNd || !pTblNd )
return sal_False;
@@ -3744,7 +3601,7 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev,
SwNode* pBoxNd = aIdx.GetNode().GetStartNode();
do {
- ASSERT( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" );
+ OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" );
pBoxNd->pStartOfSection = pTblNd;
pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ];
} while( pBoxNd != pTblEndNd );
@@ -3823,10 +3680,7 @@ sal_Bool lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
{
SwTableBox* pSetBox = (SwTableBox*)rpBox->GetBox();
SwDoc* pDoc = pSetBox->GetFrmFmt()->GetDoc();
- // --> OD 2008-02-25 #refactorlists#
-// SfxItemSet aCharSet( pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_END-1 );
SfxItemSet aCharSet( pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 );
- // <--
SfxItemSet aBoxSet( pDoc->GetAttrPool(), aTableBoxSetRange );
sal_uInt8 nPos = pSetPara->nAFmtLine * 4 + pSetPara->nAFmtBox;
pSetPara->rTblFmt.UpdateToSet( nPos, aCharSet,
@@ -3867,7 +3721,7 @@ sal_Bool lcl_SetAFmtBox( const _FndBox*& rpBox, void *pPara )
// AutoFormat fuer die Tabelle/TabellenSelection
sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew )
{
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -3945,7 +3799,7 @@ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt&
// Erfrage wie attributiert ist
sal_Bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
{
- ASSERT( rBoxes.Count(), "keine gueltige Box-Liste" );
+ OSL_ENSURE( rBoxes.Count(), "keine gueltige Box-Liste" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode();
if( !pTblNd )
return sal_False;
@@ -4233,9 +4087,6 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate )
// alle Zahlenformate entfernen
sal_uInt16 nWhich1 = RES_BOXATR_FORMULA;
if( !bIsEmptyTxtNd )
- //JP 15.01.99: dieser Teil wurde doch schon oben abgeprueft!
- /* && pFmtItem && !GetNumberFormatter()->
- IsTextFormat( ((SwTblBoxNumFormat*)pFmtItem)->GetValue() ) )*/
{
nWhich1 = RES_BOXATR_FORMAT;
@@ -4298,6 +4149,48 @@ void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet )
SetModified();
}
+void SwDoc::ClearLineNumAttrs( SwPosition & rPos )
+{
+ SwPaM aPam(rPos);
+ aPam.Move(fnMoveBackward);
+ SwCntntNode *pNode = aPam.GetCntntNode();
+ if ( 0 == pNode )
+ return ;
+ if( pNode->IsTxtNode() )
+ {
+ SwTxtNode * pTxtNode = pNode->GetTxtNode();
+ if ( pTxtNode && pTxtNode->IsNumbered() && pTxtNode->GetTxt().Len()==0 )
+ {
+ const SfxPoolItem* pFmtItem = 0;
+ SfxItemSet rSet( const_cast<SwAttrPool&>(pTxtNode->GetDoc()->GetAttrPool()),
+ RES_PARATR_BEGIN, RES_PARATR_END - 1,
+ 0);
+ pTxtNode->SwCntntNode::GetAttr( rSet );
+ if ( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE , sal_False , &pFmtItem ) )
+ {
+ SwUndoDelNum * pUndo;
+ if( GetIDocumentUndoRedo().DoesUndo() )
+ {
+ GetIDocumentUndoRedo().ClearRedo();
+ GetIDocumentUndoRedo().AppendUndo( pUndo = new SwUndoDelNum( aPam ) );
+ }
+ else
+ pUndo = 0;
+ SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 );
+ aRegH.RegisterInModify( pTxtNode , *pTxtNode );
+ if ( pUndo )
+ pUndo->AddNode( *pTxtNode , sal_False );
+ String aStyle = String::CreateFromAscii("");
+ SfxStringItem * pNewItem = (SfxStringItem*)pFmtItem->Clone();
+ pNewItem->SetValue( aStyle );
+ rSet.Put( *pNewItem );
+ pTxtNode->SetAttr( rSet );
+ delete pNewItem;
+ }
+ }
+ }
+}
+
void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode )
{
SwStartNode* pSttNd;
@@ -4446,7 +4339,7 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
{
SwTableBox* pBox = pInsTblNd->GetTable().GetTblBox(
pSttNd->GetIndex() );
- ASSERT( pBox, "Box steht nicht in dieser Tabelle" );
+ OSL_ENSURE( pBox, "Box steht nicht in dieser Tabelle" );
aBoxes.Insert( pBox );
pBoxes = &aBoxes;
}
@@ -4673,49 +4566,4 @@ sal_Bool SwDoc::HasTblAnyProtection( const SwPosition* pPos,
return bHasProtection;
}
-#ifdef DEL_TABLE_REDLINES
-lcl_DelRedlines::lcl_DelRedlines( const SwTableNode& rNd,
- sal_Bool bCheckForOwnRedline )
- : pDoc( (SwDoc*)rNd.GetNodes().GetDoc() )
-{
- pDoc->StartUndo(UNDO_EMPTY, NULL);
- const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
- if( !pDoc->IsIgnoreRedline() && rTbl.Count() )
- {
- sal_Bool bDelete = sal_True;
- if( bCheckForOwnRedline )
- {
- sal_uInt16 nRedlPos = pDoc->GetRedlinePos( rNd, USHRT_MAX );
- sal_uInt32 nSttNd = rNd.GetIndex(),
- nEndNd = rNd.EndOfSectionIndex();
-
- for ( ; nRedlPos < rTbl.Count(); ++nRedlPos )
- {
- const SwRedline* pRedline = rTbl[ nRedlPos ];
- const SwPosition* pStt = pRedline->Start(),
- * pEnd = pStt == pRedline->GetPoint()
- ? pRedline->GetMark()
- : pRedline->GetPoint();
- if( pStt->nNode <= nSttNd )
- {
- if( pEnd->nNode >= nEndNd &&
- pRedline->GetAuthor() == pDoc->GetRedlineAuthor() )
- {
- bDelete = sal_False;
- break;
- }
- }
- else
- break;
- }
- }
- if( bDelete )
- {
- SwPaM aPam(*rNd.EndOfSectionNode(), rNd);
- pDoc->AcceptRedline( aPam, true );
- }
- }
-}
-#endif
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 3d8b57df4101..14fac9d60f93 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
@@ -108,7 +108,7 @@ void SwTblFmtCmp::Delete( SvPtrarr &rArr )
void lcl_GetStartEndCell( const SwCursor& rCrsr,
SwLayoutFrm *&prStart, SwLayoutFrm *&prEnd )
{
- ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
+ OSL_ENSURE( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
Point aPtPos, aMkPos;
@@ -157,8 +157,6 @@ sal_Bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
/***********************************************************************
#* Class : SwDoc
#* Methoden : SetRowHeight(), GetRowHeight()
-#* Datum : MA 17. May. 93
-#* Update : JP 28.04.98
#***********************************************************************/
//Die Zeilenhoehe wird ausgehend von der Selektion ermittelt/gesetzt.
//Ausgehend von jeder Zelle innerhalb der Selektion werden nach oben alle
@@ -547,8 +545,6 @@ sal_Bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill
/***********************************************************************
#* Class : SwDoc
#* Methoden : SetTabBorders(), GetTabBorders()
-#* Datum : MA 18. May. 93
-#* Update : JP 29.04.98
#***********************************************************************/
inline void InsertCell( SvPtrarr& rCellArr, SwCellFrm* pCellFrm )
{
@@ -567,7 +563,7 @@ void lcl_CollectCells( SvPtrarr &rArr, const SwRect &rUnion,
// uns erst wieder zur Zelle hochhangeln
while ( !pCell->IsCellFrm() )
pCell = pCell->GetUpper();
- ASSERT( pCell, "Frame ist keine Zelle." );
+ OSL_ENSURE( pCell, "Frame ist keine Zelle." );
if ( rUnion.IsOver( pCell->Frm() ) )
::InsertCell( rArr, (SwCellFrm*)pCell );
//Dafuer sorgen, dass die Zelle auch verlassen wird (Bereiche)
@@ -697,9 +693,8 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
//Grundsaetzlich nichts setzen in HeadlineRepeats.
if ( pTab->IsFollow() &&
( pTab->IsInHeadline( *pCell ) ||
- // --> FME 2006-02-07 #126092# Same holds for follow flow rows.
+ // Same holds for follow flow rows.
pCell->IsInFollowFlowRow() ) )
- // <--
continue;
SvxBoxItem aBox( pCell->GetFmt()->GetBox() );
@@ -768,7 +763,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
if( pSetBox )
{
- static sal_uInt16 __READONLY_DATA aBorders[] = {
+ static sal_uInt16 const aBorders[] = {
BOX_LINE_BOTTOM, BOX_LINE_TOP,
BOX_LINE_RIGHT, BOX_LINE_LEFT };
const sal_uInt16* pBrd = aBorders;
@@ -1081,7 +1076,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
// Abstand zum Text
if (aSetBoxInfo.IsValid(VALID_DISTANCE))
{
- static sal_uInt16 __READONLY_DATA aBorders[] = {
+ static sal_uInt16 const aBorders[] = {
BOX_LINE_BOTTOM, BOX_LINE_TOP,
BOX_LINE_RIGHT, BOX_LINE_LEFT };
const sal_uInt16* pBrd = aBorders;
@@ -1115,8 +1110,6 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
/***********************************************************************
#* Class : SwDoc
#* Methoden : SetBoxAttr
-#* Datum : MA 18. Dec. 96
-#* Update : JP 29.04.98
#***********************************************************************/
void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
{
@@ -1164,8 +1157,6 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
/***********************************************************************
#* Class : SwDoc
#* Methoden : GetBoxAttr()
-#* Datum : MA 01. Jun. 93
-#* Update : JP 29.04.98
#***********************************************************************/
sal_Bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
@@ -1208,6 +1199,18 @@ sal_Bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) cons
else if( rToFill != rDir )
bRet = sal_False;
}
+ case RES_VERT_ORIENT:
+ {
+ const SwFmtVertOrient& rOrient =
+ aBoxes[i]->GetFrmFmt()->GetVertOrient();
+ if( !bOneFound )
+ {
+ (SwFmtVertOrient&)rToFill = rOrient;
+ bOneFound = sal_True;
+ }
+ else if( rToFill != rOrient )
+ bRet = sal_False;
+ }
}
if ( sal_False == bRet )
@@ -1220,12 +1223,10 @@ sal_Bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) cons
/***********************************************************************
#* Class : SwDoc
#* Methoden : SetBoxAlign, SetBoxAlign
-#* Datum : MA 18. Dec. 96
-#* Update : JP 29.04.98
#***********************************************************************/
void SwDoc::SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign )
{
- ASSERT( nAlign == text::VertOrientation::NONE ||
+ OSL_ENSURE( nAlign == text::VertOrientation::NONE ||
nAlign == text::VertOrientation::CENTER ||
nAlign == text::VertOrientation::BOTTOM, "wrong alignment" );
SwFmtVertOrient aVertOri( 0, nAlign );
@@ -1257,8 +1258,6 @@ sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) const
/***********************************************************************
#* Class : SwDoc
#* Methoden : AdjustCellWidth()
-#* Datum : MA 20. Feb. 95
-#* Update : JP 29.04.98
#***********************************************************************/
sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell )
{
@@ -1270,11 +1269,10 @@ sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell )
const SwTwips nAdd = (pFrm->Frm().*fnRect->fnGetWidth)() -
(pFrm->Prt().*fnRect->fnGetWidth)();
- // --> FME 2005-12-02 #127801# pFrm does not necessarily have to be a SwTxtFrm!
+ // pFrm does not necessarily have to be a SwTxtFrm!
const SwTwips nCalcFitToContent = pFrm->IsTxtFrm() ?
((SwTxtFrm*)pFrm)->CalcFitToContent() :
(pFrm->Prt().*fnRect->fnGetWidth)();
- // <--
nRet = Max( nRet, nCalcFitToContent + nAdd );
pFrm = pFrm->GetNext();
@@ -1595,3 +1593,4 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance )
SetModified();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index f8d7170099ee..792f4ffaa4ce 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-// --> OD 2005-02-21 #i42921#
-#include <editeng/frmdiritem.hxx>
-// <--
+#include <editeng/frmdiritem.hxx> // #i42921#
#include <editeng/protitem.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
#include <fmtcntnt.hxx>
@@ -71,13 +70,9 @@
#include <crsskip.hxx>
#include <SwStyleNameMapper.hxx>
#include <scriptinfo.hxx>
-// --> OD 2005-12-05 #i27138#
-#include <rootfrm.hxx>
-// <--
+#include <rootfrm.hxx> // #i27138#
#include <istyleaccess.hxx>
-// --> OD 2007-10-31 #i83479#
-#include <IDocumentListItems.hxx>
-// <--
+#include <IDocumentListItems.hxx> // #i83479#
using namespace ::com::sun::star::i18n;
@@ -115,8 +110,8 @@ void SetParent( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
const SwFmt* pConditionalFmt )
{
const SwAttrSet* pAttrSet = static_cast<const SwAttrSet*>(mrpAttrSet.get());
- ASSERT( pAttrSet, "no SwAttrSet" )
- ASSERT( pParentFmt || !pConditionalFmt, "ConditionalFmt without ParentFmt?" )
+ OSL_ENSURE( pAttrSet, "no SwAttrSet" );
+ OSL_ENSURE( pParentFmt || !pConditionalFmt, "ConditionalFmt without ParentFmt?" );
const SwAttrSet* pParentSet = pParentFmt ? &pParentFmt->GetAttrSet() : 0;
@@ -286,12 +281,6 @@ sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
|* alle EndNodes der GrundSection haben den Level 0
|* alle StartNodes der GrundSection haben den Level 1
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Aenderung: JP 11.08.93
-|* keine Rekursion mehr !!
-|*
*******************************************************************/
@@ -328,15 +317,9 @@ sal_uInt16 SwNode::GetSectionLevel() const
|* rWhere bezeichnet die Position innerhalb dieses Arrays,
|* an der der Node eingefuegt werden soll
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
long SwNode::nSerial = 0;
#endif
@@ -368,7 +351,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType )
pStartOfSection = (SwStartNode*)this;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nMySerial = nSerial;
nSerial++;
#endif
@@ -401,7 +384,7 @@ SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType )
pStartOfSection = (SwStartNode*)this;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nMySerial = nSerial;
nSerial++;
#endif
@@ -532,7 +515,6 @@ sal_Bool SwNode::IsProtect() const
const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
sal_uInt32* pPgDescNdIdx ) const
{
- // OD 18.03.2003 #106329#
if ( !GetNodes().IsDocNodes() )
{
return 0;
@@ -567,7 +549,6 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
0 != ( pPage = pFrm->FindPageFrm() ) )
{
pPgDesc = pPage->GetPageDesc();
- // OD 18.03.2003 #106329#
if ( pPgDescNdIdx )
{
*pPgDescNdIdx = pNode->GetIndex();
@@ -640,7 +621,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
}
if( n >= rFmts.Count() )
{
- ASSERT( !this, "Fly-Section aber kein Format gefunden" );
+ OSL_ENSURE( !this, "Fly-Section aber kein Format gefunden" );
return sal_False;
}
}
@@ -726,7 +707,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
// kann jetzt nur noch ein Seitengebundener Fly sein
// oder irgendetwas neueres.
// Hier koennen wir nur noch den Standard returnen
- ASSERT( pNd->FindFlyStartNode(),
+ OSL_ENSURE( pNd->FindFlyStartNode(),
"wo befindet sich dieser Node?" );
pPgDesc = &pDoc->GetPageDesc( 0 );
@@ -763,7 +744,6 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
else if( pNd->IsSectionNode() )
pPgDesc = pNd->GetSectionNode()->GetSection().
GetFmt()->GetPageDesc().GetPageDesc();
- // OD 18.03.2003 #106329#
if ( pPgDescNdIdx )
{
*pPgDescNdIdx = pNd->GetIndex();
@@ -877,7 +857,6 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const
// oder ans Feld und von dort holen !!
while( nPos &&
nLvl < ( pRet = rONds[nPos]->GetTxtNode() )
- //->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
->GetAttrOutlineLevel() - 1 ) //<-end,zhaojianwei
--nPos;
@@ -904,8 +883,7 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
if( IsValidNextPrevNd( *this ))
{
SwNodeIndex aIdx( *this, -1 );
- // --> OD 2007-06-04 #i77805#
- // skip section start and end nodes
+ // #i77805# - skip section start and end nodes
while ( aIdx.GetNode().IsSectionNode() ||
( aIdx.GetNode().IsEndNode() &&
aIdx.GetNode().StartOfSectionNode()->IsSectionNode() ) )
@@ -915,9 +893,7 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
// <--
if( IsValidNextPrevNd( aIdx.GetNode() ))
nRet |= ND_HAS_PREV_LAYNODE;
- // --> OD 2007-06-04 #i77805#
- // skip section start and end nodes
-// aIdx += 2;
+ // #i77805# - skip section start and end nodes
aIdx = SwNodeIndex( *this, +1 );
while ( aIdx.GetNode().IsSectionNode() ||
( aIdx.GetNode().IsEndNode() &&
@@ -925,7 +901,6 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
{
++aIdx;
}
- // <--
if( IsValidNextPrevNd( aIdx.GetNode() ))
nRet |= ND_HAS_NEXT_LAYNODE;
}
@@ -943,11 +918,6 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
|* IN
|* rNodes bezeichnet das variable Array, in dem sich der Node
|* befindet
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
|*
*******************************************************************/
@@ -1002,12 +972,6 @@ void SwStartNode::CheckSectionCondColl() const
|* !!!!!!!!!!!!
|* Es wird eine Kopie uebergeben!
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
@@ -1038,9 +1002,6 @@ SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
SwNode( rWhere, nNdType ),
pCondColl( 0 ),
mbSetModifyAtAttr( false )
-#ifdef OLD_INDEX
- ,SwIndexReg(2)
-#endif
{
}
@@ -1194,7 +1155,7 @@ xub_StrLen SwCntntNode::Len() const { return 0; }
SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl )
{
- ASSERT( pNewColl, "Collectionpointer ist 0." );
+ OSL_ENSURE( pNewColl, "Collectionpointer ist 0." );
SwFmtColl *pOldColl = GetFmtColl();
if( pNewColl != pOldColl )
@@ -1338,7 +1299,7 @@ sal_Bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const
void SwCntntNode::MakeFrms( SwCntntNode& rNode )
{
- ASSERT( &rNode != this,
+ OSL_ENSURE( &rNode != this,
"Kein Contentnode oder Copy-Node und neuer Node identisch." );
if( !GetDepends() || &rNode == this ) // gibt es ueberhaupt Frames ??
@@ -1347,7 +1308,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
SwFrm *pFrm, *pNew;
SwLayoutFrm *pUpper;
// Frames anlegen fuer Nodes, die vor oder hinter der Tabelle stehen ??
- ASSERT( FindTableNode() == rNode.FindTableNode(), "Table confusion" )
+ OSL_ENSURE( FindTableNode() == rNode.FindTableNode(), "Table confusion" );
SwNode2Layout aNode2Layout( *this, rNode.GetIndex() );
@@ -1355,7 +1316,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
{
pNew = rNode.MakeFrm();
pNew->Paste( pUpper, pFrm );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1393,7 +1354,7 @@ void SwCntntNode::DelFrms()
for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm;
pFrm = (SwCntntFrm*)aIter.Next() )
{
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
@@ -1429,12 +1390,12 @@ void SwCntntNode::DelFrms()
!pFrm->GetIndPrev() )
{
SwFtnFrm *pFtn = pFrm->FindFtnFrm();
- ASSERT( pFtn, "You promised a FtnFrm?" );
+ OSL_ENSURE( pFtn, "You promised a FtnFrm?" );
SwCntntFrm* pCFrm;
if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
{
- ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+ OSL_ENSURE( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
}
}
@@ -1483,25 +1444,6 @@ sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
return sal_False;
}
break;
- // --> OD 2008-02-19 #refactorlists#
-// case RES_GETNUMNODES:
-// // #111955# only numbered nodes in rInfo
-// if( IsTxtNode())
-// {
-// SwTxtNode * pTxtNode = (SwTxtNode*)this;
-// pItem = (SwNumRuleItem*)GetNoCondAttr(RES_PARATR_NUMRULE, sal_True );
-
-// if (0 != pItem &&
-// pItem->GetValue().Len() &&
-// pItem->GetValue() == ((SwNumRuleInfo&)rInfo).GetName() &&
-// GetNodes().IsDocNodes())
-// {
-// ((SwNumRuleInfo&)rInfo).AddNode( *pTxtNode );
-// }
-// }
-
-// return sal_True;
- // <--
case RES_FINDNEARESTNODE:
if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() )
@@ -1526,7 +1468,7 @@ sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die
NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen
- ASSERT( GetpSwAttrSet(), "warum wurde kein AttrSet angelegt?" );
+ OSL_ENSURE( GetpSwAttrSet(), "warum wurde kein AttrSet angelegt?" );
if ( IsInCache() )
{
@@ -1567,7 +1509,7 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet )
const SfxPoolItem* pFnd = 0;
if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, sal_False, &pFnd ) )
{
- ASSERT( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" );
+ OSL_ENSURE( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" );
const SwFmtAutoFmt* pTmp = static_cast<const SwFmtAutoFmt*>(pFnd);
// If there already is an attribute set (usually containing a numbering
@@ -1783,7 +1725,7 @@ sal_uInt16 SwCntntNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rW
if ( 0 == rWhichIds.size() )
return nRet;
- ASSERT( GetpSwAttrSet(), "no item set" )
+ OSL_ENSURE( GetpSwAttrSet(), "no item set" );
SwAttrSet aNewAttrSet( *GetpSwAttrSet() );
for ( std::vector<sal_uInt16>::const_iterator aIter = rWhichIds.begin();
aIter != rWhichIds.end();
@@ -1807,7 +1749,7 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich,
nWhich, sal_False, &pFnd ) && bInParents ))
((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd );
}
- // --> OD 2005-10-25 #126347# - undo change of issue #i51029#
+ // undo change of issue #i51029#
// Note: <GetSwAttrSet()> returns <mpAttrSet>, if set, otherwise it returns
// the attribute set of the paragraph style, which is valid for the
// content node - see file <node.hxx>
@@ -2037,7 +1979,7 @@ void SwCntntNode::ChkCondColl()
}
}
-// --> OD 2005-02-21 #i42921#
+// #i42921#
short SwCntntNode::GetTextDirection( const SwPosition& rPos,
const Point* pPt ) const
{
@@ -2047,10 +1989,8 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
if( pPt )
aPt = *pPt;
- // --> OD 2007-01-10 #i72024#
- // No format of the frame, because this can cause recursive layout actions
+ // #i72024# - No format of the frame, because this can cause recursive layout actions
SwFrm* pFrm = GetFrm( &aPt, &rPos, sal_False );
- // <--
if ( pFrm )
{
@@ -2107,12 +2047,11 @@ const IDocumentFieldsAccess* SwNode::getIDocumentFieldsAccess() const { return G
IDocumentFieldsAccess* SwNode::getIDocumentFieldsAccess() { return GetDoc(); }
IDocumentContentOperations* SwNode::getIDocumentContentOperations() { return GetDoc(); }
IStyleAccess& SwNode::getIDocumentStyleAccess() { return GetDoc()->GetIStyleAccess(); }
-// --> OD 2007-10-31 #i83479#
+// #i83479#
IDocumentListItems& SwNode::getIDocumentListItems()
{
return *GetDoc();
}
-// <--
sal_Bool SwNode::IsInRedlines() const
{
@@ -2124,3 +2063,5 @@ sal_Bool SwNode::IsInRedlines() const
return bResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index ca80bc391c7a..88169f482382 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,7 @@
#include "node2lay.hxx"
-/* -----------------25.02.99 10:31-------------------
+/* --------------------------------------------------
* Die SwNode2LayImpl-Klasse erledigt die eigentliche Arbeit,
* die SwNode2Layout-Klasse ist nur die der Oefffentlichkeit bekannte Schnittstelle
* --------------------------------------------------*/
@@ -68,7 +69,7 @@ public:
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 == sal_True, so wird der naechste Cntnt- oder TableNode
@@ -114,7 +115,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
pMod = (SwModify*)pNd->GetCntntNode();
else
{
- ASSERT( pNd->IsTableNode(), "For Tablenodes only" );
+ OSL_ENSURE( pNd->IsTableNode(), "For Tablenodes only" );
pMod = pNd->GetTableNode()->GetTable().GetFrmFmt();
}
pIter = new SwClientIter( *pMod );
@@ -123,7 +124,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
pIter = NULL;
}
-/* -----------------25.02.99 10:41-------------------
+/* --------------------------------------------------
* SwNode2LayImpl::NextFrm() liefert den naechsten "sinnvollen" Frame,
* beim ersten Aufruf wird am eigentlichen Iterator ein First gerufen,
* danach die Next-Methode. Das Ergebnis wird auf Brauchbarkeit untersucht,
@@ -149,7 +150,7 @@ SwFrm* SwNode2LayImpl::NextFrm()
while( pRet )
{
SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet );
- ASSERT( pFlow, "Cntnt or Table expected?!" );
+ OSL_ENSURE( pFlow, "Cntnt or Table expected?!" );
// Follows sind fluechtige Gestalten, deshalb werden sie ignoriert.
// Auch wenn wir hinter dem Frame eingefuegt werden sollen, nehmen wir
// zunaechst den Master, hangeln uns dann aber zum letzten Follow durch.
@@ -171,9 +172,9 @@ SwFrm* SwNode2LayImpl::NextFrm()
// und nicht ausserhalb liegt.
if( !pRet->IsInFtn() || pSct->IsInFtn() )
{
- ASSERT( pSct && pSct->GetSection(), "Where's my section?" );
+ OSL_ENSURE( pSct && pSct->GetSection(), "Where's my section?" );
SwSectionNode* pNd = pSct->GetSection()->GetFmt()->GetSectionNode();
- ASSERT( pNd, "Lost SectionNode" );
+ OSL_ENSURE( pNd, "Lost SectionNode" );
// Wenn der erhaltene Frame in einem Bereichsframe steht,
// dessen Bereich den Ausgangsnode nicht umfasst, so kehren
// wir mit dem SectionFrm zurueck, sonst mit dem Cntnt/TabFrm
@@ -231,12 +232,12 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
SwFrm* pFrm = bMaster ? rpFrm->FindPrev() : rpFrm->FindNext();
if( pFrm && pFrm->IsSctFrm() )
{
- // #137684#: pFrm could be a "dummy"-section
+ // pFrm could be a "dummy"-section
if( ((SwSectionFrm*)pFrm)->GetSection() &&
(&((SwSectionNode*)pNode)->GetSection() ==
((SwSectionFrm*)pFrm)->GetSection()) )
{
- // OD 2004-06-02 #i22922# - consider columned sections
+ // #i22922# - consider columned sections
// 'Go down' the section frame as long as the layout frame
// is found, which would contain content.
while ( pFrm->IsLayoutFrm() &&
@@ -246,11 +247,11 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
{
pFrm = static_cast<SwLayoutFrm*>(pFrm)->Lower();
}
- ASSERT( pFrm->IsLayoutFrm(),
+ OSL_ENSURE( pFrm->IsLayoutFrm(),
"<SwNode2LayImpl::UpperFrm(..)> - expected upper frame isn't a layout frame." );
rpFrm = bMaster ? NULL
: static_cast<SwLayoutFrm*>(pFrm)->Lower();
- ASSERT( !rpFrm || rpFrm->IsFlowFrm(),
+ OSL_ENSURE( !rpFrm || rpFrm->IsFlowFrm(),
"<SwNode2LayImpl::UpperFrm(..)> - expected sibling isn't a flow frame." );
return static_cast<SwLayoutFrm*>(pFrm);
}
@@ -279,7 +280,7 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd )
{
- ASSERT( pUpperFrms, "RestoreUpper without SaveUpper?" )
+ OSL_ENSURE( pUpperFrms, "RestoreUpper without SaveUpper?" );
SwNode* pNd;
SwDoc *pDoc = rNds.GetDoc();
sal_Bool bFirst = sal_True;
@@ -315,7 +316,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong
else
pNxt = pUp->Lower();
pNew = ((SwTableNode*)pNd)->MakeFrm();
- ASSERT( pNew->IsTabFrm(), "Table exspected" );
+ OSL_ENSURE( pNew->IsTabFrm(), "Table exspected" );
pNew->Paste( pUp, pNxt );
((SwTabFrm*)pNew)->RegistFlys();
(*pUpperFrms)[x-2] = pNew;
@@ -329,7 +330,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong
if( bFirst && pNxt && pNxt->IsSctFrm() )
((SwSectionFrm*)pNxt)->UnlockJoin();
pUp = (SwLayoutFrm*)(*pUpperFrms)[x++];
- ASSERT( pUp->GetUpper() || pUp->IsFlyFrm(), "Lost Upper" );
+ OSL_ENSURE( pUp->GetUpper() || pUp->IsFlyFrm(), "Lost Upper" );
::_InsertCnt( pUp, pDoc, pNd->GetIndex(), sal_False, nStt+1, pNxt );
pNxt = pUp->GetLastLower();
(*pUpperFrms)[x-2] = pNxt;
@@ -346,7 +347,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong
{
SwSectionFrm* pSctFrm = pTmp->FindSctFrm();
pSctFrm->ColUnlock();
- // OD 26.08.2003 #i18103# - invalidate size of section in order to
+ // #i18103# - invalidate size of section in order to
// assure, that the section is formatted, unless it was 'Collocked'
// from its 'collection' until its 'restoration'.
pSctFrm->_InvalidateSize();
@@ -376,7 +377,7 @@ SwNode2Layout::SwNode2Layout( const SwNode& rNd )
void SwNode2Layout::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd )
{
- ASSERT( pImpl, "RestoreUpperFrms without SaveUpperFrms" );
+ OSL_ENSURE( pImpl, "RestoreUpperFrms without SaveUpperFrms" );
pImpl->RestoreUpperFrms( rNds, nStt, nEnd );
}
@@ -403,3 +404,4 @@ SwFrm* SwNode2Layout::GetFrm( const Point* pDocPos,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 5ef2df851e17..ab3f5df151b1 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,12 +59,6 @@ extern sal_Bool CheckNodesRange( const SwNodeIndex& rStt,
SV_DECL_PTRARR(SwSttNdPtrs,SwStartNode*,2,2)
-//#define JP_DEBUG
-#ifdef JP_DEBUG
-#include "shellio.hxx"
-#endif
-
-
// Funktion zum bestimmen des hoechsten Levels innerhalb des Bereiches
sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange );
@@ -82,7 +77,7 @@ SwNodes::SwNodes( SwDoc* pDocument )
{
bInNodesDel = bInDelUpdOutl = bInDelUpdNum = sal_False;
- ASSERT( pMyDoc, "in welchem Doc stehe ich denn?" );
+ OSL_ENSURE( pMyDoc, "in welchem Doc stehe ich denn?" );
sal_uLong nPos = 0;
SwStartNode* pSttNd = new SwStartNode( *this, nPos++ );
@@ -116,12 +111,6 @@ SwNodes::SwNodes( SwDoc* pDocument )
|* Arrays nicht erzeugt werden koennen und somit auch nicht
|* in mehreren drin sein koennen
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
SwNodes::~SwNodes()
@@ -176,20 +165,16 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
SwNodeIndex aDelIdx( *this, n );
SwNode& rNd = aDelIdx.GetNode();
- // --> OD 2005-11-16 #i57920#
- // correction of refactoring done by cws swnumtree:
+ // #i57920# - correction of refactoring done by cws swnumtree:
// - <SwTxtNode::SetLevel( NO_NUMBERING ) is deprecated and
// set <IsCounted> state of the text node to <false>, which
// isn't correct here.
if ( rNd.IsTxtNode() )
{
SwTxtNode* pTxtNode = rNd.GetTxtNode();
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNode->UnregisterNumber();
+
pTxtNode->RemoveFromList();
- // <--
- //if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )//#outline level,zhaojianwei
if ( pTxtNode->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
{
const SwNodePtr pSrch = (SwNodePtr)&rNd;
@@ -203,13 +188,10 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if( rNd.IsTxtNode() )
{
SwTxtNode& rTxtNd = (SwTxtNode&)rNd;
- // --> OD 2008-03-13 #refactorlists#
-// rTxtNd.SyncNumberAndNumRule();
+
rTxtNd.AddToList();
- // <--
if( bInsOutlineIdx &&
- //NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
0 != rTxtNd.GetAttrOutlineLevel() )//<-end,zhaojianwei
{
const SwNodePtr pSrch = (SwNodePtr)&rNd;
@@ -254,7 +236,6 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
SwTxtNode* pTxtNd = (SwTxtNode*)pNd;
// loesche die Gliederungs-Indizies aus dem alten Nodes-Array
- //if( NO_NUMBERING != pTxtNd->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
if( 0 != pTxtNd->GetAttrOutlineLevel() )//<-end,zhaojianwei
pOutlineNds->Remove( pNd );
@@ -277,10 +258,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
// Numerierungen auch aktualisiert werden.
pTxtNd->InvalidateNumRule();
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNd->UnregisterNumber();
pTxtNd->RemoveFromList();
- // <--
}
RemoveNode( rDelPos.GetIndex(), 1, sal_False ); // Indizies verschieben !!
@@ -293,19 +271,14 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if( pTxtNd )
{
SwpHints * const pHts = pTxtNd->GetpSwpHints();
- // setze die OultineNodes im neuen Nodes-Array
- //if( bInsOutlineIdx && NO_NUMBERING != //#outline level,removed by zhaojianwei
- // pTxtNd->GetTxtColl()->GetOutlineLevel() )
+ // OultineNodes set the new nodes in the array
if( bInsOutlineIdx &&
0 != pTxtNd->GetAttrOutlineLevel() ) //#outline level,added by zhaojianwei
{
rNds.pOutlineNds->Insert( pTxtNd );
}
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNd->SyncNumberAndNumRule();
pTxtNd->AddToList();
- // <--
// Sonderbehandlung fuer die Felder!
if( pHts && pHts->Count() )
@@ -413,15 +386,15 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if( !pFrmNd && aFrmNdIdx > rNds.GetEndOfExtras().GetIndex() )
{
- ASSERT( !this, "ob das so richtig ist ??" );
+ OSL_ENSURE( !this, "ob das so richtig ist ??" );
aFrmNdIdx = rNds.GetEndOfContent();
pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, sal_True, sal_False );
if( pFrmNd && !((SwCntntNode*)pFrmNd)->GetDepends() )
pFrmNd = 0;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( !pFrmNd )
- ASSERT( !this, "ChgNode() - kein FrameNode gefunden" );
+ OSL_ENSURE( !this, "ChgNode() - kein FrameNode gefunden" );
#endif
}
if( pFrmNd )
@@ -460,8 +433,6 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
|* Allg.: aRange beschreibt den Bereich -exklusive- aEnd !!
|* ( 1.Node: aStart, letzer Node: aEnd-1 !! )
|*
-|*
-|*
***********************************************************************/
sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
@@ -512,14 +483,10 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// setze den Start-Index
SwNodeIndex aIdx( aIndex );
-/*
- --- JP 17.11.94: sollte ueberholt sein, wird im ChgNode schon erledigt!
- sal_Bool bCorrNum = pSect && pSect->aStart.GetIndex() == aIdx.GetIndex();
-*/
SwStartNode* pStartNode = aIdx.GetNode().pStartOfSection;
aSttNdStack.C40_INSERT( SwStartNode, pStartNode, 0 );
-// aSttNdStack.Insert( rNodes[ aIdx ]->pStartOfSection, 0 );
+
SwNodeRange aOrigInsPos( aIdx, -1, aIdx ); // Originale Insert Pos
//JP 16.01.98: SectionNodes: DelFrms/MakeFrms beim obersten SectionNode!
@@ -577,22 +544,16 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
if( pTmpNd->IsTxtNode() )
((SwTxtNode*)pTmpNd)->RemoveFromList();
-// if( bNewFrms )
-// pCNd->DelFrms();
-
// setze bei Start/EndNodes die richtigen Indizies
// loesche die Gliederungs-Indizies aus
// dem alten Nodes-Array
- //if( pCNd->IsTxtNode() && NO_NUMBERING != //#outline level,zhaojianwei
- // ((SwTxtNode*)pCNd)->GetTxtColl()->GetOutlineLevel() )
if( pCNd->IsTxtNode() && 0 !=
((SwTxtNode*)pCNd)->GetAttrOutlineLevel() )//<-end,by zhaojianwei
pOutlineNds->Remove( pCNd );
else
pCNd = 0;
}
-// else if( bNewFrms && pTmpNd->IsSectionNode() )
-// ((SwSectionNode*)pTmpNd)->DelFrms();
+
BigPtrArray::Move( aMvIdx.GetIndex(), aIdx.GetIndex() );
if( bInsOutlineIdx && pCNd )
@@ -616,16 +577,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
for( sal_uLong n = 0; n < nInsPos; ++n )
{
SwNode* pNd = &aMvIdx.GetNode();
-/* if( bNewFrms )
- {
- if( pNd->IsCntntNode() )
- ((SwCntntNode*)pNd)->DelFrms();
- else if( pNd->IsSectionNode() )
- ((SwSectionNode*)pNd)->DelFrms();
- }
-*/
- //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
// loesche die Gliederungs-Indizies aus
@@ -792,7 +744,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
case ND_TABLENODE:
case ND_STARTNODE:
{
- // Bug #78589# - empty section -> nothing to do
+ // empty section -> nothing to do
// and only if it's a top level section
if( !nInsPos && !nLevel )
{
@@ -844,7 +796,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
else // es wurden alle Nodes innerhalb eines
{ // Start- und End-Nodes verschoben
- ASSERT( pAktNode == aSttNdStack[nLevel] ||
+ OSL_ENSURE( pAktNode == aSttNdStack[nLevel] ||
( pAktNode->IsStartNode() &&
aSttNdStack[nLevel]->IsSectionNode()),
"falscher StartNode" );
@@ -855,7 +807,6 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
nInsPos = 0;
// loesche nur noch den Pointer aus dem Nodes-Array.
-// RemoveNode( aRg.aEnd.GetIndex(), 1, sal_False );
RemoveNode( aRg.aEnd.GetIndex(), 1, sal_True );
aRg.aEnd--;
@@ -879,7 +830,6 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
DelNodes( aRg.aEnd, 2 );
aRg.aEnd--;
}
-// aRg.aEnd--;
}
break;
@@ -926,13 +876,13 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
else {
- ASSERT( sal_False, "wie kommt diser Node ins Nodes-Array??" );
+ OSL_ENSURE( sal_False, "wie kommt diser Node ins Nodes-Array??" );
}
aRg.aEnd--;
break;
default:
- ASSERT( sal_False, "was ist das fuer ein Node??" );
+ OSL_ENSURE( sal_False, "was ist das fuer ein Node??" );
break;
}
@@ -966,21 +916,6 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
rNodes.UpdtOutlineIdx( aOrigInsPos.aStart.GetNode() );
}
-#ifdef JP_DEBUG
- {
-extern Writer* GetDebugWriter(const String&);
-
- Writer* pWriter = GetDebugWriter(aEmptyStr);
- if( pWriter )
- {
- int nError;
- SvFileStream aStrm( "c:\\$$move.db", STREAM_WRITE );
- SwWriter aWriter( aStrm, *pMyDoc );
- aWriter.Write( &nError, pWriter );
- }
- }
-#endif
-
return sal_True;
}
@@ -1023,12 +958,6 @@ extern Writer* GetDebugWriter(const String&);
|* die Debugging Tools geben rRange beim Eintritt und beim
|* Verlassen der Funktion aus
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
void SwNodes::SectionDown(SwNodeRange *pRange, SwStartNodeType eSttNdTyp )
{
@@ -1100,12 +1029,6 @@ void SwNodes::SectionDown(SwNodeRange *pRange, SwStartNodeType eSttNdTyp )
|* die Debugging Tools geben rRange beim Eintritt und beim
|* Verlassen der Funktion aus
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
void SwNodes::SectionUp(SwNodeRange *pRange)
{
@@ -1180,9 +1103,6 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
|* SwIndex & aStart StartNode !!!
|* SwIndex & aEnd EndPunkt
|*
-|* Ersterstellung JP 23.04.91
-|* Letzte Aenderung JP 23.04.91
-|*
*************************************************************************/
void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEnd )
{
@@ -1251,12 +1171,6 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEn
|* geben beim Eintritt in die Funktion Position und Anzahl
|* der zu loeschenden Nodes aus.
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes)
{
@@ -1314,8 +1228,6 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes)
if( pNd->IsTxtNode() )
{
- //if( NO_NUMBERING != //#outline level,zhaojianwei
- // ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() &&
if( 0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() &&//<-end,zhaojianwei
pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
{
@@ -1455,12 +1367,6 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes)
|* eine Sonderbehandlung; es wird davon ausgegangen, dass der
|* erste Node auch ein Startnode ist.
|*
-|* Ersterstellung
-|* VER0100 vb 901214
-|*
-|* Stand
-|* VER0100 vb 901214
-|*
*******************************************************************/
sal_uInt16 SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) const {
// Sonderbehandlung 1. Node
@@ -1625,9 +1531,6 @@ SwNode* SwNodes::GoPreviousWithFrm(SwNodeIndex *pIdx) const
|* 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( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd )
@@ -1664,13 +1567,9 @@ sal_Bool SwNodes::CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& r
|* Parameter SwIndex & Der Startpunkt im Nodes-Array
|* sal_uInt16 die Anzahl
|*
-|* Ersterstellung JP 23.04.91
-|* Letzte Aenderung JP 23.04.91
-|*
*************************************************************************/
void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
{
- int bUpdateNum = 0;
sal_uLong nSttIdx = rStart.GetIndex();
if( !nSttIdx && nCnt == GetEndOfContent().GetIndex()+1 )
@@ -1698,12 +1597,12 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
}
else
{
+ int bUpdateNum = 0;
for( sal_uLong n = nSttIdx, nEnd = nSttIdx + nCnt; n < nEnd; ++n )
{
SwNode* pNd = (*this)[ n ];
if( pNd->IsTxtNode() &&
- //NO_NUMBERING != ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() ) //<-end,zhaojianwei
{ // loesche die Gliederungs-Indizies.
sal_uInt16 nIdxPos;
@@ -1739,9 +1638,6 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt )
|* SwNodeRange & der zu ueberpruefende Bereich
|* Return sal_uInt16 der hoechste Level
|*
-|* Ersterstellung JP 24.04.91
-|* Letzte Aenderung JP 24.04.91
-|*
*************************************************************************/
struct HighLevel
@@ -1780,8 +1676,6 @@ sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange )
|* Parameter SwPaM& zu kopierender Bereich
|* SwNodes& in dieses Nodes-Array
|* SwPosition& auf diese Position im Nodes-Array
-|* Ersterstellung JP 09.07.92
-|* Letzte Aenderung JP 09.07.92
|*
*************************************************************************/
void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
@@ -2005,7 +1899,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
if ( &pStt->nNode.GetNode() == &GetEndOfContent() )
{
const bool bSuccess = GoPrevious( &pStt->nNode );
- ASSERT( bSuccess, "Move() - no ContentNode here" );
+ OSL_ENSURE( bSuccess, "Move() - no ContentNode here" );
(void) bSuccess;
}
pStt->nContent.Assign( pStt->nNode.GetNode().GetCntntNode(),
@@ -2029,8 +1923,6 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
|* Parameter SwNodeRange& zu kopierender Bereich
|* SwDoc& in dieses Dokument
|* SwIndex& auf diese Position im Nodes-Array
-|* Ersterstellung JP 11.11.92
-|* Letzte Aenderung JP 11.11.92
|*
*************************************************************************/
@@ -2224,31 +2116,15 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
aInsPos++; // ueberspringen
}
else {
- ASSERT( sal_False, "wie kommt diser Node ins Nodes-Array??" );
+ OSL_ENSURE( sal_False, "wie kommt diser Node ins Nodes-Array??" );
}
break;
default:
- ASSERT( sal_False, "weder Start-/End-/Content-Node, unbekannter Typ" );
+ OSL_ENSURE( sal_False, "weder Start-/End-/Content-Node, unbekannter Typ" );
}
aRg.aStart++;
}
-
-
-#ifdef JP_DEBUG
- {
-extern Writer* GetDebugWriter(const String&);
-
- Writer* pWriter = GetDebugWriter(aEmptyStr);
- if( pWriter )
- {
- int nError;
- SvFileStream aStrm( "c:\\$$copy.db", STREAM_WRITE );
- SwWriter aWriter( aStrm, *pMyDoc );
- aWriter.Write( &nError, pWriter );
- }
- }
-#endif
}
void SwNodes::_DelDummyNodes( const SwNodeRange& rRg )
@@ -2417,7 +2293,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
: pSttNd->FindSectionNode();
if( !( pSectNd && pSectNd->GetSection().CalcHiddenFlag()/*IsHiddenFlag()*/ ) )
{
- // #130650# in a table in table situation we have to assure that we don't leave the
+ // in a table in table situation we have to assure that we don't leave the
// outer table cell when the inner table is looking for a PrvNxt...
SwTableNode* pTableNd = pSttNd->IsTableNode()
? pSttNd->StartOfSectionNode()->FindTableNode()
@@ -2576,10 +2452,7 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, sal_Bool bDel )
if (pTxtNd)
{
- // --> OD 2008-03-13 #refactorlists#
-// pTxtNd->UnregisterNumber();
pTxtNd->RemoveFromList();
- // <--
}
}
}
@@ -2688,13 +2561,9 @@ SwNode * SwNodes::DocumentSectionEndNode(SwNode * pNode) const
return DocumentSectionStartNode(pNode)->EndOfSectionNode();
}
-//SwNode * SwNodes::operator[](int n) const
-//{
-// return operator[]((sal_uLong) n);
-//}
-// <-#112139#
-
sal_Bool SwNodes::IsDocNodes() const
{
return this == &pMyDoc->GetNodes();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/observablethread.cxx b/sw/source/core/docnode/observablethread.cxx
index 347575165cc4..cafeb9b610b1 100644
--- a/sw/source/core/docnode/observablethread.cxx
+++ b/sw/source/core/docnode/observablethread.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/** class for an observable thread
- OD 2007-01-29 #i73788#
+ #i73788#
@author OD
*/
@@ -95,3 +96,5 @@ void ObservableThread::threadFinished()
{
// empty default implementation
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/pausethreadstarting.cxx b/sw/source/core/docnode/pausethreadstarting.cxx
index d9c9293dce51..df4a060dea67 100644
--- a/sw/source/core/docnode/pausethreadstarting.cxx
+++ b/sw/source/core/docnode/pausethreadstarting.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/** Helper class to pause starting of threads during existence of an instance
of this class
- OD 2007-03-16 #i73788#
+ #i73788#
@author OD
*/
@@ -53,3 +54,5 @@ SwPauseThreadStarting::~SwPauseThreadStarting()
SwThreadManager::GetThreadManager().ResumeStartingOfThreads();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/retrievedinputstreamdata.cxx b/sw/source/core/docnode/retrievedinputstreamdata.cxx
index 21fa5284ac26..78bf5b144e05 100644
--- a/sw/source/core/docnode/retrievedinputstreamdata.cxx
+++ b/sw/source/core/docnode/retrievedinputstreamdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
/** implementation of class <SwRetrievedInputStreamDataManager>
- OD 2007-01-30 #i73788#
+ #i73788#
*/
SwRetrievedInputStreamDataManager* SwRetrievedInputStreamDataManager::mpManager = 0;
SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::mnNextKeyValue = 1;
@@ -130,7 +131,7 @@ bool SwRetrievedInputStreamDataManager::PopData( const tDataKey nDataKey,
filling of the data container to provide retrieved input stream to the
thread Consumer using <Application::PostUserEvent(..)>
- OD 2007-01-29 #i73788#
+ #i73788#
Note: This method has to be run in the main thread.
@author OD
@@ -165,3 +166,4 @@ IMPL_LINK( SwRetrievedInputStreamDataManager,
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/retrieveinputstream.cxx b/sw/source/core/docnode/retrieveinputstream.cxx
index 7da81735e58f..848c5769621c 100644
--- a/sw/source/core/docnode/retrieveinputstream.cxx
+++ b/sw/source/core/docnode/retrieveinputstream.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,13 +28,11 @@
#include "precompiled_sw.hxx"
#include <retrieveinputstream.hxx>
#include <comphelper/mediadescriptor.hxx>
-#ifndef _COM_SUN_STAR_IO_XSTREAM_HXX_
#include <com/sun/star/io/XStream.hpp>
-#endif
/** class for a thread to retrieve an input stream given by an URL
- OD 2007-01-29 #i73788#
+ #i73788#
@author OD
*/
@@ -62,7 +61,7 @@ SwAsyncRetrieveInputStreamThread::~SwAsyncRetrieveInputStreamThread()
void SwAsyncRetrieveInputStreamThread::threadFunction()
{
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > xProps( 1 );
- xProps[0].Name = ::rtl::OUString::createFromAscii( "URL" );
+ xProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
xProps[0].Value <<= ::rtl::OUString( mrLinkedURL );
comphelper::MediaDescriptor aMedium( xProps );
@@ -84,3 +83,5 @@ void SwAsyncRetrieveInputStreamThread::threadFunction()
xInputStream,
aMedium.isStreamReadOnly() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/retrieveinputstreamconsumer.cxx b/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
index 409a96084ced..82ae987f43f5 100644
--- a/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
+++ b/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
/** class to provide creation of a thread to retrieve an input stream given by
an URL and to consume the retrieved input stream.
- OD 2007-01-29 #i73788#
+ #i73788#
@author OD
*/
@@ -70,3 +71,4 @@ void SwAsyncRetrieveInputStreamThreadConsumer::ApplyInputStream(
mrGrfNode.ApplyInputStream( xInputStream, bIsStreamReadOnly );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 54143770bb7c..89d74503ee1d 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,6 @@
#include <docary.hxx>
#include <fmtcntnt.hxx>
#include <fmtpdsc.hxx>
-#include <errhdl.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <node.hxx>
@@ -65,9 +65,7 @@
#include <fmtftntx.hxx>
#include <ftnidx.hxx>
#include <doctxm.hxx>
-// --> FME 2004-06-22 #114856# edit in readonly sections
-#include <fmteiro.hxx>
-// <--
+#include <fmteiro.hxx> // edit in readonly sections
#include <swerror.h>
#include <unosection.hxx>
@@ -76,7 +74,6 @@ using namespace ::com::sun::star;
SV_IMPL_REF( SwServerObject )
-//static const char __FAR_DATA sSectionFmtNm[] = "Section";
#define sSectionFmtNm aEmptyStr
class SwIntrnlSectRefLink : public SwBaseLink
@@ -96,13 +93,11 @@ public:
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#
inline SwSectionNode* GetSectNode()
{
const SwNode* pSectNd( const_cast<SwIntrnlSectRefLink*>(this)->GetAnchor() );
return const_cast<SwSectionNode*>( dynamic_cast<const SwSectionNode*>( pSectNd ) );
}
- // <--
};
@@ -120,9 +115,7 @@ SwSectionData::SwSectionData(SectionType const eType, String const& rName)
, m_sSectionName(rName)
, m_bHiddenFlag(false)
, m_bProtectFlag(false)
- // --> FME 2004-06-22 #114856# edit in readonly sections
- , m_bEditInReadonlyFlag(false)
- // <--
+ , m_bEditInReadonlyFlag(false) // edit in readonly sections
, m_bHidden(false)
, m_bCondHiddenFlag(true)
, m_bConnectFlag(true)
@@ -139,9 +132,8 @@ SwSectionData::SwSectionData(SwSection const& rSection)
, m_Password(rSection.GetPassword())
, m_bHiddenFlag(rSection.IsHiddenFlag())
, m_bProtectFlag(rSection.IsProtect())
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
, m_bEditInReadonlyFlag(rSection.IsEditInReadonly())
- // <--
, m_bHidden(rSection.IsHidden())
, m_bCondHiddenFlag(true)
, m_bConnectFlag(rSection.IsConnectFlag())
@@ -158,9 +150,8 @@ SwSectionData::SwSectionData(SwSectionData const& rOther)
, m_Password(rOther.m_Password)
, m_bHiddenFlag(rOther.m_bHiddenFlag)
, m_bProtectFlag(rOther.m_bProtectFlag)
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
, m_bEditInReadonlyFlag(rOther.m_bEditInReadonlyFlag)
- // <--
, m_bHidden(rOther.m_bHidden)
, m_bCondHiddenFlag(true)
, m_bConnectFlag(rOther.m_bConnectFlag)
@@ -220,9 +211,8 @@ SwSection::SwSection(
}
m_Data.SetProtectFlag( pParentSect->IsProtectFlag() );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
m_Data.SetEditInReadonlyFlag( pParentSect->IsEditInReadonlyFlag() );
- // <--
}
if (!m_Data.IsProtectFlag())
@@ -230,12 +220,10 @@ SwSection::SwSection(
m_Data.SetProtectFlag( rFormat.GetProtect().IsCntntProtected() );
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
- if (!m_Data.IsEditInReadonlyFlag())
+ if (!m_Data.IsEditInReadonlyFlag()) // edit in readonly sections
{
m_Data.SetEditInReadonlyFlag( rFormat.GetEditInReadonly().GetValue() );
}
- // <--
}
@@ -289,8 +277,6 @@ void SwSection::SetSectionData(SwSectionData const& rData)
{
bool const bOldHidden( m_Data.IsHidden() );
m_Data = rData;
- // now update format and reflink with new data
-// SetLinkFileName(m_Data.GetLinkFileName()); // old code did not do this?
// next 2 may actually overwrite m_Data.m_b{Protect,EditInReadonly}Flag
// in Modify, which should result in same flag value as the old code!
SetProtect(m_Data.IsProtectFlag());
@@ -321,7 +307,7 @@ bool SwSection::DataEquals(SwSectionData const& rCmp) const
void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
{
SwSectionFmt* pFmt = GetFmt();
- ASSERT(pFmt, "ImplSetHiddenFlag: no format?");
+ OSL_ENSURE(pFmt, "ImplSetHiddenFlag: no format?");
if( pFmt )
{
const bool bHide = bTmpHidden && bCondition;
@@ -374,22 +360,21 @@ sal_Bool SwSection::CalcHiddenFlag() const
bool SwSection::IsProtect() const
{
SwSectionFmt *const pFmt( GetFmt() );
- ASSERT(pFmt, "SwSection::IsProtect: no format?");
+ OSL_ENSURE(pFmt, "SwSection::IsProtect: no format?");
return (pFmt)
? pFmt->GetProtect().IsCntntProtected()
: IsProtectFlag();
}
-// --> FME 2004-06-22 #114856# edit in readonly sections
+// edit in readonly sections
bool SwSection::IsEditInReadonly() const
{
SwSectionFmt *const pFmt( GetFmt() );
- ASSERT(pFmt, "SwSection::IsEditInReadonly: no format?");
+ OSL_ENSURE(pFmt, "SwSection::IsEditInReadonly: no format?");
return (pFmt)
? pFmt->GetEditInReadonly().GetValue()
: IsEditInReadonlyFlag();
}
-// <--
void SwSection::SetHidden(bool const bFlag)
{
@@ -404,7 +389,7 @@ void SwSection::SetHidden(bool const bFlag)
void SwSection::SetProtect(bool const bFlag)
{
SwSectionFmt *const pFormat( GetFmt() );
- ASSERT(pFormat, "SwSection::SetProtect: no format?");
+ OSL_ENSURE(pFormat, "SwSection::SetProtect: no format?");
if (pFormat)
{
SvxProtectItem aItem( RES_PROTECT );
@@ -418,11 +403,11 @@ void SwSection::SetProtect(bool const bFlag)
}
}
-// --> FME 2004-06-22 #114856# edit in readonly sections
+// edit in readonly sections
void SwSection::SetEditInReadonly(bool const bFlag)
{
SwSectionFmt *const pFormat( GetFmt() );
- ASSERT(pFormat, "SwSection::SetEditInReadonly: no format?");
+ OSL_ENSURE(pFormat, "SwSection::SetEditInReadonly: no format?");
if (pFormat)
{
SwFmtEditInReadonly aItem;
@@ -435,7 +420,6 @@ void SwSection::SetEditInReadonly(bool const bFlag)
m_Data.SetEditInReadonlyFlag(bFlag);
}
}
-// <--
void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
@@ -458,7 +442,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
pOldSet->ClearItem( RES_PROTECT );
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // --> edit in readonly sections
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, sal_False, &pItem ) )
{
@@ -505,7 +489,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
m_Data.SetProtectFlag( bNewFlag );
}
return;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
case RES_EDIT_IN_READONLY:
if( pNew )
{
@@ -514,7 +498,6 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
m_Data.SetEditInReadonlyFlag( bNewFlag );
}
return;
- // <--
case RES_SECTION_HIDDEN:
m_Data.SetHiddenFlag(true);
@@ -731,7 +714,7 @@ SwSection * SwSectionFmt::GetSection() const
return (SwSectionPtr)aIter.First( TYPE(SwSection) );
}
- ASSERT( sal_False, "keine Section als Client." )
+ OSL_ENSURE( sal_False, "keine Section als Client." );
return 0;
}
@@ -747,7 +730,6 @@ void SwSectionFmt::DelFrms()
{
SwClientIter aIter( *this );
SwClient *pLast = aIter.GoStart();
- // --> OD 2007-08-14 #147431#
// First delete the <SwSectionFrm> of the <SwSectionFmt> instance
while ( pLast )
{
@@ -772,18 +754,17 @@ void SwSectionFmt::DelFrms()
}
pLast = aIter++;
}
- // <--
+
sal_uLong nEnde = pSectNd->EndOfSectionIndex();
sal_uLong nStart = pSectNd->GetIndex()+1;
lcl_DeleteFtn( pSectNd, nStart, nEnde );
}
if( pIdx )
{
- //JP 22.09.98:
//Hint fuer Pagedesc versenden. Das mueste eigntlich das Layout im
//Paste der Frames selbst erledigen, aber das fuehrt dann wiederum
//zu weiteren Folgefehlern, die mit Laufzeitkosten geloest werden
- //muesten. #56977# #55001# #56135#
+ //muesten.
SwNodeIndex aNextNd( *pIdx );
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, sal_True, sal_False );
if( pCNd )
@@ -840,7 +821,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
pOldSet->ClearItem( RES_PROTECT );
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // --> edit in readonly sections
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, sal_False, &pItem ) )
{
@@ -894,9 +875,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_PROTECT:
- // --> FME 2004-06-22 #114856# edit in readonly sections
- case RES_EDIT_IN_READONLY:
- // <--
+ case RES_EDIT_IN_READONLY: // edit in readonly sections
// diese Messages bis zum Ende des Baums durchreichen !
if( GetDepends() )
{
@@ -990,7 +969,7 @@ extern "C" {
{
const SwSectionFmt* pFSectFmt = (*(SwSectionPtr*)pFirst)->GetFmt();
const SwSectionFmt* pSSectFmt = (*(SwSectionPtr*)pSecond)->GetFmt();
- ASSERT( pFSectFmt && pSSectFmt &&
+ OSL_ENSURE( pFSectFmt && pSSectFmt &&
pFSectFmt->GetCntnt(sal_False).GetCntntIdx() &&
pSSectFmt->GetCntnt(sal_False).GetCntntIdx(),
"ungueltige Sections" );
@@ -1009,7 +988,7 @@ extern "C" {
{
const SwSectionPtr pFSect = *(SwSectionPtr*)pFirst;
const SwSectionPtr pSSect = *(SwSectionPtr*)pSecond;
- ASSERT( pFSect && pSSect, "ungueltige Sections" );
+ OSL_ENSURE( pFSect && pSSect, "ungueltige Sections" );
StringCompare const eCmp =
pFSect->GetSectionName().CompareTo( pSSect->GetSectionName() );
return eCmp == COMPARE_EQUAL ? 0
@@ -1079,9 +1058,8 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
SwSectionPtr pSection = 0;
const SvxProtectItem* pProtect(0);
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
const SwFmtEditInReadonly* pEditInReadonly = 0;
- // <--
bool bIsHidden = false;
SwClientIter aIter( *this );
@@ -1097,17 +1075,15 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
{
const SwSectionPtr pPS = GetParentSection();
pProtect = &pPS->GetFmt()->GetProtect();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
pEditInReadonly = &pPS->GetFmt()->GetEditInReadonly();
- // <--
bIsHidden = pPS->IsHiddenFlag();
}
else
{
pProtect = &GetProtect();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
pEditInReadonly = &GetEditInReadonly();
- // <--
bIsHidden = pSection->IsHidden();
}
}
@@ -1118,14 +1094,13 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
(SfxPoolItem*)pProtect );
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
if (!pEditInReadonly->GetValue() !=
!pSection->IsEditInReadonlyFlag())
{
pLast->Modify( (SfxPoolItem*)pEditInReadonly,
(SfxPoolItem*)pEditInReadonly );
}
- // <--
if( bIsHidden == pSection->IsHiddenFlag() )
{
@@ -1143,17 +1118,15 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
{
const SwSectionPtr pPS = GetParentSection();
pProtect = &pPS->GetFmt()->GetProtect();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
pEditInReadonly = &pPS->GetFmt()->GetEditInReadonly();
- // <--
bIsHidden = pPS->IsHiddenFlag();
}
else
{
pProtect = &GetProtect();
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
pEditInReadonly = &GetEditInReadonly();
- // <--
bIsHidden = pSection->IsHidden();
}
}
@@ -1226,20 +1199,19 @@ SwSectionFmt::MakeUnoObject()
}
-// --> OD 2007-02-14 #b6521322#
// Method to break section links inside a linked section
void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd )
{
if ( !rSectNd.GetDoc() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"method <lcl_RemoveSectionLinksInSect(..)> - no Doc at SectionNode" );
return;
}
if ( !rSectNd.GetSection().IsConnected() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"method <lcl_RemoveSectionLinksInSect(..)> - no Link at Section of SectionNode" );
return;
}
@@ -1263,7 +1235,6 @@ void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd )
}
}
}
-// <--
void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
{
@@ -1437,7 +1408,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
return ;
}
- // --> OD 2005-02-11 #i38810# - Due to possible existing signatures, the
+ // #i38810# - Due to possible existing signatures, the
// document has to be modified after updating a link.
pDoc->SetModified();
// set additional flag that links have been updated, in order to check this
@@ -1584,7 +1555,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
pCpyRg = new SwNodeRange( pSrcDoc->GetNodes().GetEndOfExtras(), 2,
pSrcDoc->GetNodes().GetEndOfContent() );
- // --> OD 2007-11-30 #i81653#
+ // #i81653#
// Update links of extern linked document or extern linked
// document section, if section is protected.
if ( pSrcDoc != pDoc &&
@@ -1623,9 +1594,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
delete pCpyRg;
}
- // --> OD 2007-02-14 #b6521322#
lcl_BreakSectionLinksInSect( *pSectNd );
- // <--
// update alle Links in diesem Bereich
lcl_UpdateLinksInSect( *this, *pSectNd );
@@ -1726,9 +1695,8 @@ void SwIntrnlSectRefLink::Closed()
aSectionData.SetLinkFileName( aEmptyStr );
aSectionData.SetHidden( false );
aSectionData.SetProtectFlag( false );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
aSectionData.SetEditInReadonlyFlag( false );
- // <--
aSectionData.SetConnectFlag( false );
@@ -1753,7 +1721,7 @@ void SwIntrnlSectRefLink::Closed()
void SwSection::CreateLink( LinkCreateType eCreateType )
{
SwSectionFmt* pFmt = GetFmt();
- ASSERT(pFmt, "SwSection::CreateLink: no format?");
+ OSL_ENSURE(pFmt, "SwSection::CreateLink: no format?");
if (!pFmt || (CONTENT_SECTION == m_Data.GetType()))
return ;
@@ -1799,7 +1767,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
}
break;
default:
- ASSERT( !this, "Was ist das fuer ein Link?" )
+ OSL_ENSURE( !this, "Was ist das fuer ein Link?" );
}
switch( eCreateType )
@@ -1815,7 +1783,6 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
}
}
-// --> OD 2007-02-14 #b6521322#
void SwSection::BreakLink()
{
const SectionType eCurrentType( GetType() );
@@ -1831,7 +1798,7 @@ void SwSection::BreakLink()
if (m_RefLink.Is())
{
SwSectionFmt *const pFormat( GetFmt() );
- ASSERT(pFormat, "SwSection::BreakLink: no format?");
+ OSL_ENSURE(pFormat, "SwSection::BreakLink: no format?");
if (pFormat)
{
pFormat->GetDoc()->GetLinkManager().Remove( m_RefLink );
@@ -1844,7 +1811,6 @@ void SwSection::BreakLink()
SetLinkFileName( aEmptyStr );
SetLinkFilePassword( aEmptyStr );
}
-// <--
const SwNode* SwIntrnlSectRefLink::GetAnchor() const
{
@@ -1863,3 +1829,4 @@ sal_Bool SwIntrnlSectRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 4451b32c736e..464753c462b7 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,12 +38,9 @@
#include <comphelper/mediadescriptor.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/lnkbase.hxx>
-#include <sfx2/linkmgr.hxx>
#include <sfx2/objsh.hxx>
#include <editeng/boxitem.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc> // fuer die EventIds
-#endif
#include <sfx2/linkmgr.hxx>
#include <svtools/soerr.hxx>
#include <fmtfsize.hxx>
@@ -74,10 +72,10 @@ SV_IMPL_REF( SwServerObject )
void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
{
- //JP 4.7.2001: call fist all not SwNoTxtFrames, then the SwNoTxtFrames.
+ //call fist all not SwNoTxtFrames, then the SwNoTxtFrames.
// The reason is, that in the SwNoTxtFrames the Graphic
// after a Paint will be swapped out! So all other "behind"
- // them havent't a loaded Graphic. - #86501#
+ // them havent't a loaded Graphic.
rGrfNd.LockModify();
SwClientIter aIter( rGrfNd );
@@ -101,7 +99,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
{
if( !pCntntNode )
{
- ASSERT(!this, "DataChanged ohne ContentNode" );
+ OSL_ENSURE(!this, "DataChanged ohne ContentNode" );
return ;
}
@@ -195,8 +193,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
// zugreifen zu muessen (sonst erfolgt ein SwapIn!).
if( bGraphicArrived )
{
- // Bug #34735#: immer mit der korrekten Grafik-Size
- // arbeiten
+ // immer mit der korrekten Grafik-Size arbeiten
if( aGrfSz.Height() && aGrfSz.Width() &&
aSz.Height() && aSz.Width() &&
aGrfSz != aSz )
@@ -409,36 +406,16 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
}
#endif
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// TestBalloonInputStream* pTBIS = 0;
-// if(!m_xInputStreamToLoadFrom.is()) {
-// if ( !pCntntNode->IsGrfNode() ||
-// static_cast<SwGrfNode*>(pCntntNode)->GetGrfObj().GetType()
-// != GRAPHIC_DEFAULT )
-// {
-// pTBIS = new TestBalloonInputStream();
-// m_xInputStreamToLoadFrom = pTBIS;
-// }
-// }
- // <--
-
if( GetObj() )
{
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// GetObj()->setStreamToLoadFrom(m_xInputStreamToLoadFrom,m_bIsReadOnly);
- // <--
String aMimeType( SotExchange::GetFormatMimeType( GetContentType() ));
-//!! ??? what have we here to do ????
-//!! if( bNativFormat )
-//!! aData.SetAspect( aData.GetAspect() | ASPECT_ICON );
-
uno::Any aValue;
GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData );
if( bWaitForData && !GetObj() )
{
- ASSERT( !this, "das SvxFileObject wurde in einem GetData geloescht!" );
+ OSL_ENSURE( !this, "das SvxFileObject wurde in einem GetData geloescht!" );
bRes = sal_False;
}
else if( 0 != ( bRes = aValue.hasValue() ) )
@@ -461,17 +438,6 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
bSwapIn = sal_False;
- // --> OD 2005-04-11 #i46300# - deactivate fix for issues i9861 and i33293
-// if ( pTBIS && pTBIS->isTouched() )
-// {
-// // --> OD 2005-04-11 #i46300# - determine correct URL for the graphic
-// String sGrfNm;
-// GetLinkManager()->GetDisplayNames( this, 0, &sGrfNm, 0, 0 );
-// (m_pReReadThread = new ReReadThread(
-// this, sGrfNm, bWaitForData, bNativFormat))->create();
-// // <--
-// }
- // <--
return bRes;
}
@@ -507,7 +473,7 @@ const SwNode* SwBaseLink::GetAnchor() const
}
}
- ASSERT( !this, "GetAnchor nicht ueberlagert" );
+ OSL_ENSURE( !this, "GetAnchor nicht ueberlagert" );
return 0;
}
@@ -534,3 +500,5 @@ sal_Bool SwBaseLink::IsInRange( sal_uLong, sal_uLong, xub_StrLen, xub_StrLen ) c
SwBaseLink::~SwBaseLink()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/swthreadjoiner.cxx b/sw/source/core/docnode/swthreadjoiner.cxx
index 8ee2924d4cdb..70997287e0ae 100644
--- a/sw/source/core/docnode/swthreadjoiner.cxx
+++ b/sw/source/core/docnode/swthreadjoiner.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,7 @@ uno::Reference< util::XJobManager >& SwThreadJoiner::GetThreadJoiner()
mpThreadJoiner =
uno::Reference< util::XJobManager >(
::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.util.JobManager" ) ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.JobManager")) ),
uno::UNO_QUERY );
}
@@ -59,3 +60,5 @@ void SwThreadJoiner::ReleaseThreadJoiner()
{
mpThreadJoiner.clear();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/swthreadmanager.cxx b/sw/source/core/docnode/swthreadmanager.cxx
index 7723bb684664..989ee9348961 100644
--- a/sw/source/core/docnode/swthreadmanager.cxx
+++ b/sw/source/core/docnode/swthreadmanager.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
/** class to manage threads in Writer - it conforms the singleton pattern
- OD 2007-04-13 #i73788#
+ #i73788#
@author OD
*/
@@ -85,3 +86,5 @@ bool SwThreadManager::StartingOfThreadsSuspended()
{
return mpThreadManagerImpl->StartingOfThreadsSuspended();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/threadlistener.cxx b/sw/source/core/docnode/threadlistener.cxx
index 171d9fad380d..c06fa618d2e8 100644
--- a/sw/source/core/docnode/threadlistener.cxx
+++ b/sw/source/core/docnode/threadlistener.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
/** helper class to observe threads
- OD 2007-03-30 #i73788#
+ #i73788#
@author OD
*/
@@ -55,3 +56,4 @@ void ThreadListener::NotifyAboutFinishedThread( const oslInterlockedCount nThrea
mrThreadListenerOwner.NotifyAboutFinishedThread( nThreadID );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/threadmanager.cxx b/sw/source/core/docnode/threadmanager.cxx
index bb7bb4a4332b..7aa6c649b88d 100644
--- a/sw/source/core/docnode/threadmanager.cxx
+++ b/sw/source/core/docnode/threadmanager.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +27,6 @@
************************************************************************/
#include "precompiled_sw.hxx"
#include <threadmanager.hxx>
-#include <errhdl.hxx>
#include <algorithm>
@@ -34,7 +34,7 @@ using namespace ::com::sun::star;
/** class to manage threads
- OD 2007-01-29 #i73788#
+ #i73788#
@author OD
*/
@@ -147,7 +147,7 @@ void ThreadManager::RemoveThread( const oslInterlockedCount nThreadID,
}
else
{
- ASSERT( false, "<ThreadManager::RemoveThread(..)> - ThreadJoiner already gone!" );
+ OSL_ENSURE( false, "<ThreadManager::RemoveThread(..)> - ThreadJoiner already gone!" );
}
}
@@ -200,7 +200,7 @@ bool ThreadManager::StartThread( const tThreadData& rThreadData )
}
else
{
- ASSERT( false, "<ThreadManager::StartThread(..)> - ThreadJoiner already gone!" );
+ OSL_ENSURE( false, "<ThreadManager::StartThread(..)> - ThreadJoiner already gone!" );
}
}
else
@@ -256,3 +256,5 @@ void ThreadManager::ResumeStartingOfThreads()
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index c510705c533c..2b72dbca4dfd 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,12 +121,6 @@ SwFrmFmt *FindFrmFmt( SdrObject *pObj )
pRetval = pContact->GetFmt();
}
}
-/* SJ: after prior consultation with OD we decided to remove this Assertion
-#if OSL_DEBUG_LEVEL > 1
- ASSERT( pRetval,
- "<::FindFrmFmt(..)> - no frame format found for given object. Please inform OD." );
-#endif
-*/
return pRetval;
}
@@ -175,7 +170,7 @@ SwContact* GetUserCall( const SdrObject* pObj )
SdrObject *pTmp;
while ( !pObj->GetUserCall() && 0 != (pTmp = pObj->GetUpGroup()) )
pObj = pTmp;
- ASSERT( !pObj->GetUserCall() || pObj->GetUserCall()->ISA(SwContact),
+ OSL_ENSURE( !pObj->GetUserCall() || pObj->GetUserCall()->ISA(SwContact),
"<::GetUserCall(..)> - wrong type of found object user call." );
return static_cast<SwContact*>(pObj->GetUserCall());
}
@@ -194,30 +189,23 @@ sal_Bool IsMarqueeTextObj( const SdrObject& rObj )
|*
|* SwContact, Ctor und Dtor
|*
-|* Ersterstellung AMA 27.Sep.96 18:13
-|* Letzte Aenderung AMA 27.Sep.96
-|*
|*************************************************************************/
SwContact::SwContact( SwFrmFmt *pToRegisterIn ) :
SwClient( pToRegisterIn ),
- // OD 05.09.2003 #112039# - init member <mbInDTOR>
mbInDTOR( false )
{}
SwContact::~SwContact()
{
- // OD 05.09.2003 #112039# - set <mbInDTOR>
SetInDTOR();
}
-// OD 05.09.2003 #112039# - accessor for member <mbInDTOR>
bool SwContact::IsInDTOR() const
{
return mbInDTOR;
}
-// OD 05.09.2003 #112039# - accessor to set member <mbInDTOR>
void SwContact::SetInDTOR()
{
mbInDTOR = true;
@@ -225,8 +213,6 @@ void SwContact::SetInDTOR()
/** method to move drawing object to corresponding visible layer
- OD 21.08.2003 #i18447#
-
@author OD
*/
void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
@@ -242,7 +228,7 @@ void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
if ( bNotify )
{
SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
- ASSERT( pAnchoredObj,
+ OSL_ENSURE( pAnchoredObj,
"<SwContact::MoveObjToInvisibleLayer(..)> - missing anchored object" );
if ( pAnchoredObj )
{
@@ -279,7 +265,7 @@ void SwContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
if ( bNotify )
{
SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
- ASSERT( pAnchoredObj,
+ OSL_ENSURE( pAnchoredObj,
"<SwContact::MoveObjToInvisibleLayer(..)> - missing anchored object" );
// Note: as-character anchored objects aren't registered at a page frame and
// a notification of its background isn't needed.
@@ -305,20 +291,20 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
{
if ( !_pDrawObj )
{
- ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing object!" );
+ OSL_ENSURE( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing object!" );
return;
}
if ( !pRegisteredIn )
{
- ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing frame format!" );
+ OSL_ENSURE( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing frame format!" );
return;
}
const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
if ( !pIDDMA )
{
- ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no writer document!" );
+ OSL_ENSURE( false, "SwDrawContact::_MoveObjToLayer(..) - no writer document!" );
return;
}
@@ -390,7 +376,7 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
}
// -------------------------------------------------------------------------
-// OD 2004-01-16 #110582# - some virtual helper methods for information
+// some virtual helper methods for information
// about the object (Writer fly frame resp. drawing object)
const SwIndex& SwContact::GetCntntAnchorIndex() const
@@ -400,8 +386,6 @@ const SwIndex& SwContact::GetCntntAnchorIndex() const
/** get minimum order number of anchored objects handled by with contact
- OD 2004-08-24 #110810#
-
@author
*/
sal_uInt32 SwContact::GetMinOrdNum() const
@@ -423,15 +407,13 @@ sal_uInt32 SwContact::GetMinOrdNum() const
aObjs.pop_back();
}
- ASSERT( nMinOrdNum != SAL_MAX_UINT32,
+ OSL_ENSURE( nMinOrdNum != SAL_MAX_UINT32,
"<SwContact::GetMinOrdNum()> - no order number found." );
return nMinOrdNum;
}
/** get maximum order number of anchored objects handled by with contact
- OD 2004-08-24 #110810#
-
@author
*/
sal_uInt32 SwContact::GetMaxOrdNum() const
@@ -461,9 +443,6 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
|*
|* SwFlyDrawContact, Ctor und Dtor
|*
-|* Ersterstellung OK 23.11.94 18:13
-|* Letzte Aenderung MA 06. Apr. 95
-|*
|*************************************************************************/
SwFlyDrawContact::SwFlyDrawContact( SwFlyFrmFmt *pToRegisterIn, SdrModel * ) :
@@ -490,11 +469,11 @@ SwFlyDrawContact::~SwFlyDrawContact()
// OD 2004-03-29 #i26791#
const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj ) const
{
- ASSERT( _pSdrObj,
+ OSL_ENSURE( _pSdrObj,
"<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwVirtFlyDrawObj),
+ OSL_ENSURE( _pSdrObj->ISA(SwVirtFlyDrawObj),
"<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == const_cast<SwFlyDrawContact*>(this),
+ OSL_ENSURE( GetUserCall( _pSdrObj ) == const_cast<SwFlyDrawContact*>(this),
"<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
const SwAnchoredObject* pRetAnchoredObj = 0L;
@@ -509,11 +488,11 @@ const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdr
SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( SdrObject* _pSdrObj )
{
- ASSERT( _pSdrObj,
+ OSL_ENSURE( _pSdrObj,
"<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwVirtFlyDrawObj),
+ OSL_ENSURE( _pSdrObj->ISA(SwVirtFlyDrawObj),
"<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type provided" );
- ASSERT( GetUserCall( _pSdrObj ) == this,
+ OSL_ENSURE( GetUserCall( _pSdrObj ) == this,
"<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
SwAnchoredObject* pRetAnchoredObj = 0L;
@@ -538,7 +517,7 @@ SdrObject* SwFlyDrawContact::GetMaster()
void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
{
- ASSERT( _pNewMaster->ISA(SwFlyDrawObj),
+ OSL_ENSURE( _pNewMaster->ISA(SwFlyDrawObj),
"<SwFlyDrawContact::SetMaster(..)> - wrong type of new master object" );
mpMasterObj = static_cast<SwFlyDrawObj *>(_pNewMaster);
}
@@ -547,9 +526,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
|*
|* SwFlyDrawContact::CreateNewRef()
|*
-|* Ersterstellung MA 14. Dec. 94
-|* Letzte Aenderung MA 24. Apr. 95
-|*
|*************************************************************************/
SwVirtFlyDrawObj *SwFlyDrawContact::CreateNewRef( SwFlyFrm *pFly )
@@ -629,21 +605,18 @@ sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm )
|*
|* SwFlyDrawContact::Modify()
|*
-|* Ersterstellung OK 08.11.94 10:21
-|* Letzte Aenderung MA 06. Dec. 94
-|*
|*************************************************************************/
void SwFlyDrawContact::Modify( SfxPoolItem *, SfxPoolItem * )
{
}
-// OD 2004-01-16 #110582# - override method to control Writer fly frames,
+// override method to control Writer fly frames,
// which are linked, and to assure that all objects anchored at/inside the
// Writer fly frame are also made visible.
void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
{
- ASSERT( _pDrawObj->ISA(SwVirtFlyDrawObj),
+ OSL_ENSURE( _pDrawObj->ISA(SwVirtFlyDrawObj),
"<SwFlyDrawContact::MoveObjToVisibleLayer(..)> - wrong SdrObject type -> crash" );
if ( GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) )
@@ -677,12 +650,12 @@ void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
SwContact::MoveObjToVisibleLayer( _pDrawObj );
}
-// OD 2004-01-16 #110582# - override method to control Writer fly frames,
+// override method to control Writer fly frames,
// which are linked, and to assure that all objects anchored at/inside the
// Writer fly frame are also made invisible.
void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
{
- ASSERT( _pDrawObj->ISA(SwVirtFlyDrawObj),
+ OSL_ENSURE( _pDrawObj->ISA(SwVirtFlyDrawObj),
"<SwFlyDrawContact::MoveObjToInvisibleLayer(..)> - wrong SdrObject type -> crash" );
if ( !GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) )
@@ -712,8 +685,6 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
/** get data collection of anchored objects, handled by with contact
- OD 2004-08-23 #110810#
-
@author
*/
void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
@@ -733,9 +704,6 @@ void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAncho
|*
|* SwDrawContact, Ctor+Dtor
|*
-|* Ersterstellung MA 09. Jan. 95
-|* Letzte Aenderung MA 22. Jul. 98
-|*
|*************************************************************************/
bool CheckControlLayer( const SdrObject *pObj )
{
@@ -760,19 +728,16 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
SwContact( pToRegisterIn ),
maAnchoredDrawObj(),
mbMasterObjCleared( false ),
- // OD 10.10.2003 #112299#
mbDisconnectInProgress( false ),
- // --> OD 2006-01-18 #129959#
mbUserCallActive( false ),
// Note: value of <meEventTypeOfCurrentUserCall> isn't of relevance, because
// <mbUserCallActive> is sal_False.
meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
- // <--
{
// clear vector containing 'virtual' drawing objects.
maDrawVirtObjs.clear();
- // --> OD 2004-09-22 #i33909# - assure, that drawing object is inserted
+ // --> #i33909# - assure, that drawing object is inserted
// in the drawing page.
if ( !pObj->IsInserted() )
{
@@ -785,27 +750,26 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
//Gruppenobjekte, wenn diese Controls enthalten.
if ( ::CheckControlLayer( pObj ) )
{
- // OD 25.06.2003 #108784# - set layer of object to corresponding invisible layer.
+ // set layer of object to corresponding invisible layer.
pObj->SetLayer( pToRegisterIn->getIDocumentDrawModelAccess()->GetInvisibleControlsId() );
}
- // OD 2004-03-29 #i26791#
+ // #i26791#
pObj->SetUserCall( this );
maAnchoredDrawObj.SetDrawObj( *pObj );
// if there already exists an SwXShape for the object, ensure it knows about us, and the SdrObject
- // FS 2009-04-07 #i99056#
+ // #i99056#
SwXShape::AddExistingShapeToFmt( *pObj );
}
SwDrawContact::~SwDrawContact()
{
- // OD 05.09.2003 #112039# - set <mbInDTOR>
SetInDTOR();
DisconnectFromLayout();
- // OD 25.06.2003 #108784# - remove 'master' from drawing page
+ // remove 'master' from drawing page
RemoveMasterFromDrawPage();
// remove and destroy 'virtual' drawing objects.
@@ -827,12 +791,12 @@ const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj
_pSdrObj = GetMaster();
}
- ASSERT( _pSdrObj,
+ OSL_ENSURE( _pSdrObj,
"<SwDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwDrawVirtObj) ||
+ OSL_ENSURE( _pSdrObj->ISA(SwDrawVirtObj) ||
( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ),
"<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == const_cast<SwDrawContact*>(this) ||
+ OSL_ENSURE( GetUserCall( _pSdrObj ) == const_cast<SwDrawContact*>(this) ||
_pSdrObj == GetMaster(),
"<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
@@ -861,12 +825,12 @@ SwAnchoredObject* SwDrawContact::GetAnchoredObj( SdrObject* _pSdrObj )
_pSdrObj = GetMaster();
}
- ASSERT( _pSdrObj,
+ OSL_ENSURE( _pSdrObj,
"<SwDrawContact::GetAnchoredObj(..)> - no object provided" );
- ASSERT( _pSdrObj->ISA(SwDrawVirtObj) ||
+ OSL_ENSURE( _pSdrObj->ISA(SwDrawVirtObj) ||
( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ),
"<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
- ASSERT( GetUserCall( _pSdrObj ) == this || _pSdrObj == GetMaster(),
+ OSL_ENSURE( GetUserCall( _pSdrObj ) == this || _pSdrObj == GetMaster(),
"<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
SwAnchoredObject* pRetAnchoredObj = 0L;
@@ -900,9 +864,9 @@ SdrObject* SwDrawContact::GetMaster()
: 0L;
}
-// OD 16.05.2003 #108784# - overload <SwContact::SetMaster(..)> in order to
+// overload <SwContact::SetMaster(..)> in order to
// assert, if the 'master' drawing object is replaced.
-// OD 10.07.2003 #110742# - replace of master object correctly handled, if
+// replace of master object correctly handled, if
// handled by method <SwDrawContact::ChangeMasterObject(..)>. Thus, assert
// only, if a debug level is given.
void SwDrawContact::SetMaster( SdrObject* _pNewMaster )
@@ -910,7 +874,7 @@ void SwDrawContact::SetMaster( SdrObject* _pNewMaster )
if ( _pNewMaster )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "debug notification - master replaced!" );
+ OSL_ENSURE( false, "debug notification - master replaced!" );
#endif
maAnchoredDrawObj.SetDrawObj( *_pNewMaster );
}
@@ -936,8 +900,8 @@ const SwFrm* SwDrawContact::GetAnchorFrm( const SdrObject* _pDrawObj ) const
}
else
{
- ASSERT( false,
- "<SwDrawContact::GetAnchorFrm(..)> - unknown drawing object." )
+ OSL_ENSURE( false,
+ "<SwDrawContact::GetAnchorFrm(..)> - unknown drawing object." );
}
return pAnchorFrm;
@@ -954,15 +918,15 @@ SwFrm* SwDrawContact::GetAnchorFrm( SdrObject* _pDrawObj )
}
else
{
- ASSERT( _pDrawObj->ISA(SwDrawVirtObj),
- "<SwDrawContact::GetAnchorFrm(..)> - unknown drawing object." )
+ OSL_ENSURE( _pDrawObj->ISA(SwDrawVirtObj),
+ "<SwDrawContact::GetAnchorFrm(..)> - unknown drawing object." );
pAnchorFrm = static_cast<SwDrawVirtObj*>(_pDrawObj)->AnchorFrm();
}
return pAnchorFrm;
}
-// OD 23.06.2003 #108784# - method to create a new 'virtual' drawing object.
+// method to create a new 'virtual' drawing object.
SwDrawVirtObj* SwDrawContact::CreateVirtObj()
{
// determine 'master'
@@ -977,7 +941,7 @@ SwDrawVirtObj* SwDrawContact::CreateVirtObj()
return pNewDrawVirtObj;
}
-// OD 23.06.2003 #108784# - destroys a given 'virtual' drawing object.
+// destroys a given 'virtual' drawing object.
// side effect: 'virtual' drawing object is removed from data structure
// <maDrawVirtObjs>.
void SwDrawContact::DestroyVirtObj( SwDrawVirtObj* _pVirtObj )
@@ -989,7 +953,7 @@ void SwDrawContact::DestroyVirtObj( SwDrawVirtObj* _pVirtObj )
}
}
-// OD 16.05.2003 #108784# - add a 'virtual' drawing object to drawing page.
+// add a 'virtual' drawing object to drawing page.
// Use an already created one, which isn't used, or create a new one.
SwDrawVirtObj* SwDrawContact::AddVirtObj()
{
@@ -1015,7 +979,7 @@ SwDrawVirtObj* SwDrawContact::AddVirtObj()
return pAddedDrawVirtObj;
}
-// OD 16.05.2003 #108784# - remove 'virtual' drawing objects and destroy them.
+// remove 'virtual' drawing objects and destroy them.
void SwDrawContact::RemoveAllVirtObjs()
{
for ( std::list<SwDrawVirtObj*>::iterator aDrawVirtObjsIter = maDrawVirtObjs.begin();
@@ -1065,12 +1029,12 @@ bool SwDrawContact::VirtObjAnchoredAtFrmPred::operator() ( const SwDrawVirtObj*
return ( pObjAnchorFrm == mpAnchorFrm );
}
-// OD 19.06.2003 #108784# - get drawing object ('master' or 'virtual') by frame.
+// get drawing object ('master' or 'virtual') by frame.
SdrObject* SwDrawContact::GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm )
{
SdrObject* pRetDrawObj = 0L;
- // OD 2004-04-14 #i26791# - compare master frames instead of direct frames
+ // #i26791# - compare master frames instead of direct frames
const SwFrm* pProposedAnchorFrm = &_rAnchorFrm;
if ( pProposedAnchorFrm->IsCntntFrm() )
{
@@ -1118,12 +1082,8 @@ SdrObject* SwDrawContact::GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm )
|*
|* SwDrawContact::Changed
|*
-|* Ersterstellung MA 09. Jan. 95
-|* Letzte Aenderung MA 29. May. 96
-|*
|*************************************************************************/
-// OD 03.07.2003 #108784#
void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
{
for ( std::list<SwDrawVirtObj*>::iterator aDrawVirtObjIter = maDrawVirtObjs.begin();
@@ -1133,9 +1093,8 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
SwDrawVirtObj* pDrawVirtObj = (*aDrawVirtObjIter);
if ( pDrawVirtObj->GetAnchorFrm() )
{
- // --> OD 2004-10-21 #i34640# - determine correct page frame
+ // #i34640# - determine correct page frame
SwPageFrm* pPage = pDrawVirtObj->AnchoredObj()->FindPageFrmOfAnchor();
- // <--
if( pOldBoundRect && pPage )
{
SwRect aOldRect( *pOldBoundRect );
@@ -1144,14 +1103,11 @@ void SwDrawContact::NotifyBackgrdOfAllVirtObjs( const Rectangle* pOldBoundRect )
::Notify_Background( pDrawVirtObj, pPage,
aOldRect, PREP_FLY_LEAVE,sal_True);
}
- // --> OD 2004-10-21 #i34640# - include spacing for wrapping
+ // #i34640# - include spacing for wrapping
SwRect aRect( pDrawVirtObj->GetAnchoredObj()->GetObjRectWithSpaces() );
- // <--
if( aRect.HasArea() )
{
- // --> OD 2004-10-21 #i34640# - simplify
SwPageFrm* pPg = (SwPageFrm*)::FindPage( aRect, pPage );
- // <--
if ( pPg )
::Notify_Background( pDrawVirtObj, pPg, aRect,
PREP_FLY_ARRIVE, sal_True );
@@ -1248,7 +1204,6 @@ void SwDrawContact::Changed( const SdrObject& rObj,
pDoc->GetRootFrm()->EndAllAction();
}
-// --> OD 2006-01-18 #129959#
// helper class for method <SwDrawContact::_Changed(..)> for handling nested
// <SdrObjUserCall> events
class NestedUserCallHdl
@@ -1283,7 +1238,7 @@ class NestedUserCallHdl
mpDrawContact = 0;
}
- bool IsNestedUserCall()
+ bool IsNestedUserCall() const
{
return mbParentUserCallActive;
}
@@ -1314,7 +1269,7 @@ class NestedUserCallHdl
if ( bTmpAssert )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::_Changed(..)> - unknown nested <UserCall> event. This is serious, please inform OD." );
}
}
@@ -1329,7 +1284,6 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
SdrUserCallType eType,
const Rectangle* pOldBoundRect )
{
- // --> OD 2006-01-18 #129959#
// suppress handling of nested <SdrObjUserCall> events
NestedUserCallHdl aNestedUserCallHdl( this, eType );
if ( aNestedUserCallHdl.IsNestedUserCall() )
@@ -1337,14 +1291,12 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
aNestedUserCallHdl.AssertNestedUserCall();
return;
}
- // <--
- // OD 05.08.2002 #100843# - do *not* notify, if document is destructing
+ // do *not* notify, if document is destructing
// --> OD 2004-10-21 #i35912# - do *not* notify for as-character anchored
// drawing objects.
// --> OD 2004-11-11 #i35007#
// improvement: determine as-character anchored object flag only once.
const bool bAnchoredAsChar = ObjAnchoredAsChar();
- // <--
const bool bNotify = !(GetFmt()->GetDoc()->IsInDtor()) &&
( SURROUND_THROUGHT != GetFmt()->GetSurround().GetSurround() ) &&
!bAnchoredAsChar;
@@ -1356,7 +1308,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
if ( bNotify )
{
lcl_NotifyBackgroundOfObj( *this, rObj, pOldBoundRect );
- // --> OD 2004-10-27 #i36181# - background of 'virtual'
+ // --> #i36181# - background of 'virtual'
// drawing objects have also been notified.
NotifyBackgrdOfAllVirtObjs( pOldBoundRect );
// <--
@@ -1364,17 +1316,16 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
DisconnectFromLayout( false );
SetMaster( NULL );
delete this;
- // --> FME 2006-07-12 #i65784# Prevent memory corruption
+ // --> #i65784# Prevent memory corruption
aNestedUserCallHdl.DrawContactDeleted();
// <--
break;
}
case SDRUSERCALL_INSERTED:
{
- // OD 10.10.2003 #112299#
if ( mbDisconnectInProgress )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::_Changed(..)> - Insert event during disconnection from layout is invalid." );
}
else
@@ -1399,7 +1350,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
case SDRUSERCALL_CHILD_INSERTED :
case SDRUSERCALL_CHILD_REMOVED :
{
- // --> AW, OD 2010-09-13 #i113730#
+ // --> #i113730#
// force layer of controls for group objects containing control objects
if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj()))
{
@@ -1511,7 +1462,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::_Changed(..)> - unsupported layout direction" );
}
}
@@ -1564,22 +1515,6 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// <--
}
}
- // --> OD 2006-01-18 #129959#
- // It reveals that the following code causes several defects -
- // on copying or on ungrouping a group shape containing edge objects.
- // Testing fix for #i53320# also reveal that the following code
- // isn't necessary.
-// // --> OD 2005-08-15 #i53320# - reset positioning attributes,
-// // if anchored drawing object isn't yet positioned.
-// else if ( pAnchoredDrawObj->NotYetPositioned() &&
-// static_cast<const SwDrawFrmFmt&>(pAnchoredDrawObj->GetFrmFmt()).IsPosAttrSet() )
-// {
-// const_cast<SwDrawFrmFmt&>(
-// static_cast<const SwDrawFrmFmt&>(pAnchoredDrawObj->GetFrmFmt()))
-// .ResetPosAttr();
-// }
-// // <--
- // <--
}
break;
case SDRUSERCALL_CHGATTR:
@@ -1616,15 +1551,11 @@ namespace
|*
|* SwDrawContact::Modify()
|*
-|* Ersterstellung MA 09. Jan. 95
-|* Letzte Aenderung MA 03. Dec. 95
-|*
|*************************************************************************/
void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
- // OD 10.10.2003 #112299#
- ASSERT( !mbDisconnectInProgress,
+ OSL_ENSURE( !mbDisconnectInProgress,
"<SwDrawContact::Modify(..)> called during disconnection.");
sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
@@ -1632,11 +1563,11 @@ void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( pNewAnchorFmt )
{
- // JP 10.04.95: nicht auf ein Reset Anchor reagieren !!!!!
+ // nicht auf ein Reset Anchor reagieren !!!!!
if ( SFX_ITEM_SET ==
GetFmt()->GetAttrSet().GetItemState( RES_ANCHOR, sal_False ) )
{
- // OD 10.10.2003 #112299# - no connect to layout during disconnection
+ // no connect to layout during disconnection
if ( !mbDisconnectInProgress )
{
// determine old object retangle of 'master' drawing object
@@ -1645,7 +1576,7 @@ void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
Rectangle aOldRect;
if ( GetAnchorFrm() )
{
- // --> OD 2004-10-27 #i36181# - include spacing in object
+ // --> #i36181# - include spacing in object
// rectangle for notification.
aOldRect = maAnchoredDrawObj.GetObjRectWithSpaces().SVRect();
pOldRect = &aOldRect;
@@ -1660,10 +1591,10 @@ void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
const SwFmtAnchor* pOldAnchorFmt = pOld ? lcl_getAnchorFmt( *pOld ) : NULL;
if ( !pOldAnchorFmt || ( pOldAnchorFmt->GetAnchorId() != pNewAnchorFmt->GetAnchorId() ) )
{
- ASSERT( maAnchoredDrawObj.DrawObj(), "SwDrawContact::Modify: no draw object here?" );
+ OSL_ENSURE( maAnchoredDrawObj.DrawObj(), "SwDrawContact::Modify: no draw object here?" );
if ( maAnchoredDrawObj.DrawObj() )
{
- // --> OD 2009-07-10 #i102752#
+ // --> #i102752#
// assure that a ShapePropertyChangeNotifier exists
maAnchoredDrawObj.DrawObj()->notifyShapePropertyChange( ::svx::eTextShapeAnchorType );
// <--
@@ -1674,12 +1605,11 @@ void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
else
DisconnectFromLayout();
}
- // --> OD 2006-03-17 #i62875# - revised fix for issue #124157#
- // no further notification, if not connected to Writer layout
+ // --> #i62875# - no further notification, if not connected to Writer layout
else if ( maAnchoredDrawObj.GetAnchorFrm() &&
maAnchoredDrawObj.GetDrawObj()->GetUserCall() )
{
- // --> OD 2004-07-01 #i28701# - on change of wrapping style, hell|heaven layer,
+ // --> #i28701# - on change of wrapping style, hell|heaven layer,
// or wrapping style influence an update of the <SwSortedObjs> list,
// the drawing object is registered in, has to be performed. This is triggered
// by the 1st parameter of method call <_InvalidateObjs(..)>.
@@ -1733,7 +1663,7 @@ void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::Modify(..)> - unhandled attribute? - please inform od@openoffice.org" );
}
#endif
@@ -1784,17 +1714,13 @@ void SwDrawContact::_InvalidateObjs( const bool _bUpdateSortedObjsList )
|*
|* SwDrawContact::DisconnectFromLayout()
|*
-|* Ersterstellung MA 09. Jan. 95
-|* Letzte Aenderung MA 25. Mar. 99
-|*
|*************************************************************************/
void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
{
- // OD 10.10.2003 #112299#
mbDisconnectInProgress = true;
- // --> OD 2004-10-27 #i36181# - notify background of drawing object
+ // --> #i36181# - notify background of drawing object
if ( _bMoveMasterToInvisibleLayer &&
!(GetFmt()->GetDoc()->IsInDtor()) &&
GetAnchorFrm() )
@@ -1805,7 +1731,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
}
// <--
- // OD 16.05.2003 #108784# - remove 'virtual' drawing objects from writer
+ // remove 'virtual' drawing objects from writer
// layout and from drawing page
for ( std::list<SwDrawVirtObj*>::iterator aDisconnectIter = maDrawVirtObjs.begin();
aDisconnectIter != maDrawVirtObjs.end();
@@ -1830,24 +1756,21 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
pView->MarkObj( GetMaster(), pView->GetSdrPageView(), sal_True );
}
- // OD 25.06.2003 #108784# - Instead of removing 'master' object from
- // drawing page, move the 'master' drawing object into the corresponding
- // invisible layer.
+ // Instead of removing 'master' object from drawing page, move the
+ // 'master' drawing object into the corresponding invisible layer.
{
//((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
// RemoveObject( GetMaster()->GetOrdNum() );
- // OD 21.08.2003 #i18447# - in order to consider group object correct
+ // #i18447# - in order to consider group object correct
// use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
MoveObjToInvisibleLayer( GetMaster() );
}
}
- // OD 10.10.2003 #112299#
mbDisconnectInProgress = false;
}
-// OD 26.06.2003 #108784# - method to remove 'master' drawing object
-// from drawing page.
+// method to remove 'master' drawing object from drawing page.
void SwDrawContact::RemoveMasterFromDrawPage()
{
if ( GetMaster() )
@@ -1861,11 +1784,10 @@ void SwDrawContact::RemoveMasterFromDrawPage()
}
}
-// OD 19.06.2003 #108784# - disconnect for a dedicated drawing object -
-// could be 'master' or 'virtual'.
+// disconnect for a dedicated drawing object - could be 'master' or 'virtual'.
// a 'master' drawing object will disconnect a 'virtual' drawing object
// in order to take its place.
-// OD 13.10.2003 #i19919# - no special case, if drawing object isn't in
+// #i19919# - no special case, if drawing object isn't in
// page header/footer, in order to get drawing objects in repeating table headers
// also working.
void SwDrawContact::DisconnectObjFromLayout( SdrObject* _pDrawObj )
@@ -1909,9 +1831,6 @@ void SwDrawContact::DisconnectObjFromLayout( SdrObject* _pDrawObj )
|*
|* SwDrawContact::ConnectToLayout()
|*
-|* Ersterstellung MA 09. Jan. 95
-|* Letzte Aenderung MA 25. Mar. 99
-|*
|*************************************************************************/
SwTxtFrm* lcl_GetFlyInCntntAnchor( SwTxtFrm* _pProposedAnchorFrm,
const xub_StrLen _nTxtOfs )
@@ -1929,20 +1848,19 @@ SwTxtFrm* lcl_GetFlyInCntntAnchor( SwTxtFrm* _pProposedAnchorFrm,
void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
- // OD 10.10.2003 #112299# - *no* connect to layout during disconnection from
- // layout.
+ // *no* connect to layout during disconnection from layout.
if ( mbDisconnectInProgress )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::ConnectToLayout(..)> called during disconnection.");
return;
}
- // --> OD 2004-09-22 #i33909# - *no* connect to layout, if 'master' drawing
+ // --> #i33909# - *no* connect to layout, if 'master' drawing
// object isn't inserted in the drawing page
if ( !GetMaster()->IsInserted() )
{
- ASSERT( false, "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
+ OSL_ENSURE( false, "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
return;
}
// <--
@@ -1955,7 +1873,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
return;
}
- // OD 16.05.2003 #108784# - remove 'virtual' drawing objects from writer
+ // remove 'virtual' drawing objects from writer
// layout and from drawing page, and remove 'master' drawing object from
// writer layout - 'master' object will remain in drawing page.
DisconnectFromLayout( false );
@@ -1996,7 +1914,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
ClrContourCache( GetMaster() );
}
- // OD 16.05.2003 #108784# - support drawing objects in header/footer,
+ // support drawing objects in header/footer,
// but not control objects:
// anchor at first found frame the 'master' object and
// at the following frames 'virtual' drawing objects.
@@ -2061,12 +1979,11 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
if ( FLY_AT_FLY == pAnch->GetAnchorId() && !pFrm->IsFlyFrm() )
{
pFrm = pFrm->FindFlyFrm();
- ASSERT( pFrm,
+ OSL_ENSURE( pFrm,
"<SwDrawContact::ConnectToLayout(..)> - missing fly frame -> crash." );
}
- // OD 2004-01-20 #110582# - find correct follow for
- // as character anchored objects.
+ // find correct follow for as character anchored objects
if ((pAnch->GetAnchorId() == FLY_AS_CHAR) &&
pFrm->IsTxtFrm() )
{
@@ -2091,8 +2008,6 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
pFrm->AppendDrawObj( *(pDrawVirtObj->AnchoredObj()) );
- // for repaint, use new ActionChanged()
- // pDrawVirtObj->SendRepaintBroadcast();
pDrawVirtObj->ActionChanged();
}
@@ -2105,18 +2020,18 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
break;
default:
- ASSERT( sal_False, "Unknown Anchor." )
+ OSL_ENSURE( sal_False, "Unknown Anchor." );
break;
}
if ( GetAnchorFrm() )
{
::setContextWritingMode( maAnchoredDrawObj.DrawObj(), GetAnchorFrm() );
- // OD 2004-04-01 #i26791# - invalidate objects instead of direct positioning
+ // #i26791# - invalidate objects instead of direct positioning
_InvalidateObjs();
}
}
-// OD 27.06.2003 #108784# - insert 'master' drawing object into drawing page
+// insert 'master' drawing object into drawing page
void SwDrawContact::InsertMasterIntoDrawPage()
{
if ( !GetMaster()->IsInserted() )
@@ -2131,14 +2046,11 @@ void SwDrawContact::InsertMasterIntoDrawPage()
|*
|* SwDrawContact::FindPage(), ChkPage()
|*
-|* Ersterstellung MA 21. Mar. 95
-|* Letzte Aenderung MA 19. Jul. 96
-|*
|*************************************************************************/
SwPageFrm* SwDrawContact::FindPage( const SwRect &rRect )
{
- // --> OD 2004-07-01 #i28701# - use method <GetPageFrm()>
+ // --> #i28701# - use method <GetPageFrm()>
SwPageFrm* pPg = GetPageFrm();
if ( !pPg && GetAnchorFrm() )
pPg = GetAnchorFrm()->FindPageFrm();
@@ -2149,24 +2061,22 @@ SwPageFrm* SwDrawContact::FindPage( const SwRect &rRect )
void SwDrawContact::ChkPage()
{
- // OD 10.10.2003 #112299#
if ( mbDisconnectInProgress )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawContact::ChkPage()> called during disconnection." );
return;
}
- // --> OD 2004-07-01 #i28701#
+ // --> #i28701#
SwPageFrm* pPg = ( maAnchoredDrawObj.GetAnchorFrm() &&
maAnchoredDrawObj.GetAnchorFrm()->IsPageFrm() )
? GetPageFrm()
: FindPage( GetMaster()->GetCurrentBoundRect() );
if ( GetPageFrm() != pPg )
{
- // OD 27.06.2003 #108784# - if drawing object is anchor in header/footer
- // a change of the page is a dramatic change. Thus, completely re-connect
- // to the layout
+ // if drawing object is anchor in header/footer a change of the page
+ // is a dramatic change. Thus, completely re-connect to the layout
if ( maAnchoredDrawObj.GetAnchorFrm() &&
maAnchoredDrawObj.GetAnchorFrm()->FindFooterOrHeader() )
{
@@ -2174,7 +2084,7 @@ void SwDrawContact::ChkPage()
}
else
{
- // --> OD 2004-07-01 #i28701# - use methods <GetPageFrm()> and <SetPageFrm>
+ // --> #i28701# - use methods <GetPageFrm()> and <SetPageFrm>
if ( GetPageFrm() )
GetPageFrm()->RemoveDrawObjFromPage( maAnchoredDrawObj );
pPg->AppendDrawObjToPage( maAnchoredDrawObj );
@@ -2187,11 +2097,8 @@ void SwDrawContact::ChkPage()
|*
|* SwDrawContact::ChangeMasterObject()
|*
-|* Ersterstellung MA 07. Aug. 95
-|* Letzte Aenderung MA 20. Apr. 99
-|*
|*************************************************************************/
-// OD 10.07.2003 #110742# - Important note:
+// Important note:
// method is called by method <SwDPage::ReplaceObject(..)>, which called its
// corresponding superclass method <FmFormPage::ReplaceObject(..)>.
// Note: 'master' drawing object *has* to be connected to layout triggered
@@ -2199,7 +2106,7 @@ void SwDrawContact::ChkPage()
void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
{
DisconnectFromLayout( false );
- // OD 10.07.2003 #110742# - consider 'virtual' drawing objects
+ // consider 'virtual' drawing objects
RemoveAllVirtObjs();
GetMaster()->SetUserCall( 0 );
@@ -2209,12 +2116,7 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
_InvalidateObjs();
}
-/** get data collection of anchored objects, handled by with contact
-
- OD 2004-08-23 #110810#
-
- @author
-*/
+// get data collection of anchored objects, handled by with contact
void SwDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
{
_roAnchoredObjs.push_back( const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj) );
@@ -2335,15 +2237,6 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence VOCOfDrawVirtObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
-#ifdef DBG_UTIL
- // #i101734#
- static bool bCheckOtherThanTranslate(false);
- static double fShearX(0.0);
- static double fRotation(0.0);
- static double fScaleX(0.0);
- static double fScaleY(0.0);
-#endif
-
const VCOfDrawVirtObj& rVC = static_cast< const VCOfDrawVirtObj& >(GetViewContact());
const SdrObject& rReferencedObject = rVC.GetSwDrawVirtObj().GetReferencedObj();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
@@ -2354,20 +2247,8 @@ namespace sdr
if(aLocalOffset.X() || aLocalOffset.Y())
{
-#ifdef DBG_UTIL
- // #i101734# added debug code to check more complex transformations
- // than just a translation
- if(bCheckOtherThanTranslate)
- {
- aOffsetMatrix.scale(fScaleX, fScaleY);
- aOffsetMatrix.shearX(tan(fShearX * F_PI180));
- aOffsetMatrix.rotate(fRotation * F_PI180);
- }
-#endif
-
aOffsetMatrix.set(0, 2, aLocalOffset.X());
aOffsetMatrix.set(1, 2, aLocalOffset.Y());
-
}
if(rReferencedObject.ISA(SdrObjGroup))
@@ -2418,8 +2299,6 @@ namespace sdr
// =============================================================================
/** implementation of class <SwDrawVirtObj>
- OD 14.05.2003 #108784#
-
@author OD
*/
@@ -2430,7 +2309,6 @@ sdr::contact::ViewContact* SwDrawVirtObj::CreateObjectSpecificViewContact()
return new sdr::contact::VCOfDrawVirtObj(*this);
}
-// #108784#
// implemetation of SwDrawVirtObj
SwDrawVirtObj::SwDrawVirtObj( SdrObject& _rNewObj,
SwDrawContact& _rDrawContact )
@@ -2604,8 +2482,6 @@ void SwDrawVirtObj::RecalcBoundRect()
// OD 2004-04-05 #i26791# - switch order of calling <GetOffset()> and
// <ReferencedObj().GetCurrentBoundRect()>, because <GetOffset()> calculates
// its value by the 'BoundRect' of the referenced object.
- //aOutRect = rRefObj.GetCurrentBoundRect();
- //aOutRect += GetOffset();
const Point aOffset(GetOffset());
aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset;
@@ -2639,7 +2515,9 @@ SdrHdl* SwDrawVirtObj::GetHdl(sal_uInt32 nHdlNum) const
SdrHdl* SwDrawVirtObj::GetPlusHdl(const SdrHdl& rHdl, sal_uInt16 nPlNum) const
{
SdrHdl* pHdl = rRefObj.GetPlusHdl(rHdl, nPlNum);
- pHdl->SetPos(pHdl->GetPos() + GetOffset());
+
+ if (pHdl)
+ pHdl->SetPos(pHdl->GetPos() + GetOffset());
return pHdl;
}
@@ -2667,7 +2545,7 @@ void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
SetRectsDirty();
}
-void SwDrawVirtObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+void SwDrawVirtObj::NbcShear(const Point& rRef, long nWink, double tn, bool bVShear)
{
rRefObj.NbcShear(rRef - GetOffset(), nWink, tn, bVShear);
SetRectsDirty();
@@ -2676,10 +2554,6 @@ void SwDrawVirtObj::NbcShear(const Point& rRef, long nWink, double tn, FASTBOOL
void SwDrawVirtObj::Move(const Size& rSiz)
{
SdrObject::Move( rSiz );
-// Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect();
-// rRefObj.Move( rSiz );
-// SetRectsDirty();
-// SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
}
void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
@@ -2712,7 +2586,7 @@ void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
SendUserCall(SDRUSERCALL_RESIZE, aBoundRect0);
}
-void SwDrawVirtObj::Shear(const Point& rRef, long nWink, double tn, FASTBOOL bVShear)
+void SwDrawVirtObj::Shear(const Point& rRef, long nWink, double tn, bool bVShear)
{
if(nWink)
{
@@ -2802,15 +2676,13 @@ void SwDrawVirtObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i)
SetRectsDirty();
}
-// #108784#
-FASTBOOL SwDrawVirtObj::HasTextEdit() const
+bool SwDrawVirtObj::HasTextEdit() const
{
return rRefObj.HasTextEdit();
}
-// OD 18.06.2003 #108784# - overloaded 'layer' methods for 'virtual' drawing
-// object to assure, that layer of 'virtual' object is the layer of the referenced
-// object.
+// overloaded 'layer' methods for 'virtual' drawing object to assure,
+// that layer of 'virtual' object is the layer of the referenced object.
SdrLayerID SwDrawVirtObj::GetLayer() const
{
return GetReferencedObj().GetLayer();
@@ -2842,3 +2714,4 @@ SdrObject* SwDrawVirtObj::getFullDragClone() const
// eof
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 492b44e5c89f..096386733626 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,9 +60,7 @@
using namespace ::com::sun::star;
-// --> OD 2004-11-22 #117958#
#include <svx/sdr/properties/defaultproperties.hxx>
-// <--
#include <basegfx/range/b2drange.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -83,9 +82,6 @@ TYPEINIT1( SwVirtFlyDrawObj, SdrVirtObj )
|*
|* SwFlyDrawObj::Ctor
|*
-|* Ersterstellung MA 18. Apr. 95
-|* Letzte Aenderung MA 28. May. 96
-|*
*************************************************************************/
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -130,14 +126,13 @@ namespace sdr
sdr::properties::BaseProperties* SwFlyDrawObj::CreateObjectSpecificProperties()
{
- // --> OD 2004-11-22 #117958# - create default properties
+ // create default properties
return new sdr::properties::DefaultProperties(*this);
- // <--
}
sdr::contact::ViewContact* SwFlyDrawObj::CreateObjectSpecificViewContact()
{
- // #i95264# needs an own VC since createViewIndependentPrimitive2DSequence()
+ // needs an own VC since createViewIndependentPrimitive2DSequence()
// is called when RecalcBoundRect() is used
return new sdr::contact::VCOfSwFlyDrawObj(*this);
}
@@ -154,24 +149,21 @@ SwFlyDrawObj::~SwFlyDrawObj()
|*
|* SwFlyDrawObj::Factory-Methoden
|*
-|* Ersterstellung MA 23. Feb. 95
-|* Letzte Aenderung MA 23. Feb. 95
-|*
*************************************************************************/
-sal_uInt32 __EXPORT SwFlyDrawObj::GetObjInventor() const
+sal_uInt32 SwFlyDrawObj::GetObjInventor() const
{
return SWGInventor;
}
-sal_uInt16 __EXPORT SwFlyDrawObj::GetObjIdentifier() const
+sal_uInt16 SwFlyDrawObj::GetObjIdentifier() const
{
return SwFlyDrawObjIdentifier;
}
-sal_uInt16 __EXPORT SwFlyDrawObj::GetObjVersion() const
+sal_uInt16 SwFlyDrawObj::GetObjVersion() const
{
return SwDrawFirst;
}
@@ -180,9 +172,6 @@ sal_uInt16 __EXPORT SwFlyDrawObj::GetObjVersion() const
|*
|* SwVirtFlyDrawObj::CToren, Dtor
|*
-|* Ersterstellung MA 08. Dec. 94
-|* Letzte Aenderung MA 28. May. 96
-|*
*************************************************************************/
//////////////////////////////////////////////////////////////////////////////////////
@@ -437,7 +426,7 @@ SwVirtFlyDrawObj::SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly) :
}
-__EXPORT SwVirtFlyDrawObj::~SwVirtFlyDrawObj()
+SwVirtFlyDrawObj::~SwVirtFlyDrawObj()
{
if ( GetPage() ) //Der SdrPage die Verantwortung entziehen.
GetPage()->RemoveObject( GetOrdNum() );
@@ -447,9 +436,6 @@ __EXPORT SwVirtFlyDrawObj::~SwVirtFlyDrawObj()
|*
|* SwVirtFlyDrawObj::GetFmt()
|*
-|* Ersterstellung MA 08. Dec. 94
-|* Letzte Aenderung MA 08. Dec. 94
-|*
*************************************************************************/
const SwFrmFmt *SwVirtFlyDrawObj::GetFmt() const
@@ -467,9 +453,6 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt()
|*
|* SwVirtFlyDrawObj::Paint()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 18. Dec. 95
-|*
*************************************************************************/
void SwVirtFlyDrawObj::wrap_DoPaintObject() const
@@ -515,12 +498,9 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
|*
|* SwVirtFlyDrawObj::TakeObjInfo()
|*
-|* Ersterstellung MA 03. May. 95
-|* Letzte Aenderung MA 03. May. 95
-|*
*************************************************************************/
-void __EXPORT SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
+void SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const
{
rInfo.bSelectAllowed = rInfo.bMoveAllowed =
rInfo.bResizeFreeAllowed = rInfo.bResizePropAllowed = sal_True;
@@ -537,9 +517,6 @@ void __EXPORT SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) con
|*
|* SwVirtFlyDrawObj::Groessenermittlung
|*
-|* Ersterstellung MA 12. Jan. 95
-|* Letzte Aenderung MA 10. Nov. 95
-|*
*************************************************************************/
void SwVirtFlyDrawObj::SetRect() const
@@ -551,38 +528,38 @@ void SwVirtFlyDrawObj::SetRect() const
}
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetCurrentBoundRect() const
+const Rectangle& SwVirtFlyDrawObj::GetCurrentBoundRect() const
{
SetRect();
return aOutRect;
}
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const
+const Rectangle& SwVirtFlyDrawObj::GetLastBoundRect() const
{
return GetCurrentBoundRect();
}
-void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect()
+void SwVirtFlyDrawObj::RecalcBoundRect()
{
SetRect();
}
-void __EXPORT SwVirtFlyDrawObj::RecalcSnapRect()
+void SwVirtFlyDrawObj::RecalcSnapRect()
{
SetRect();
}
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetSnapRect() const
+const Rectangle& SwVirtFlyDrawObj::GetSnapRect() const
{
SetRect();
return aOutRect;
}
-void __EXPORT SwVirtFlyDrawObj::SetSnapRect(const Rectangle& )
+void SwVirtFlyDrawObj::SetSnapRect(const Rectangle& )
{
Rectangle aTmp( GetLastBoundRect() );
SetRect();
@@ -593,20 +570,20 @@ void __EXPORT SwVirtFlyDrawObj::SetSnapRect(const Rectangle& )
}
-void __EXPORT SwVirtFlyDrawObj::NbcSetSnapRect(const Rectangle& )
+void SwVirtFlyDrawObj::NbcSetSnapRect(const Rectangle& )
{
SetRect();
}
-const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLogicRect() const
+const Rectangle& SwVirtFlyDrawObj::GetLogicRect() const
{
SetRect();
return aOutRect;
}
-void __EXPORT SwVirtFlyDrawObj::SetLogicRect(const Rectangle& )
+void SwVirtFlyDrawObj::SetLogicRect(const Rectangle& )
{
Rectangle aTmp( GetLastBoundRect() );
SetRect();
@@ -617,7 +594,7 @@ void __EXPORT SwVirtFlyDrawObj::SetLogicRect(const Rectangle& )
}
-void __EXPORT SwVirtFlyDrawObj::NbcSetLogicRect(const Rectangle& )
+void SwVirtFlyDrawObj::NbcSetLogicRect(const Rectangle& )
{
SetRect();
}
@@ -638,12 +615,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcSetLogicRect(const Rectangle& )
|*
|* SwVirtFlyDrawObj::Move() und Resize()
|*
-|* Ersterstellung MA 12. Jan. 95
-|* Letzte Aenderung MA 26. Jul. 96
-|*
*************************************************************************/
-void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
+void SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
{
MoveRect( aOutRect, rSiz );
const Point aOldPos( GetFlyFrm()->Frm().Pos() );
@@ -790,7 +764,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
}
-void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
+void SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const Fraction& xFact, const Fraction& yFact)
{
ResizeRect( aOutRect, rRef, xFact, yFact );
@@ -898,7 +872,7 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
}
-void __EXPORT SwVirtFlyDrawObj::Move(const Size& rSiz)
+void SwVirtFlyDrawObj::Move(const Size& rSiz)
{
NbcMove( rSiz );
SetChanged();
@@ -906,7 +880,7 @@ void __EXPORT SwVirtFlyDrawObj::Move(const Size& rSiz)
}
-void __EXPORT SwVirtFlyDrawObj::Resize(const Point& rRef,
+void SwVirtFlyDrawObj::Resize(const Point& rRef,
const Fraction& xFact, const Fraction& yFact)
{
NbcResize( rRef, xFact, yFact );
@@ -915,14 +889,14 @@ void __EXPORT SwVirtFlyDrawObj::Resize(const Point& rRef,
}
-Pointer __EXPORT SwVirtFlyDrawObj::GetMacroPointer(
+Pointer SwVirtFlyDrawObj::GetMacroPointer(
const SdrObjMacroHitRec& ) const
{
return Pointer( POINTER_REFHAND );
}
-FASTBOOL __EXPORT SwVirtFlyDrawObj::HasMacro() const
+bool SwVirtFlyDrawObj::HasMacro() const
{
const SwFmtURL &rURL = pFlyFrm->GetFmt()->GetURL();
return rURL.GetMap() || rURL.GetURL().Len();
@@ -978,3 +952,5 @@ SdrObject* SwVirtFlyDrawObj::getFullDragClone() const
}
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dobjfac.cxx b/sw/source/core/draw/dobjfac.cxx
index f50e3c156a49..cecf6ef03c14 100644
--- a/sw/source/core/draw/dobjfac.cxx
+++ b/sw/source/core/draw/dobjfac.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
-#include <errhdl.hxx>
#include <dpage.hxx>
#include <dobjfac.hxx>
#include <dflyobj.hxx>
@@ -47,7 +47,7 @@ IMPL_LINK( SwObjectFactory, MakeObject, SdrObjFactory*, pObjFactory )
if ( pObjFactory->nInventor == SWGInventor )
{
//Kein switch, derzeit gibt es nur einen.
- ASSERT( pObjFactory->nIdentifier == SwFlyDrawObjIdentifier,
+ OSL_ENSURE( pObjFactory->nIdentifier == SwFlyDrawObjIdentifier,
"Falscher Inventor oder identifier." );
pObjFactory->pNewObj = new SwFlyDrawObj();
}
@@ -55,3 +55,4 @@ IMPL_LINK( SwObjectFactory, MakeObject, SdrObjFactory*, pObjFactory )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 8c774bcdeba1..b39bd6521a76 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,6 @@
#include <fmturl.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
#include <shellres.hxx>
#include <viewimp.hxx>
#include <pagefrm.hxx>
@@ -50,9 +48,7 @@
#include <dpage.hxx>
#include <dcontact.hxx>
#include <dflyobj.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <usrfld.hxx>
#include <flyfrm.hxx>
#include <ndnotxt.hxx>
@@ -80,15 +76,12 @@ SwDPage::~SwDPage()
|*
|* SwDPage::ReplaceObject()
|*
-|* Ersterstellung MA 07. Aug. 95
-|* Letzte Aenderung MA 07. Aug. 95
-|*
*************************************************************************/
SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, sal_uLong nObjNum )
{
SdrObject *pOld = GetObj( nObjNum );
- ASSERT( pOld, "Oups, Object not replaced" );
+ OSL_ENSURE( pOld, "Oups, Object not replaced" );
SdrObjUserCall* pContact;
if ( 0 != ( pContact = GetUserCall(pOld) ) &&
RES_DRAWFRMFMT == ((SwContact*)pContact)->GetFmt()->Which())
@@ -100,9 +93,6 @@ SdrObject* SwDPage::ReplaceObject( SdrObject* pNewObj, sal_uLong nObjNum )
|*
|* SwDPage::GetGridFrameList()
|*
-|* Ersterstellung MA 04. Sep. 95
-|* Letzte Aenderung MA 15. Feb. 96
-|*
*************************************************************************/
void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
@@ -245,9 +235,7 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
return bWeiter;
}
-/* -----------------------------27.11.00 07:35--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XInterface > SwDPage::createUnoPage()
{
Reference < XInterface > xRet;
@@ -263,3 +251,4 @@ Reference< XInterface > SwDPage::createUnoPage()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index be94db96d47f..8c9ec52ab13f 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <tools/stream.hxx>
#include <unotools/pathoptions.hxx>
#include <sot/storage.hxx>
@@ -45,9 +44,7 @@
#include <rootfrm.hxx>
#include <drawdoc.hxx>
#include <dpage.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <shellio.hxx>
#include <hintids.hxx>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -130,7 +127,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
}
SetForbiddenCharsTable( pD->getForbiddenCharacterTable() );
- // #87795# Implementation for asian compression
+ // Implementation for asian compression
SetCharCompressType( static_cast<sal_uInt16>(pD->getCharacterCompressionType() ));
}
@@ -145,9 +142,7 @@ SwDrawDocument::~SwDrawDocument()
{
Broadcast(SdrHint(HINT_MODELCLEARED));
- // #116168#
ClearModel(sal_True);
- //Clear();
}
/*************************************************************************
@@ -160,7 +155,7 @@ SwDrawDocument::~SwDrawDocument()
\************************************************************************/
-SdrPage* SwDrawDocument::AllocPage(FASTBOOL bMasterPage)
+SdrPage* SwDrawDocument::AllocPage(bool bMasterPage)
{
SwDPage* pPage = new SwDPage(*this, 0 != bMasterPage);
pPage->SetName( String::CreateFromAscii(
@@ -215,7 +210,6 @@ SdrLayerID SwDrawDocument::GetControlExportLayerId( const SdrObject & ) const
return (SdrLayerID)pDoc->GetHeavenId();
}
-// --> OD 2006-03-01 #b6382898#
uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
{
@@ -230,11 +224,12 @@ uno::Reference< uno::XInterface > SwDrawDocument::createUnoModel()
}
catch( uno::RuntimeException& )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawDocument::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
}
return xModel;
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index f449dac13bc3..9e1fc781e400 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,10 +60,6 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
-// OD 18.06.2003 #108784#
-//#ifndef _SVDVMARK_HXX //autogen
-//#include <svx/svdvmark.hxx>
-//#endif
#include <vector>
// --> OD 2004-06-24 #i28701#
#include <sortedobjs.hxx>
@@ -110,9 +107,6 @@ const SwFrm *lcl_FindAnchor( const SdrObject *pObj, sal_Bool bAll )
|*
|* SwDrawView::Ctor
|*
-|* Ersterstellung OK 18.11.94
-|* Letzte Aenderung MA 22. Jul. 96
-|*
*************************************************************************/
@@ -233,9 +227,6 @@ SdrObject* SwDrawView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTo
|*
|* Gets called every time the handles need to be build
|*
-|* Ersterstellung AW 06. Sep. 99
-|* Letzte Aenderung AW 06. Sep. 99
-|*
*************************************************************************/
void SwDrawView::AddCustomHdl()
@@ -246,16 +237,14 @@ void SwDrawView::AddCustomHdl()
return;
SdrObject *pObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
- // --> OD 2006-11-06 #130889# - make code robust
-// const SwFmtAnchor &rAnchor = ::FindFrmFmt(pObj)->GetAnchor();
+ // make code robust
SwFrmFmt* pFrmFmt( ::FindFrmFmt( pObj ) );
if ( !pFrmFmt )
{
- ASSERT( false, "<SwDrawView::AddCustomHdl()> - missing frame format!" );
+ OSL_ENSURE( false, "<SwDrawView::AddCustomHdl()> - missing frame format!" );
return;
}
const SwFmtAnchor &rAnchor = pFrmFmt->GetAnchor();
- // <--
if (FLY_AS_CHAR == rAnchor.GetAnchorId())
return;
@@ -288,9 +277,6 @@ void SwDrawView::AddCustomHdl()
|*
|* SwDrawView::GetMaxToTopObj(), _GetMaxToTopObj()
|*
-|* Ersterstellung MA 13. Jan. 95
-|* Letzte Aenderung MA 18. Mar. 97
-|*
*************************************************************************/
@@ -344,9 +330,6 @@ SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
|*
|* SwDrawView::GetMaxToBtmObj()
|*
-|* Ersterstellung MA 13. Jan. 95
-|* Letzte Aenderung MA 05. Sep. 96
-|*
*************************************************************************/
@@ -373,9 +356,6 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const
|*
|* SwDrawView::ObjOrderChanged()
|*
-|* Ersterstellung MA 31. Jul. 95
-|* Letzte Aenderung MA 18. Mar. 97
-|*
*************************************************************************/
inline sal_Bool lcl_IsChild( SdrObject *pParent, SdrObject *pChild )
@@ -401,8 +381,6 @@ inline SdrObject *lcl_FindParent( SdrObject *pObj )
/** determine maximal order number for a 'child' object of given 'parent' object
- OD 2004-08-20 #110810#
-
@author OD
*/
sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
@@ -411,7 +389,7 @@ sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum();
const SdrPage* pDrawPage = _rParentObj.GetDrawObj()->GetPage();
- ASSERT( pDrawPage,
+ OSL_ENSURE( pDrawPage,
"<SwDrawView::_GetMaxChildOrdNum(..) - missing drawing page at parent object - crash!" );
sal_uInt32 nObjCount = pDrawPage->GetObjCount();
@@ -439,8 +417,6 @@ sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
/** method to move 'repeated' objects of the given moved object to the
according level
- OD 2004-08-23 #110810#
-
@author OD
*/
void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
@@ -450,7 +426,7 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
std::vector<SwAnchoredObject*> aAnchoredObjs;
{
const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
- ASSERT( pContact,
+ OSL_ENSURE( pContact,
"SwDrawView::_MoveRepeatedObjs(..) - missing contact object -> crash." );
pContact->GetAnchoredObjs( aAnchoredObjs );
}
@@ -493,7 +469,7 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
SdrObject* pChildObj = (*aObjIter);
{
const SwContact* pContact = ::GetUserCall( pChildObj );
- ASSERT( pContact,
+ OSL_ENSURE( pContact,
"SwDrawView::_MoveRepeatedObjs(..) - missing contact object -> crash." );
pContact->GetAnchoredObjs( aAnchoredObjs );
}
@@ -526,16 +502,15 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
}
}
-// --> OD 2004-08-20 #110810# - adjustment and re-factoring of method
+// --> adjustment and re-factoring of method
void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
sal_uLong nNewPos )
{
- // --> OD 2004-08-17 #110810# - nothing to do for group members
+ // nothing to do for group members
if ( pObj->GetUpGroup() )
{
return;
}
- // <--
// determine drawing page and assure that the order numbers are correct.
SdrPage* pDrawPage = GetModel()->GetPage( 0 );
@@ -760,9 +735,6 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
|*
|* SwDrawView::TakeDragLimit()
|*
-|* Ersterstellung AMA 26. Apr. 96
-|* Letzte Aenderung MA 03. May. 96
-|*
*************************************************************************/
@@ -788,9 +760,6 @@ sal_Bool SwDrawView::TakeDragLimit( SdrDragMode eMode,
|*
|* SwDrawView::CalcAnchor()
|*
-|* Ersterstellung MA 13. Jan. 95
-|* Letzte Aenderung MA 08. Nov. 96
-|*
*************************************************************************/
@@ -815,16 +784,14 @@ const SwFrm* SwDrawView::CalcAnchor()
else
{
SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj);
- // OD 17.06.2003 #108784# - determine correct anchor position for
- // 'virtual' drawing objects.
- // OD 2004-03-25 #i26791#
+ // determine correct anchor position for 'virtual' drawing objects.
+ // #i26791#
pAnch = pC->GetAnchorFrm( pObj );
if( !pAnch )
{
pC->ConnectToLayout();
- // OD 17.06.2003 #108784# - determine correct anchor position for
- // 'virtual' drawing objects.
- // OD 2004-03-25 #i26791#
+ // determine correct anchor position for 'virtual' drawing objects.
+ // #i26791#
pAnch = pC->GetAnchorFrm( pObj );
}
aMyRect = pObj->GetSnapRect();
@@ -852,7 +819,7 @@ const SwFrm* SwDrawView::CalcAnchor()
{
if ( pAnch->IsCntntFrm() )
{
- // OD 26.06.2003 #108784# - allow drawing objects in header/footer,
+ // allow drawing objects in header/footer,
// but exclude control objects.
bool bBodyOnly = CheckControlLayer( pObj );
pAnch = ::FindAnchor( (SwCntntFrm*)pAnch, aPt, bBodyOnly );
@@ -880,9 +847,6 @@ const SwFrm* SwDrawView::CalcAnchor()
|*
|* SwDrawView::ShowDragXor(), HideDragXor()
|*
-|* Ersterstellung MA 17. Jan. 95
-|* Letzte Aenderung MA 27. Jan. 95
-|*
*************************************************************************/
@@ -896,7 +860,6 @@ void SwDrawView::ShowDragAnchor()
{
CalcAnchor();
pHdl->SetPos(aAnchorPoint);
- //OLMRefreshAllIAOManagers();
}
}
@@ -904,9 +867,6 @@ void SwDrawView::ShowDragAnchor()
|*
|* SwDrawView::MarkListHasChanged()
|*
-|* Ersterstellung OM 02. Feb. 95
-|* Letzte Aenderung OM 07. Jul. 95
-|*
*************************************************************************/
@@ -951,7 +911,7 @@ void SwDrawView::ModelHasChanged()
void SwDrawView::MakeVisible( const Rectangle &rRect, Window & )
{
- ASSERT( rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
+ OSL_ENSURE( rImp.GetShell()->GetWin(), "MakeVisible, unknown Window");
rImp.GetShell()->MakeVisible( SwRect( rRect ) );
}
@@ -987,9 +947,8 @@ void SwDrawView::CheckPossibilities()
uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
if ( xObj.is() )
{
- // --> OD 2004-08-16 #110810# - improvement for
- // the future, when more than one Writer fly frame
- // can be selected.
+ // --> improvement for the future, when more
+ // than one Writer fly frame can be selected.
// TODO/LATER: retrieve Aspect - from where?!
bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? sal_True : sal_False;
@@ -1020,7 +979,7 @@ void SwDrawView::CheckPossibilities()
SwFrmFmt* pFrmFmt( ::FindFrmFmt( const_cast<SdrObject*>(pObj) ) );
if ( !pFrmFmt )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawView::CheckPossibilities()> - missing frame format" );
bProtect = sal_True;
}
@@ -1038,8 +997,6 @@ void SwDrawView::CheckPossibilities()
/** replace marked <SwDrawVirtObj>-objects by its reference object for delete
marked objects.
- OD 18.06.2003 #108784#
-
@author OD
*/
void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
@@ -1089,8 +1046,7 @@ void SwDrawView::DeleteMarked()
if ( pDoc->GetRootFrm() )
pDoc->GetRootFrm()->StartAllAction();
pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
- // OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
- // reference objects.
+ // replace marked <SwDrawVirtObj>-objects by its reference objects.
{
SdrPageView* pDrawPageView = rImp.GetPageView();
if ( pDrawPageView )
@@ -1112,15 +1068,7 @@ void SwDrawView::DeleteMarked()
pDoc->GetRootFrm()->EndAllAction();
}
-/********
-JP 02.10.98: sollte als Fix fuer 57153 gelten, hatte aber Nebenwirkungen,
- wie Bug 57475
-const SdrMarkList& SwDrawView::GetMarkedObjectList() const
-{
- FlushComeBackTimer();
- return FmFormView::GetMarkedObjectList();
-}
-*************/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index dad951e3848a..c047543e4bf9 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -188,10 +189,6 @@ sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
SwDoc* pDoc = rEditSh.GetDoc();
-// if( !pDoc->IsAutoFmtRedline() &&
-// pPam != &rCrsr ) // nur an akt. Position das Redline sichern
-// pDoc->SetRedlineMode_intern( eOld | REDLINE_IGNORE );
-
if( pDoc->IsAutoFmtRedline() )
{
if( nPos == pNd->GetTxt().Len() ) // am Ende erfolgt ein Insert
@@ -294,7 +291,6 @@ const String* SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos )
(*pIdx)--;
pTNd = pIdx->GetNode().GetTxtNode();
}
- //if( pTNd && NO_NUMBERING == pTNd->GetTxtColl()->GetOutlineLevel() )
if( pTNd && 0 == pTNd->GetAttrOutlineLevel() )//#outline level,zhaojianwei
pStr = &pTNd->GetTxt();
@@ -314,7 +310,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo
// Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort
// Kuerzel im Auto
SwTxtNode* pTxtNd = rCrsr.GetNode()->GetTxtNode();
- ASSERT( pTxtNd, "wo ist denn der TextNode?" );
+ OSL_ENSURE( pTxtNd, "wo ist denn der TextNode?" );
sal_Bool bRet = sal_False;
if( nEndPos == rSttPos )
@@ -358,7 +354,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo
if( ppPara )
{
- ASSERT( !pIdx, "wer hat seinen Index nicht geloescht?" );
+ OSL_ENSURE( !pIdx, "wer hat seinen Index nicht geloescht?" );
pIdx = new SwNodeIndex( rCrsr.GetPoint()->nNode, -1 );
}
@@ -530,3 +526,4 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 828adb14ff10..4012436444e8 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@
#include <pam.hxx>
#include <edimp.hxx>
#include <fesh.hxx>
-#include <swundo.hxx> // fuer die UndoIds
+#include <swundo.hxx> // for the UndoId's
#include <poolfmt.hxx>
#include <ndtxt.hxx>
#include <txtfrm.hxx>
@@ -99,23 +100,23 @@ const sal_Unicode cStarSymbolEmDash = 0x2014;
SvxSwAutoFmtFlags* SwEditShell::pAutoFmtFlags = 0;
-// Anzahl von Num-/Bullet-Absatzvorlagen. MAXLEVEL wird demnaechst auf
-// x erhoeht, die Anzahl Vorlagen aber nicht (Ueberbleibsel aus <= 4.0)
+// Number of num-/bullet-paragraph templates. MAXLEVEL will soon be raised
+// to x, but not the number of templates. (Artifact from <= 4.0)
const sal_uInt16 cnNumBullColls = 4;
class SwAutoFormat
{
SvxSwAutoFmtFlags aFlags;
- SwPaM aDelPam; // ein Pam der benutzt werden kann
- SwNodeIndex aNdIdx; // der Index auf den akt. TextNode
- SwNodeIndex aEndNdIdx; // Index auf das Ende vom Bereich
+ SwPaM aDelPam; // a Pam that can be used
+ SwNodeIndex aNdIdx; // the index on the current TextNode
+ SwNodeIndex aEndNdIdx; // index on the end of the area
SwEditShell* pEditShell;
SwDoc* pDoc;
- SwTxtNode* pAktTxtNd; // der akt. TextNode
- SwTxtFrm* pAktTxtFrm; // Frame vom akt. TextNode
+ SwTxtNode* pAktTxtNd; // the current TextNode
+ SwTxtFrm* pAktTxtFrm; // frame of the current TextNode
CharClass* pCharClass; // Character classification
- sal_uLong nEndNdIdx; // fuer die Prozent-Anzeige
+ sal_uLong nEndNdIdx; // for the percentage-display
LanguageType eCharClassLang;
sal_uInt16 nLastHeadLvl, nLastCalcHeadLvl;
@@ -178,7 +179,7 @@ class SwAutoFormat
String GoNextPara();
sal_Bool HasObjects( const SwNode& rNd );
- // TxtNode Methoden
+ // TxtNode methods
const SwTxtNode* GetNextNode() const;
sal_Bool IsEmptyLine( const SwTxtNode& rNd ) const
{ return 0 == rNd.GetTxt().Len() ||
@@ -201,7 +202,7 @@ class SwAutoFormat
sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos,
String* pPreFix = 0, String* pPostFix = 0,
String* pNumTypes = 0 ) const;
- // hole den FORMATIERTEN TextFrame
+ // get the FORMATED TextFrame
SwTxtFrm* GetFrm( const SwTxtNode& rTxtNd ) const;
void BuildIndent();
@@ -215,15 +216,15 @@ class SwAutoFormat
sal_Bool HasBreakAttr( const SwTxtNode& ) const;
void DeleteSel( SwPaM& rPam );
sal_Bool DeleteAktNxtPara( const String& rNxtPara );
- // loesche im Node Anfang oder/und Ende
+ // delete in the node start and/or end
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
+ // when using multiline paragraphs delete the "left" and/or
+ // "right" margins
void DelMoreLinesBlanks( sal_Bool bWithLineBreaks = sal_False );
- // loesche den vorherigen Absatz
+ // delete the previous paragraph
void DelPrevPara();
- // dann lasse doch mal das AutoCorrect auf den akt. TextNode los
+ // execute AutoCorrect on current TextNode
void AutoCorrect( xub_StrLen nSttPos = 0 );
sal_Bool CanJoin( const SwTxtNode* pTxtNd ) const
@@ -237,7 +238,7 @@ class SwAutoFormat
!HasBreakAttr( *pTxtNd );
}
- // ist ein Punkt am Ende ??
+ // is a dot at the end ??
sal_Bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const;
sal_Bool DoUnderline();
@@ -269,9 +270,9 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c )
SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const
{
- // besorge mal den Frame
+ // get the Frame
const SwCntntFrm *pFrm = rTxtNd.GetFrm();
- ASSERT( pFrm, "zum Autoformat muss das Layout vorhanden sein" );
+ OSL_ENSURE( pFrm, "zum Autoformat muss das Layout vorhanden sein" );
if( aFlags.bAFmtByInput && !pFrm->IsValid() )
{
SwRect aTmpFrm( pFrm->Frm() );
@@ -347,10 +348,10 @@ String SwAutoFormat::GoNextPara()
else
pNewNd = &aNdIdx.GetNode();
- // kein TextNode ->
- // TableNode : Tabelle ueberspringen
- // NoTxtNode : Nodes ueberspringen
- // EndNode : Ende erreicht, beenden
+ // not a TextNode ->
+ // TableNode : skip table
+ // NoTxtNode : skip nodes
+ // EndNode : at the end, terminate
if( pNewNd->IsEndNode() )
{
bEnde = sal_True;
@@ -377,8 +378,8 @@ String SwAutoFormat::GoNextPara()
sal_Bool SwAutoFormat::HasObjects( const SwNode& rNd )
{
- // haengt irgend etwas absatzgebundenes am Absatz?
- // z.B. Rahmen, DrawObjecte, ..
+ // Is there something bound to the paragraph in the paragraph
+ // like borders, DrawObjects, ...
sal_Bool bRet = sal_False;
const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts();
for( sal_uInt16 n = 0; n < rFmts.Count(); ++n )
@@ -431,12 +432,12 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
if( !nLen )
return sal_False;
- // -, +, * getrennt durch Blank ??
+ // -, +, * separated by blank ??
if( 2 < nLen && IsSpace( rTxt.GetChar( nBlnks + 1 ) ) )
{
if( StrChr( pBulletChar, rTxt.GetChar( nBlnks ) ) )
return sal_True;
- // sollte an der Position ein Symbolfont existieren ?
+ // Should there be a symbol font at the position?
SwTxtFrmInfo aFInfo( GetFrm( rNd ) );
if( aFInfo.IsBullet( nBlnks ))
return sal_True;
@@ -449,7 +450,7 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
{
- // suche im String mehr als 5 Blanks/Tabs
+ // Search more that 5 blanks/tabs in the string.
String sTmp( rNd.GetTxt() );
DelTrailingBlanks( DelLeadingBlanks( sTmp ));
const sal_Unicode* pTmp = sTmp.GetBuffer();
@@ -457,7 +458,7 @@ sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
{
if( IsSpace( *pTmp ) )
{
- if( IsSpace( *++pTmp )) // 2 Space nach einander
+ if( IsSpace( *++pTmp )) // 2 spaces after each other
{
const sal_Unicode* pStt = pTmp;
while( *pTmp && IsSpace( *++pTmp ))
@@ -506,7 +507,7 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl
break;
default:
if( pDigitLvl )
- // Teste auf 1.) / 1. / 1.1.1 / (1). / (1) / ....
+ // test 1.) / 1. / 1.1.1 / (1). / (1) / ....
*pDigitLvl = GetDigitLevel( rNd, n );
return nLvl;
}
@@ -568,12 +569,9 @@ sal_Bool SwAutoFormat::DoUnderline()
xub_StrLen nCnt = 0;
while( *pStr )
{
-//JP 29.03.96: Spaces unterbrechen die Umrandung!
-// if( !IsSpace( *pStr ) )
+ int eTmp = 0;
+ switch( *pStr )
{
- int eTmp = 0;
- switch( *pStr )
- {
case '-': eTmp = 1; break;
case '_': eTmp = 2; break;
case '=': eTmp = 3; break;
@@ -582,13 +580,13 @@ sal_Bool SwAutoFormat::DoUnderline()
case '#': eTmp = 6; break;
default:
return sal_False;
- }
- if( 0 == eState )
- eState = eTmp;
- else if( eState != eTmp )
- return sal_False;
- ++nCnt;
}
+ if( 0 == eState )
+ eState = eTmp;
+ else if( eState != eTmp )
+ return sal_False;
+ ++nCnt;
+
++pStr;
}
@@ -598,8 +596,6 @@ sal_Bool SwAutoFormat::DoUnderline()
DelEmptyLine( sal_False );
aDelPam.SetMark();
aDelPam.GetMark()->nContent = 0;
-//JP 19.03.96: kein Underline sondern eine Umrandung setzen!
-// pDoc->Insert( aDelPam, SvxUnderlineItem( eState ) );
SvxBorderLine aLine;
switch( eState )
@@ -860,7 +856,6 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
// roemische Zeichen sind "mdclxvi". Da man aber eher mal eine
// Numerierung mit c oder d anfangen will, werden diese erstmal
// zu chars und spaeter ggfs. zu romischen Zeichen!
-// if( strchr( "mdclxvi", cLow ))
#ifdef WITH_ALPHANUM_AS_NUMFMT
//detection of 'c' and 'd' a ROMAN numbering should not be done here
if( 256 > cLow &&( (eScan & (LOWER_ROMAN|UPPER_ROMAN))
@@ -1087,8 +1082,6 @@ sal_Bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
if( nBlnkPos && nBlnkPos-- < pTxtNd->GetTxt().Len() &&
( ' ' == pTxtNd->GetTxt().GetChar( nBlnkPos ) ))
-// JP 23.08.95: keine Tabs stehen lassen, diese in Blanks wandeln
-// ( ' ' == ( cCh = pTxtNd->GetTxt()[ nBlnkPos ] ) || '\t' == cCh ))
pPos->nContent--;
else
{
@@ -1097,8 +1090,6 @@ sal_Bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const
pTxtNd = pPos->nNode.GetNode().GetTxtNode();
if( nBlnkPos < pTxtNd->GetTxt().Len() &&
( ' ' == pTxtNd->GetTxt().GetChar( nBlnkPos )))
-// JP 23.08.95: keine Tabs stehen lassen, diese in Blanks wandeln
-// ( ' ' == ( cCh = pTxtNd->GetTxt()[ nBlnkPos ] ) || '\t' == cCh ))
pPos->nContent++;
else
return sal_False;
@@ -1473,19 +1464,17 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
IsBlanksInString( *pAktTxtNd ) ||
IsSentenceAtEnd( *pAktTxtNd );
sal_Bool bRTL = pEditShell->IsInRightToLeftText();
-// SetColl( RES_POOLCOLL_NUM_LEVEL1 + ( nLvl * 4 ) );
DeleteAktPara( sal_True, sal_True );
sal_Bool bChgBullet = sal_False, bChgEnum = sal_False;
xub_StrLen nAutoCorrPos = 0;
// falls die Numerierung gesetzt werden, die akt. besorgen
- // --> OD 2008-02-11 #newlistlevelattrs#
SwNumRule aRule( pDoc->GetUniqueNumRuleName(),
// --> OD 2008-06-06 #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
// <--
- // <--
+
const SwNumRule* pCur = 0;
if( aFlags.bSetNumRule && 0 != (pCur = pAktTxtNd->GetNumRule()) )
aRule = *pCur;
@@ -1494,7 +1483,6 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
const String& rStr = pAktTxtNd->GetTxt();
xub_StrLen nTxtStt = 0, nOrigTxtStt = 0;
const sal_Unicode* pFndBulletChr;
-// if( aFlags.bAFmtByInput ? aFlags.bSetNumRule : aFlags.bChgEnumNum &&
if( aFlags.bChgEnumNum &&
2 < rStr.Len() &&
0 != ( pFndBulletChr = StrChr( pBulletChar, rStr.GetChar( nTxtStt ) ))
@@ -1681,10 +1669,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
pAktTxtNd->SetAttrListLevel(nLvl);
pAktTxtNd->SetNumLSpace( sal_True );
- // --> OD 2008-03-17 #refactorlists#
// start new list
pDoc->SetNumRule( aDelPam, aRule, true );
- // <--
aDelPam.DeleteMark();
aDelPam.GetPoint()->nContent.Assign( pAktTxtNd, 0 );
@@ -2089,12 +2075,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
case '?':
if( aFlags.bCptlSttSntnc )
bFirstSent = sal_True;
-//alle Wortrenner loesen die Autokorrektur aus!
-// break;
default:
-//alle Wortrenner loesen die Autokorrektur aus!
-// case ' ':
-// case '\t':
if( !( rAppCC.isLetterNumeric( *pTxt, nPos )
|| '/' == cChar )) // '/' should not be a word seperator (e.g. '1/2' needs to be handled as one word for replacement)
{
@@ -2202,7 +2183,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
pCharClass( 0 ),
nRedlAutoFmtSeqId( 0 )
{
- ASSERT( (pSttNd && pEndNd) || (!pSttNd && !pEndNd),
+ OSL_ENSURE( (pSttNd && pEndNd) || (!pSttNd && !pEndNd),
"Kein Bereich angegeben" );
if( aFlags.bSetNumRule && !aFlags.bAFmtByInput )
@@ -2417,10 +2398,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( !bNxtEmpty && HasBreakAttr( *pNxtNd ) )
bNxtEmpty = sal_True;
- // fuer z.B. selbst definierte Einzuege oder
- // rechts/zentierte Ausrichtung
-// if( !nLevel && 0 != aFInfo.GetLineStart() )
-// nLevel = 1;
}
else
{
@@ -2459,13 +2436,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
// nicht, dann teste auf Ueberschrift
if( ':' == sEndClrStr.GetChar( nLen - 1 ) )
{
-//---------------------------------------------------------------------------
-// Wie ist denn nun die Bedingung fuer die Ueberschrift auf Ebene 3 ??
-// Zur Zeit: generell wenn am Ende ein ':' ist.
-//
-// if( bNxtEmpty || bNxtAlpha )
-// !IsEnumericChar( *pNxtNd ) )
-//---------------------------------------------------------------------------
{
BuildHeadLine( 2 );
eStat = READ_NEXT_PARA;
@@ -2478,16 +2448,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( bNxtEmpty || bNxtAlpha
|| ( pNxtNd && IsEnumericChar( *pNxtNd ))
-//---------------------------------------------------------------------------
-// ist zum Verwechseln mit neg. Einzug !!
- /*|| nLevel < nNxtLevel*/
-//---------------------------------------------------------------------------
-
)
{
- // wurde Level vom Text vorgegeben ?
-// if( USHRT_MAX != nDigitLvl )
-// nLevel = nDigitLvl;
// eine Ebene runter ?
if( nLevel >= MAXLEVEL )
@@ -2529,9 +2491,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
BuildEnum( nLevel, nDigitLvl );
eStat = READ_NEXT_PARA;
}
-//JP 25.03.96: Vorlagen fuer Einzug zulassen
-// else if( aFlags.bAFmtByInput )
-// eStat = READ_NEXT_PARA;
else if( bReplaceStyles )
eStat = nLevel ? TST_IDENT : TST_NEG_IDENT;
else
@@ -2793,3 +2752,4 @@ void SwEditShell::SetAutoFmtFlags(SvxSwAutoFmtFlags * pFlags)
pEditFlags->aByInputBulletFont = pFlags->aByInputBulletFont;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 386814eda008..bb5d650484b2 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,7 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
}
FOREACHPAM_START(this)
- // if ( PCURCRSR->HasMark() )
+
GetDoc()->ResetAttrs(*PCURCRSR, sal_True, pAttrs);
FOREACHPAM_END()
@@ -70,10 +71,6 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
void SwEditShell::GCAttr()
{
-//JP 04.02.97: wozu eine Action-Klammerung - ein Formatierung sollte nicht
-// ausgeloest werden, so dass es hier ueberfluessig ist.
-// Sonst Probleme im MouseBut.DownHdl - Bug 35562
-// StartAllAction();
FOREACHPAM_START(this)
if ( !PCURCRSR->HasMark() )
{
@@ -97,7 +94,6 @@ void SwEditShell::GCAttr()
aIdx <= rEnd );
}
FOREACHPAM_END()
-// EndAllAction();
}
// Setze das Attribut als neues default Attribut im Dokument.
@@ -111,17 +107,6 @@ void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint )
EndAllAction();
}
-/*
-
-void SwEditShell::SetDefault( const SfxItemSet& rSet )
-{
- // 7502: Action-Klammerung
- StartAllAction();
- GetDoc()->SetDefault( rSet );
- EndAllAction();
-}
-*/
-
// Erfrage das Default Attribut in diesem Dokument.
const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const
@@ -193,3 +178,4 @@ void SwEditShell::SetAttr( const SfxItemSet& rSet, sal_uInt16 nFlags )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 95b053aac213..e55b8c3f05ed 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,10 +71,8 @@ const sal_uInt16& getMaxLookup()
return nMaxLookup;
}
-// --> OD 2008-01-16 #newlistlevelattrs#
sal_Bool SwEditShell::GetCurAttr( SfxItemSet& rSet,
const bool bMergeIndentValuesOfNumRule ) const
-// <--
{
if( GetCrsrCnt() > getMaxLookup() )
{
@@ -142,11 +141,10 @@ sal_Bool SwEditShell::GetCurAttr( SfxItemSet& rSet,
xub_StrLen nStt = n == nSttNd ? nSttCnt : 0,
nEnd = n == nEndNd ? nEndCnt
: ((SwTxtNode*)pNd)->GetTxt().Len();
- // --> OD 2008-01-16 #newlistlevelattrs#
+
((SwTxtNode*)pNd)->GetAttr( *pSet, nStt, nEnd,
sal_False, sal_True,
bMergeIndentValuesOfNumRule );
- // <--
}
break;
case ND_GRFNODE:
@@ -257,21 +255,6 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn )
}
-
-/*sal_uInt16 SwEditShell::GetFtnCnt( sal_Bool bEndNotes = sal_False ) const
-{
- const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs();
- sal_uInt16 nCnt = 0;
- for ( sal_uInt16 i = 0; i < rIdxs.Count(); ++i )
- {
- const SwFmtFtn &rFtn = rIdxs[i]->GetFtn();
- if ( bEndNotes == rFtn.IsEndNote() )
- nCnt++;
- }
- return nCnt;
-} */
-
-
bool SwEditShell::HasFtns( bool bEndNotes ) const
{
const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs();
@@ -427,10 +410,9 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
{
bRet = sal_False;
- // --> OD 2008-03-19 #refactorlists#
if ( rTNd.IsInList() )
{
- ASSERT( rTNd.GetNumRule(),
+ OSL_ENSURE( 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<sal_uInt16>(rTNd.GetActualListLevel()) );
@@ -490,7 +472,7 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
sal_uInt16 SwEditShell::GetScriptType() const
{
sal_uInt16 nRet = 0;
- //if( pBreakIt->GetBreakIter().is() )
+
{
FOREACHPAM_START(this)
@@ -551,7 +533,7 @@ sal_uInt16 SwEditShell::GetScriptType() const
? pEnd->nContent.GetIndex()
: rTxt.Len();
- ASSERT( nEndPos <= rTxt.Len(), "Index outside the range - endless loop!" );
+ OSL_ENSURE( nEndPos <= rTxt.Len(), "Index outside the range - endless loop!" );
if( nEndPos > rTxt.Len() )
nEndPos = rTxt.Len();
@@ -625,7 +607,7 @@ 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" );
+ OSL_ENSURE( pTNd, "no textnode available" );
sal_uInt16 nScaleWidth;
if( pTNd )
@@ -644,3 +626,5 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const
nScaleWidth = 100; // default are no scaling -> 100%
return nScaleWidth;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 9125caadf0e9..e6b111dd38f1 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -280,9 +281,9 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
{
SwPaM* pCmp = (SwPaM*)pDestShell->GetCrsr(); // sicher den Pointer auf Cursor
do {
- ASSERT( pCmp->GetPoint()->nContent.GetIdxReg()
+ OSL_ENSURE( pCmp->GetPoint()->nContent.GetIdxReg()
== pCmp->GetCntntNode(), "Point im falschen Node" );
- ASSERT( pCmp->GetMark()->nContent.GetIdxReg()
+ OSL_ENSURE( pCmp->GetMark()->nContent.GetIdxReg()
== pCmp->GetCntntNode(sal_False), "Mark im falschen Node" );
sal_Bool bTst = *pCmp->GetPoint() == *pCmp->GetMark();
(void) bTst;
@@ -354,3 +355,4 @@ sal_Bool SwEditShell::DelFullPara()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 838abeb659bd..cf2af7012047 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,9 +39,7 @@
#include <ndtxt.hxx>
#include <paratr.hxx>
#include <fmtpdsc.hxx>
-// --> FME 2004-06-29 #114856# Formular view
-#include <viewopt.hxx>
-// <--
+#include <viewopt.hxx> // Formular view
#include <SwRewriter.hxx>
#include <numrule.hxx>
#include <swundo.hxx>
@@ -82,9 +81,8 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
FOREACHPAM_START(this)
if( !PCURCRSR->HasReadonlySel(
- // --> FME 2004-06-29 #114856# Formular view
+ // Formular view
GetViewOptions()->IsFormView() ) )
- // <--
GetDoc()->SetTxtFmtColl( *PCURCRSR, pLocal, true, bResetListAttrs );
FOREACHPAM_END()
@@ -102,7 +100,7 @@ SwTxtFmtColl* SwEditShell::MakeTxtFmtColl(const String& rFmtCollName,
pParent = &GetTxtFmtColl(0);
if ( (pColl=GetDoc()->MakeTxtFmtColl(rFmtCollName, pParent)) == 0 )
{
- ASSERT( sal_False, "MakeTxtFmtColl failed" )
+ OSL_ENSURE( sal_False, "MakeTxtFmtColl failed" );
}
return pColl;
@@ -160,3 +158,4 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, sal_Bool bReset)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index a0e99e7a57e5..8e20335fe89f 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -265,7 +266,7 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints)
FOREACHPAM_START(this) // fuer jeden PaM
bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
- ASSERT( bSuccess, "Doc->Insert(Field) failed");
+ OSL_ENSURE( bSuccess, "Doc->Insert(Field) failed");
(void) bSuccess;
FOREACHPAM_END() // fuer jeden PaM
@@ -299,7 +300,7 @@ SwField* SwEditShell::GetCurFld() const
SwTxtFld *pTxtFld = GetDocTxtFld( pCrsr->Start() );
SwField *pCurFld = NULL;
- /* #108536# Field was only recognized if no selection was
+ /* Field was only recognized if no selection was
present. Now it is recognized if either the cursor is in the
field or the selection spans exactly over the field. */
if( pTxtFld &&
@@ -318,7 +319,7 @@ SwField* SwEditShell::GetCurFld() const
}
- /* #108536# removed handling of multi-selections */
+ /* removed handling of multi-selections */
return pCurFld;
}
@@ -329,7 +330,6 @@ SwField* SwEditShell::GetCurFld() const
|* SwEditShell::UpdateFlds()
|*
|* Beschreibung Stehen die PaMs auf Feldern ?
-|* BP 12.05.92
|*
*************************************************************************/
SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld )
@@ -374,11 +374,6 @@ void SwEditShell::UpdateFlds( SwField &rFld )
SwTxtFld *pTxtFld;
SwFmtFld *pFmtFld;
-// if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
-// ( 0 != ( pTxtFld = GetDocTxtFld( pCrsr->Start() ) ) ||
-// 0 != ( pTxtFld = lcl_FindInputFld( GetDoc(), rFld ) ) ) &&
-// ( pFmtFld = (SwFmtFld*)&pTxtFld->GetFld())->GetFld()
-// ->GetTyp()->Which() == rFld.GetTyp()->Which() )
if ( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark())
{
pTxtFld = GetDocTxtFld(pCrsr->Start());
@@ -387,7 +382,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
pTxtFld = lcl_FindInputFld( GetDoc(), rFld);
if (pTxtFld != 0)
- GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, sal_True); // #111840#
+ GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, sal_True);
}
// bOkay (statt return wg. EndAllAction) wird sal_False,
@@ -434,7 +429,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
bOkay = sal_False;
bTblSelBreak = GetDoc()->UpdateFld(pTxtFld, rFld,
- pMsgHnt, sal_False); // #111840#
+ pMsgHnt, sal_False);
}
// Der Suchbereich wird um den gefundenen Bereich
// verkuerzt.
@@ -451,7 +446,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
EndAllAction();
}
-/*-----------------13.05.92 10:54-------------------
+/*--------------------------------------------------
Liefert den logischen fuer die Datenbank zurueck
--------------------------------------------------*/
@@ -551,16 +546,12 @@ sal_Bool SwEditShell::IsLabelDoc() const
{
return getIDocumentSettingAccess()->get(IDocumentSettingAccess::LABEL_DOCUMENT);
}
-/* -----------------------------21.12.99 12:53--------------------------------
- ---------------------------------------------------------------------------*/
void SwEditShell::ChangeAuthorityData(const SwAuthEntry* pNewData)
{
GetDoc()->ChangeAuthorityData(pNewData);
}
-/* -----------------------------03.08.2001 12:04------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
@@ -593,3 +584,5 @@ sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const
}
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx
index 6359c982507e..a506445ad10f 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_sw.hxx"
#include <editsh.hxx>
#include <dbfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -46,9 +45,6 @@
using namespace com::sun::star;
using ::rtl::OUString;
-/* -----------------28.11.2002 17:53-----------------
- *
- * --------------------------------------------------*/
sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
@@ -56,7 +52,7 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
if( !xMgr.is() )
return sal_False;
- uno::Reference<uno::XInterface> xInstance = xMgr->createInstance( OUString::createFromAscii( "com.sun.star.sdb.DatabaseContext" ));
+ uno::Reference<uno::XInterface> xInstance = xMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseContext")));
uno::Reference<container::XNameAccess> xDBContext(xInstance, uno::UNO_QUERY) ;
if(!xDBContext.is())
return sal_False;
@@ -99,3 +95,4 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index 225a1df48c74..e597cac10d02 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@
#include <fchrfmt.hxx>
#include <frmfmt.hxx>
#include <charfmt.hxx>
-#include "ndtxt.hxx" // Fuer GetXXXFmt
+#include "ndtxt.hxx" // for GetXXXFmt
#include "hints.hxx"
/*************************************
@@ -92,7 +93,7 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset)
{
const SwPosition* pPtPos = pPam->GetPoint();
const SwPosition* pMkPos = pPam->GetMark();
- if( pPtPos->nNode == pMkPos->nNode ) // im selben Node ?
+ if( pPtPos->nNode == pMkPos->nNode ) // in the same node?
{
nStt = pPtPos->nContent.GetIndex();
if( nStt < pMkPos->nContent.GetIndex() )
@@ -154,7 +155,7 @@ SwCharFmt* SwEditShell::MakeCharFmt( const String& rName,
}
//----------------------------------
-// inlines im Product
+// inlines in product
SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId )
@@ -163,7 +164,7 @@ SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId )
}
- // return das geforderte automatische Format - Basis-Klasse !
+ // return the demanded automatic format - base-class !
SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId )
{
return GetDoc()->GetFmtFromPool( nId );
@@ -195,3 +196,5 @@ SwTxtFmtColl* SwEditShell::FindTxtFmtCollByName( const String& rName ) const
{
return pDoc->FindTxtFmtCollByName( rName );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index d07b5b7a1e6c..94cc61bc0499 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
{
case TOX_HEADER_SECTION: break; // ignore
case TOX_CONTENT_SECTION:
- ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
pNew = new SwGlblDocContent( (SwTOXBaseSection*)pSect );
break;
@@ -408,3 +409,4 @@ SwGlblDocContent::SwGlblDocContent( const SwSection* pSect )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 56996558b306..a559edc840a0 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -181,7 +182,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
{
- ASSERT( pInsDoc, "kein Ins.Dokument" );
+ OSL_ENSURE( pInsDoc, "kein Ins.Dokument" );
SwNodes& rNds = pInsDoc->GetNodes();
@@ -282,7 +283,6 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
{
- sal_Bool bRet = sal_False;
GetCrsr(); // ggfs. alle Cursor erzeugen lassen
if( IsSelOnePara() )
{
@@ -304,7 +304,6 @@ sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
RTL_CONSTASCII_STRINGPARAM( "\015\012" ));
#endif
}
- bRet = sal_True;
}
else if( IsSelection() )
{
@@ -371,3 +370,4 @@ sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 21d550ebd6f1..769ef029e5b4 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
#include <hintids.hxx>
-#include <tools/list.hxx>
#include <tools/urlobj.hxx>
#include <vcl/cmdevt.hxx>
#include <unotools/charclass.hxx>
@@ -86,7 +86,7 @@ void SwEditShell::Insert( sal_Unicode c, sal_Bool bOnlyCurrCrsr )
FOREACHPAM_START(this)
const bool bSuccess = GetDoc()->InsertString(*PCURCRSR, c);
- ASSERT( bSuccess, "Doc->Insert() failed." );
+ OSL_ENSURE( bSuccess, "Doc->Insert() failed." );
(void) bSuccess;
SaveTblBoxCntnt( PCURCRSR->GetPoint() );
@@ -120,7 +120,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
//OPT: GetSystemCharSet
const bool bSuccess =
GetDoc()->InsertString(*_pStartCrsr, rStr, nInsertFlags);
- ASSERT( bSuccess, "Doc->Insert() failed." );
+ OSL_ENSURE( bSuccess, "Doc->Insert() failed." );
(void) bSuccess;
SaveTblBoxCntnt( _pStartCrsr->GetPoint() );
@@ -188,7 +188,7 @@ void SwEditShell::Overwrite(const String &rStr)
FOREACHPAM_START(this)
if( !GetDoc()->Overwrite(*PCURCRSR, rStr ) )
{
- ASSERT( sal_False, "Doc->Overwrite(Str) failed." )
+ OSL_ENSURE( sal_False, "Doc->Overwrite(Str) failed." );
}
SaveTblBoxCntnt( PCURCRSR->GetPoint() );
FOREACHPAM_END()
@@ -222,9 +222,6 @@ long SwEditShell::SplitNode( sal_Bool bAutoFormat, sal_Bool bCheckTableStart )
return(1L);
}
-/*-- 11.05.2004 09:41:20---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwEditShell::AppendTxtNode()
{
sal_Bool bRet = sal_False;
@@ -266,24 +263,22 @@ SwGrfNode * SwEditShell::_GetGrfNode() const
* oder auf die gleiche Graphic zeigt)
******************************************************************************/
-// --> OD 2005-02-09 #119353# - robust
const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const
{
SwGrfNode* pGrfNode = _GetGrfNode();
- // --> OD 2005-02-09 #119353# - robust
const Graphic* pGrf( 0L );
if ( pGrfNode )
{
pGrf = &(pGrfNode->GetGrf());
- // --> OD 2007-03-01 #i73788#
+ // --> #i73788#
// no load of linked graphic, if its not needed now (bWait = sal_False).
if ( bWait )
{
if( pGrf->IsSwapOut() ||
( pGrfNode->IsLinkedFile() && GRAPHIC_DEFAULT == pGrf->GetType() ) )
{
-#ifdef DBG_UTIL
- ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" );
#else
pGrfNode->SwapIn( bWait );
#endif
@@ -293,8 +288,8 @@ const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const
{
if ( pGrf->IsSwapOut() && !pGrfNode->IsLinkedFile() )
{
-#ifdef DBG_UTIL
- ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" );
#else
pGrfNode->SwapIn( bWait );
#endif
@@ -316,13 +311,10 @@ sal_Bool SwEditShell::IsGrfSwapOut( sal_Bool bOnlyLinked ) const
: pGrfNode->GetGrfObj().IsSwappedOut());
}
-// --> OD 2005-02-09 #119353# - robust
const GraphicObject* SwEditShell::GetGraphicObj() const
{
SwGrfNode* pGrfNode = _GetGrfNode();
- // --> OD 2005-02-09 #119353# - robust
return pGrfNode ? &(pGrfNode->GetGrfObj()) : 0L;
- // <--
}
sal_uInt16 SwEditShell::GetGraphicType() const
@@ -375,7 +367,7 @@ void SwEditShell::ReRead( const String& rGrfName, const String& rFltName,
void SwEditShell::GetGrfNms( String* pGrfName, String* pFltName,
const SwFlyFrmFmt* pFmt ) const
{
- ASSERT( pGrfName || pFltName, "was wird denn nun erfragt?" );
+ OSL_ENSURE( pGrfName || pFltName, "was wird denn nun erfragt?" );
if( pFmt )
GetDoc()->GetGrfNms( *pFmt, pGrfName, pFltName );
else
@@ -387,30 +379,6 @@ void SwEditShell::GetGrfNms( String* pGrfName, String* pFltName,
}
-// alternativen Text abfragen/setzen
-//const String& SwEditShell::GetAlternateText() const
-//{
-// SwPaM* pCrsr = GetCrsr();
-// const SwNoTxtNode* pNd;
-// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) )
-// return pNd->GetAlternateText();
-
-// return aEmptyStr;
-//}
-
-
-//void SwEditShell::SetAlternateText( const String& rTxt )
-//{
-// SwPaM* pCrsr = GetCrsr();
-// SwNoTxtNode* pNd;
-// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) )
-// {
-// pNd->SetAlternateText( rTxt, sal_True );
-// GetDoc()->SetModified();
-// }
-//}
-
-
const PolyPolygon *SwEditShell::GetGraphicPolygon() const
{
SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
@@ -434,7 +402,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
void SwEditShell::ClearAutomaticContour()
{
SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
- ASSERT( pNd, "is no NoTxtNode!" );
+ OSL_ENSURE( pNd, "is no NoTxtNode!" );
if( pNd->HasAutomaticContour() )
{
StartAllAction();
@@ -458,14 +426,14 @@ void SwEditShell::ClearAutomaticContour()
svt::EmbeddedObjectRef& SwEditShell::GetOLEObject() const
{
- ASSERT( CNT_OLE == GetCntType(), "GetOLEObj: kein OLENode." );
- ASSERT( !GetCrsr()->HasMark() ||
+ OSL_ENSURE( CNT_OLE == GetCntType(), "GetOLEObj: kein OLENode." );
+ OSL_ENSURE( !GetCrsr()->HasMark() ||
(GetCrsr()->HasMark() &&
GetCrsr()->GetPoint()->nNode == GetCrsr()->GetMark()->nNode),
"GetOLEObj: kein OLENode." );
SwOLENode *pOLENode = GetCrsr()->GetNode()->GetOLENode();
- ASSERT( pOLENode, "GetOLEObj: kein OLENode." );
+ OSL_ENSURE( pOLENode, "GetOLEObj: kein OLENode." );
SwOLEObj& rOObj = pOLENode->GetOLEObj();
return rOObj.GetObject();
}
@@ -493,7 +461,7 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const
void SwEditShell::SetChartName( const String &rName )
{
SwOLENode *pONd = GetCrsr()->GetNode()->GetOLENode();
- ASSERT( pONd, "ChartNode not found" );
+ OSL_ENSURE( pONd, "ChartNode not found" );
pONd->SetChartTblName( rName );
}
@@ -614,19 +582,13 @@ void SwEditShell::ReplaceDropTxt( const String &rStr )
SwPaM aPam( rNd, rStr.Len(), rNd, 0 );
if( !GetDoc()->Overwrite( aPam, rStr ) )
{
- ASSERT( sal_False, "Doc->Overwrite(Str) failed." );
+ OSL_ENSURE( sal_False, "Doc->Overwrite(Str) failed." );
}
EndAllAction();
}
}
-/******************************************************************************
- * Methode :
- * Beschreibung:
- * Erstellt : OK 25.04.94 13:45
- * Aenderung :
- ******************************************************************************/
String SwEditShell::Calculate()
{
@@ -725,8 +687,8 @@ Graphic SwEditShell::GetIMapGraphic() const
if( rGrf.IsSwapOut() || ( ((SwGrfNode*)pNd)->IsLinkedFile() &&
GRAPHIC_DEFAULT == rGrf.GetType() ) )
{
-#ifdef DBG_UTIL
- ASSERT( ((SwGrfNode*)pNd)->SwapIn( sal_True ) || !sal_True, "Grafik konnte nicht geladen werden" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( ((SwGrfNode*)pNd)->SwapIn( TRUE ) || !TRUE, "Grafik konnte nicht geladen werden" );
#else
((SwGrfNode*)pNd)->SwapIn( sal_True );
#endif
@@ -987,16 +949,16 @@ sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos )
SwFrm* pFrm = pCntFrm;
while( pFrm && !(pFrm->GetType() & nTyp) )
pFrm = pFrm->GetUpper();
- ASSERT( pFrm, "Wo bin ich?" );
+ OSL_ENSURE( pFrm, "Wo bin ich?" );
if( pFrm && ( pFrm->GetType() & FRM_FOOTER ) )
pTmp = pCNd->FindFooterStartNode();
else
pTmp = pCNd->FindHeaderStartNode();
}
- ASSERT( pTmp, "Missing StartNode" );
+ OSL_ENSURE( pTmp, "Missing StartNode" );
aStart = *pTmp;
}
- ASSERT( pCNd && pCntFrm, "Missing Layout-Information" );
+ OSL_ENSURE( pCNd && pCntFrm, "Missing Layout-Information" );
}
while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection(
@@ -1196,3 +1158,4 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const
FOREACHPAM_END()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index dfe4e13a2b08..b18c7daef546 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,8 +73,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
-#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-
extern void repaintTextFrames( SwModify& rModify );
/*************************************************************************
@@ -153,8 +152,8 @@ public:
bool SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck);
void ToSentenceStart();
- const ::svx::SpellPortions GetLastPortions(){ return aLastPortions;}
- SpellContentPositions GetLastPositions() {return aLastPositions;}
+ const ::svx::SpellPortions GetLastPortions() const { return aLastPortions;}
+ SpellContentPositions GetLastPositions() const {return aLastPositions;}
void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; }
};
@@ -216,7 +215,7 @@ const SwTxtNode *pLinguNode;
SwLinguIter::SwLinguIter()
: pSh( 0 ), pStart( 0 ), pEnd( 0 ), pCurr( 0 ), pCurrX( 0 )
{
- // @@@ es fehlt: Sicherstellen der Reentrance, ASSERTs etc.
+ // @@@ es fehlt: Sicherstellen der Reentrance, OSL_ENSURE( etc.
}
/*************************************************************************
@@ -238,12 +237,10 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
SET_CURR_SHELL( pSh );
- ASSERT( !pEnd, "LinguStart ohne End?");
+ OSL_ENSURE( !pEnd, "LinguStart ohne End?");
SwPaM *pCrsr = pSh->GetCrsr();
- // pStk->SetCurCrsr();
-// if( pCrsr->HasMark() || pCrsr != pCrsr->GetNext() )
if( pShell->HasSelection() || pCrsr != pCrsr->GetNext() )
{
bSetCurr = 0 != GetCurr();
@@ -299,7 +296,7 @@ void SwLinguIter::_End(bool bRestoreSelection)
if( !pSh )
return;
- ASSERT( pEnd, "SwEditShell::SpellEnd() ohne Start?");
+ OSL_ENSURE( pEnd, "SwEditShell::SpellEnd() ohne Start?");
if(bRestoreSelection)
{
while( nCrsrCnt-- )
@@ -314,10 +311,6 @@ void SwLinguIter::_End(bool bRestoreSelection)
DELETEZ(pCurrX);
pSh = 0;
-
-#ifdef LINGU_STATISTIK
- aSwLinguStat.Flush();
-#endif
}
/*************************************************************************
@@ -358,9 +351,7 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
if( !pMySh )
return aSpellRet;
-// const SwPosition *pEnd = GetEnd();
-
- ASSERT( GetEnd(), "SwEditShell::SpellContinue() ohne Start?");
+ OSL_ENSURE( GetEnd(), "SwEditShell::SpellContinue() ohne Start?");
uno::Reference< uno::XInterface > xSpellRet;
sal_Bool bGoOn = sal_True;
@@ -434,9 +425,7 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
if( !pMySh )
return aConvRet;
-// const SwPosition *pEnd = GetEnd();
-
- ASSERT( GetEnd(), "SwConvIter::Continue() ohne Start?");
+ OSL_ENSURE( GetEnd(), "SwConvIter::Continue() ohne Start?");
rtl::OUString aConvText;
sal_Bool bGoOn = sal_True;
@@ -494,7 +483,7 @@ sal_Bool SwHyphIter::IsAuto()
{
uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() );
return xProp.is() ? *(sal_Bool*)xProp->getPropertyValue(
- C2U(UPN_IS_HYPH_AUTO) ).getValue()
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UPN_IS_HYPH_AUTO)) ).getValue()
: sal_False;
}
@@ -523,7 +512,7 @@ void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositio
// robust
if( GetSh() || GetEnd() )
{
- ASSERT( !GetSh(), "+SwEditShell::HyphStart: missing HyphEnd()" );
+ OSL_ENSURE( !GetSh(), "+SwEditShell::HyphStart: missing HyphEnd()" );
return;
}
@@ -562,12 +551,11 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
const sal_Bool bAuto = IsAuto();
uno::Reference< XHyphenatedWord > xHyphWord;
- sal_uInt16 nRet;
sal_Bool bGoOn = sal_False;
do {
SwPaM *pCrsr;
do {
- ASSERT( GetEnd(), "SwEditShell::SpellContinue() ohne Start?" );
+ OSL_ENSURE( GetEnd(), "SwEditShell::SpellContinue() ohne Start?" );
pCrsr = pMySh->GetCrsr();
if ( !pCrsr->HasMark() )
pCrsr->SetMark();
@@ -577,10 +565,7 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
pCrsr->SetMark();
}
- // geraten BUG:
- if ( *pCrsr->End() > *GetEnd() )
- nRet = 0;
- else
+ if ( *pCrsr->End() <= *GetEnd() )
{
*pCrsr->GetMark() = *GetEnd();
@@ -653,7 +638,7 @@ void SwHyphIter::DelSoftHyph( SwPaM &rPam )
void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos )
{
SwEditShell *pMySh = GetSh();
- ASSERT( pMySh, "+SwEditShell::InsertSoftHyph: missing HyphStart()");
+ OSL_ENSURE( pMySh, "+SwEditShell::InsertSoftHyph: missing HyphStart()");
if( !pMySh )
return;
@@ -666,9 +651,9 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos )
if( pSttPos->nNode != pEndPos->nNode || !nLastHyphLen )
{
- ASSERT( pSttPos->nNode == pEndPos->nNode,
+ OSL_ENSURE( pSttPos->nNode == pEndPos->nNode,
"+SwEditShell::InsertSoftHyph: node warp during hyphenation" );
- ASSERT(nLastHyphLen, "+SwEditShell::InsertSoftHyph: missing HyphContinue()");
+ OSL_ENSURE(nLastHyphLen, "+SwEditShell::InsertSoftHyph: missing HyphContinue()");
*pSttPos = *pEndPos;
return;
}
@@ -753,14 +738,14 @@ void SwEditShell::SpellStart(
// do not spell if interactive spelling is active elsewhere
if (!pConvArgs && !pSpellIter)
{
- ASSERT( !pSpellIter, "wer ist da schon am spellen?" );
+ OSL_ENSURE( !pSpellIter, "wer ist da schon am spellen?" );
pSpellIter = new SwSpellIter;
pLinguIter = pSpellIter;
}
// do not do text conversion if it is active elsewhere
if (pConvArgs && !pConvIter)
{
- ASSERT( !pConvIter, "text conversion already active!" );
+ OSL_ENSURE( !pConvIter, "text conversion already active!" );
pConvIter = new SwConvIter( *pConvArgs );
pLinguIter = pConvIter;
}
@@ -791,13 +776,13 @@ void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection
{
if (!pConvArgs && pSpellIter && pSpellIter->GetSh() == this)
{
- ASSERT( pSpellIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pSpellIter, "wo ist mein Iterator?" );
pSpellIter->_End(bRestoreSelection);
delete pSpellIter, pSpellIter = 0;
}
if (pConvArgs && pConvIter && pConvIter->GetSh() == this)
{
- ASSERT( pConvIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pConvIter, "wo ist mein Iterator?" );
pConvIter->_End();
delete pConvIter, pConvIter = 0;
}
@@ -828,8 +813,8 @@ uno::Any SwEditShell::SpellContinue(
::StartProgress( STR_STATSTR_SPELL, 0, nEndPage, GetDoc()->GetDocShell() );
}
- ASSERT( pConvArgs || pSpellIter, "SpellIter missing" );
- ASSERT( !pConvArgs || pConvIter, "ConvIter missing" );
+ OSL_ENSURE( pConvArgs || pSpellIter, "SpellIter missing" );
+ OSL_ENSURE( !pConvArgs || pConvIter, "ConvIter missing" );
//JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen
// KEIN StartAction, da damit auch die Paints abgeschaltet
// werden !!!!!
@@ -894,7 +879,7 @@ void SwEditShell::HyphStart( SwDocPositions eStart, SwDocPositions eEnd )
// do not hyphenate if interactive hyphenationg is active elsewhere
if (!pHyphIter)
{
- ASSERT( !pHyphIter, "wer ist da schon am hyphinieren?" );
+ OSL_ENSURE( !pHyphIter, "wer ist da schon am hyphinieren?" );
pHyphIter = new SwHyphIter;
pHyphIter->Start( this, eStart, eEnd );
}
@@ -912,7 +897,7 @@ void SwEditShell::HyphEnd()
{
if (pHyphIter->GetSh() == this)
{
- ASSERT( pHyphIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
pHyphIter->End();
delete pHyphIter, pHyphIter = 0;
}
@@ -946,7 +931,7 @@ uno::Reference< uno::XInterface >
*pPageSt = 1; // das StatLineStartPercent
}
- ASSERT( pHyphIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
//JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen
// KEIN StartAction, da damit auch die Paints abgeschaltet
// werden !!!!!
@@ -972,7 +957,7 @@ uno::Reference< uno::XInterface >
void SwEditShell::InsertSoftHyph( const xub_StrLen nHyphPos )
{
- ASSERT( pHyphIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
pHyphIter->InsertSoftHyph( nHyphPos );
}
@@ -985,7 +970,7 @@ void SwEditShell::InsertSoftHyph( const xub_StrLen nHyphPos )
void SwEditShell::HyphIgnore()
{
- ASSERT( pHyphIter, "wo ist mein Iterator?" );
+ OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
//JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen
// KEIN StartAction, da damit auch die Paints abgeschaltet
// werden !!!!!
@@ -1049,7 +1034,7 @@ uno::Reference< XSpellAlternatives >
// implementation here by providing an additional parameter.
Sequence< PropertyValue > aPropVals(1);
PropertyValue &rVal = aPropVals.getArray()[0];
- rVal.Name = C2U( UPN_MAX_NUMBER_OF_SUGGESTIONS );
+ rVal.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UPN_MAX_NUMBER_OF_SUGGESTIONS ));
rVal.Value <<= (sal_Int16) 7;
xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals );
@@ -1088,7 +1073,7 @@ uno::Reference< XSpellAlternatives >
//no determine the rectangle in the current line
xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
//take one less than the line end - otherwise the next line would be calculated
- xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd - 1: (nBegin + nLen - nLeft - nRight);
+ xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd: (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
@@ -1100,7 +1085,7 @@ uno::Reference< XSpellAlternatives >
SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
- rContent = nWordEnd;
+ rContent = nWordEnd - 1;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
@@ -1166,12 +1151,6 @@ bool SwEditShell::GetGrammarCorrection(
sal_Int32 nEndOfSentence = ModelToViewHelper::ConvertToViewPosition( pConversionMap, pWrong->getSentenceEnd( nBegin ) );
if( nEndOfSentence == STRING_LEN )
{
-/* if( nStartOfSentence == 0 )
- {
- nStartOfSentence = -1;
- nEndOfSentence = -1;
- }
- else */
nEndOfSentence = aExpandText.getLength();
}
@@ -1206,10 +1185,6 @@ bool SwEditShell::GetGrammarCorrection(
xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
Pop(sal_False);
-#if OSL_DEBUG_LEVEL > 1
-// pNode->GetGrammarCheck()->Invalidate( 0, STRING_LEN );
-// pNode->SetGrammarCheckDirty( true );
-#endif
// make sure the selection build later from the
// data below does not include footnotes and other
// "in word" character to the left and right in order
@@ -1232,7 +1207,7 @@ bool SwEditShell::GetGrammarCorrection(
//no determine the rectangle in the current line
xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
//take one less than the line end - otherwise the next line would be calculated
- xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd - 1: (nBegin + nLen - nLeft - nRight);
+ xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd: (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
SwIndex& rContent = GetCrsr()->GetPoint()->nContent;
@@ -1244,7 +1219,7 @@ bool SwEditShell::GetGrammarCorrection(
SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
- rContent = nWordEnd;
+ rContent = nWordEnd - 1;
SwRect aEndRect;
pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState );
rSelectRect = aStartRect.Union( aEndRect );
@@ -1256,12 +1231,9 @@ bool SwEditShell::GetGrammarCorrection(
return bRes;
}
-/*-- 18.09.2003 15:08:18---------------------------------------------------
-
- -----------------------------------------------------------------------*/
bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
{
- ASSERT( pSpellIter, "SpellIter missing" );
+ OSL_ENSURE( pSpellIter, "SpellIter missing" );
if(!pSpellIter)
return false;
bool bRet = pSpellIter->SpellSentence(rPortions, bIsGrammarCheck);
@@ -1277,14 +1249,12 @@ bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
-----------------------------------------------------------------------*/
void SwEditShell::PutSpellingToSentenceStart()
{
- ASSERT( pSpellIter, "SpellIter missing" );
+ OSL_ENSURE( pSpellIter, "SpellIter missing" );
if(!pSpellIter)
return;
pSpellIter->ToSentenceStart();
}
-/*-- 02.02.2005 14:34:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_uInt32 lcl_CountRedlines(
const ::svx::SpellPortions& rLastPortions)
{
@@ -1297,9 +1267,6 @@ sal_uInt32 lcl_CountRedlines(
}
return nRet;
}
-/*-- 18.09.2003 15:08:20---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
{
@@ -1318,15 +1285,15 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
// Note: rNewPortions.size() == 0 is valid and happens when the whole
// sentence got removed in the dialog
- ASSERT( pSpellIter, "SpellIter missing" );
+ OSL_ENSURE( pSpellIter, "SpellIter missing" );
if(pSpellIter &&
pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed
{
const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
const SpellContentPositions rLastPositions = pSpellIter->GetLastPositions();
- ASSERT(rLastPortions.size() > 0 &&
+ OSL_ENSURE(rLastPortions.size() > 0 &&
rLastPortions.size() == rLastPositions.size(),
- "last vectors of spelling results are not set or not equal")
+ "last vectors of spelling results are not set or not equal");
// iterate over the new portions, beginning at the end to take advantage of the previously
// saved content positions
@@ -1400,7 +1367,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
{
//add the 'ignore' markup to the TextNode's grammar ignore markup list
IgnoreGrammarErrorAt( *pCrsr );
- DBG_ERROR("TODO: add ignore mark to text node");
+ OSL_FAIL("TODO: add ignore mark to text node");
}
if(aCurrentNewPortion == rNewPortions.begin())
break;
@@ -1521,9 +1488,7 @@ void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShell* pSh
}
}
}
-/*-- 02.02.2005 11:43:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SpellContentPosition lcl_FindNextDeletedRedline(
const SpellContentPositions& rDeletedRedlines,
xub_StrLen nSearchFrom )
@@ -1543,9 +1508,7 @@ SpellContentPosition lcl_FindNextDeletedRedline(
}
return aRet;
}
-/*-- 18.09.2003 15:08:20---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck)
{
bool bRet = false;
@@ -1556,7 +1519,7 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
if( !pMySh )
return false;
- ASSERT( GetEnd(), "SwEditShell::SpellSentence() ohne Start?");
+ OSL_ENSURE( GetEnd(), "SwEditShell::SpellSentence() ohne Start?");
uno::Reference< XSpellAlternatives > xSpellRet;
linguistic2::ProofreadingResult aGrammarResult;
@@ -1748,16 +1711,11 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar
return bRet;
}
-/*-- 08.09.2008 09:37:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwSpellIter::ToSentenceStart()
{
bBackToStartOfSentence = true;
}
-/*-- 08.10.2003 08:49:56---------------------------------------------------
- -----------------------------------------------------------------------*/
LanguageType lcl_GetLanguage(SwEditShell& rSh)
{
sal_uInt16 nScriptType = rSh.GetScriptType();
@@ -1800,7 +1758,7 @@ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
const beans::PropertyValue* pProperties = pGrammarResult->aProperties.getConstArray();
for( sal_Int32 nProp = 0; nProp < pGrammarResult->aProperties.getLength(); ++nProp )
{
- if( pProperties->Name.equalsAscii("DialogTitle") )
+ if( pProperties->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DialogTitle") ) )
{
pProperties->Value >>= aPortion.sDialogTitle;
break;
@@ -1822,9 +1780,7 @@ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
aLastPositions.push_back(aPosition);
}
}
-/*-- 19.09.2003 13:05:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
linguistic2::ProofreadingResult* pGrammarResult,
const SpellContentPositions& rDeletedRedlines)
@@ -1943,9 +1899,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt,
}
}
}
-/*-- 07.08.2008 15:01:25---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition )
{
SwTxtNode *pNode;
@@ -1974,3 +1928,4 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index d740090d4694..f4b54f774903 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,7 +114,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 )
SwPaM& SwPamRanges::SetPam( sal_uInt16 nArrPos, SwPaM& rPam )
{
- ASSERT_ID( nArrPos < Count(), ERR_VAR_IDX );
+ OSL_ASSERT( nArrPos < Count() );
const SwPamRange& rTmp = *(GetData() + nArrPos );
rPam.GetPoint()->nNode = rTmp.nStart;
rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 );
@@ -181,7 +182,6 @@ sal_Bool SwEditShell::HasNumber() const
{
bResult = pTxtNd->HasNumber();
- // --> OD 2005-10-26 #b6340308#
// special case: outline numbered, not counted paragraph
if ( bResult &&
pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() &&
@@ -189,7 +189,6 @@ sal_Bool SwEditShell::HasNumber() const
{
bResult = sal_False;
}
- // <--
}
return bResult;
@@ -234,10 +233,9 @@ void SwEditShell::DelNumRules()
// ueberfluessig sein, aber VB hatte darueber eine Bugrep.
CallChgLnk();
- // --> OD 2005-10-24 #126346# - cursor can not be anymore in
- // front of a label, because numbering/bullet is deleted.
+ // cursor can not be anymore in front of a label,
+ // because numbering/bullet is deleted.
SetInFrontOfLabel( sal_False );
- // <--
GetDoc()->SetModified();
EndAllAction();
@@ -317,10 +315,8 @@ void SwEditShell::ChangeIndentOfAllListLevels( short nDiff )
aRule.ChangeIndent( nDiff );
// <--
- // --> OD 2008-03-17 #refactorlists#
// no start of new list
SetCurNumRule( aRule, false );
- // <--
}
EndAllAction();
@@ -341,13 +337,9 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
SwTxtNode * pTxtNode = aPaM.GetNode()->GetTxtNode();
// --> OD 2008-06-09 #i90078#
-// int nLevel = -1;
-// int nReferenceLevel = pTxtNode->GetActualListLevel();
-// if (! IsFirstOfNumRule(aPaM))
-// nLevel = nReferenceLevel;
SwNumRule aRule(*pCurNumRule);
-// aRule.ChangeIndent(nIndent, nLevel, nReferenceLevel, sal_False);
+
if ( IsFirstOfNumRule() )
{
aRule.SetIndentOfFirstListLevelAndChangeOthers( nIndent );
@@ -361,7 +353,6 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
// --> OD 2005-02-18 #i42921# - 3rd parameter = false in order to
// suppress setting of num rule at <aPaM>.
- // --> OD 2008-03-17 #refactorlists#
// do not apply any list
GetDoc()->SetNumRule( aPaM, aRule, false, String(), sal_False );
// <--
@@ -559,15 +550,11 @@ sal_Bool SwEditShell::IsProtectedOutlinePara() const
{
SwNodePtr pTmpNd = rOutlNd[ nPos ];
- // --> OD 2008-04-02 #refactorlists#
-// sal_uInt8 nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()->
-// GetTxtColl()->GetOutlineLevel() );
- // int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();//#outline level,zhaojianwei
int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel();
- // ASSERT( nTmpLvl >= 0 && nTmpLvl < MAXLEVEL,
- ASSERT( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL, //<-end,zhaojianwei
+
+ OSL_ENSURE( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL,
"<SwEditShell::IsProtectedOutlinePara()>" );
- // <--
+
if( bFirst )
{
nLvl = nTmpLvl;
@@ -583,10 +570,10 @@ sal_Bool SwEditShell::IsProtectedOutlinePara() const
}
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT(!this, "Cursor not on an outline node" );
+ OSL_ENSURE(!this, "Cursor not on an outline node" );
}
#endif
return bRet;
@@ -619,7 +606,7 @@ sal_Bool SwEditShell::IsOutlineCopyable( sal_uInt16 nIdx ) const
}
-sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) // #115901#
+sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart )
{
sal_Bool bRet = sal_False;
SwPaM* pCrsr = GetCrsr();
@@ -627,7 +614,6 @@ sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) // #1159
( !bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()) )
{
StartAllAction(); // Klammern fuers Updaten !!
- // #115901#
bRet = GetDoc()->NumOrNoNum( pCrsr->GetPoint()->nNode, !bNumOn ); // #i29560#
EndAllAction();
}
@@ -654,32 +640,26 @@ sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
return bResult;
}
-// --> OD 2008-02-29 #refactorlists# - removed <pHasChilds>
sal_uInt8 SwEditShell::GetNumLevel() const
{
// gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet
- //sal_uInt8 nLevel = NO_NUMBERING; //#outline level,zhaojianwei
sal_uInt8 nLevel = MAXLEVEL; //end,zhaojianwei
SwPaM* pCrsr = GetCrsr();
const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
- // --> FME 2005-09-12 #124972# Made code robust:
- ASSERT( pTxtNd, "GetNumLevel() without text node" )
+ OSL_ENSURE( pTxtNd, "GetNumLevel() without text node" );
if ( !pTxtNd )
return nLevel;
- // <--
const SwNumRule* pRule = pTxtNd->GetNumRule();
if(pRule)
{
- // --> OD 2008-05-09 #refactorlists#
const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() );
if ( nListLevelOfTxtNode >= 0 )
{
nLevel = static_cast<sal_uInt8>( nListLevelOfTxtNode );
}
- // <--
}
return nLevel;
@@ -690,8 +670,6 @@ const SwNumRule* SwEditShell::GetCurNumRule() const
return GetDoc()->GetCurrNumRule( *GetCrsr()->GetPoint() );
}
-// OD 2008-02-08 #newlistlevelattrs# - add handling of parameter <bResetIndentAttrs>
-// --> OD 2008-03-17 #refactorlists#
void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
const bool bCreateNewList,
const String sContinuedListId,
@@ -709,19 +687,14 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
{
aRangeArr.SetPam( n, aPam );
- // --> OD 2008-02-08 #newlistlevelattrs#
- // --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( aPam, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
- // <--
GetDoc()->SetCounted( aPam, true );
}
}
else
{
- // --> OD 2008-02-08 #newlistlevelattrs#
- // --> OD 2008-03-17 #refactorlists#
GetDoc()->SetNumRule( *pCrsr, rRule,
bCreateNewList, sContinuedListId,
sal_True, bResetIndentAttrs );
@@ -804,7 +777,6 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt )
sal_uInt16 SwEditShell::GetNodeNumStart() const
{
const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode();
- // --> OD 2008-02-28 #refactorlists#
// correction: check, if list restart value is set at text node and
// use new method <SwTxtNode::GetAttrListRestartValue()>.
// return USHRT_MAX, if no list restart value is found.
@@ -813,13 +785,8 @@ sal_uInt16 SwEditShell::GetNodeNumStart() const
return static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue());
}
return USHRT_MAX;
- // <--
}
-/*-- 26.08.2005 14:47:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-// --> OD 2008-03-18 #refactorlists#
const SwNumRule * SwEditShell::SearchNumRule( const bool bForward,
const bool bNum,
const bool bOutline,
@@ -830,4 +797,5 @@ const SwNumRule * SwEditShell::SearchNumRule( const bool bForward,
bForward, bNum, bOutline, nNonEmptyAllowed,
sListId );
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index 0dd6b9b3ec79..44116e4ebf5c 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/source/core/edit/edredln.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -148,3 +149,4 @@ sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 898e80a95f56..62463af9f947 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -88,7 +89,7 @@ const SwSection* SwEditShell::GetCurrSection() const
return GetDoc()->GetCurrSection( *GetCrsr()->GetPoint() );
}
-/*-----------------17.03.99 11:53-------------------
+/*--------------------------------------------------
* SwEditShell::GetAnySection liefert den fuer Spalten
* zustaendigen Bereich, bei Fussnoten kann es nicht der
* Bereich innerhalb der Fussnote sein.
@@ -113,11 +114,11 @@ const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pP
if( pFrm && pFrm->IsInSct() )
{
SwSectionFrm* pSect = pFrm->FindSctFrm();
- ASSERT( pSect, "GetAnySection: Where's my Sect?" );
+ OSL_ENSURE( pSect, "GetAnySection: Where's my Sect?" );
if( pSect->IsInFtn() && pSect->GetUpper()->IsInSct() )
{
pSect = pSect->GetUpper()->FindSctFrm();
- ASSERT( pSect, "GetAnySection: Where's my SectFrm?" );
+ OSL_ENSURE( pSect, "GetAnySection: Where's my SectFrm?" );
}
return pSect->GetSection();
}
@@ -399,9 +400,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
pReturn = pInnermostNode->EndOfSectionNode();
else if ( bStart )
pReturn = pInnermostNode;
- // else pReturn = NULL;
}
- // else: pReturn = NULL
DBG_ASSERT( ( pReturn == NULL ) || pReturn->IsStartNode() ||
@@ -453,3 +452,4 @@ bool SwEditShell::DoSpecialInsert()
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index f67442d1be4b..edf9b2a9d150 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,7 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts
GetDoc()->SplitNode( *pPos, false );
}
- /* #109161# If called from a shell the adjust item is propagated
+ /* If called from a shell the adjust item is propagated
from pPos to the new content nodes in the table.
*/
const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos,
@@ -451,9 +452,8 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
const SwTableNode* pChkNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode();
if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) &&
bNew == pChkNd->GetTable().IsNewModel() &&
- // --> FME 2004-09-17 #117418# Consider table in table case
+ // Consider table in table case
pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 )
- // <--
*pChkNxtPrv = sal_True, bRet = sal_True; // mit Prev ist moeglich
else
{
@@ -470,10 +470,9 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
if( bWithPrev )
{
pTmpTblNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode();
- // --> FME 2004-09-17 #117418# Consider table in table case
+ // Consider table in table case
if ( pTmpTblNd && pTmpTblNd->EndOfSectionIndex() != pTblNd->GetIndex() - 1 )
pTmpTblNd = 0;
- // <--
}
else
pTmpTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
@@ -491,3 +490,4 @@ void SwEditShell::AppendUndoForInsertFromDB( sal_Bool bIsTable )
GetDoc()->AppendUndoForInsertFromDB( *GetCrsr(), bIsTable );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index d2403bae2625..b86a70f01be5 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,6 @@
#include <pam.hxx>
#include <viewopt.hxx>
#include <ndtxt.hxx>
-#include <errhdl.hxx>
#include <swundo.hxx>
#include <txttxmrk.hxx>
#include <edimp.hxx>
@@ -118,40 +118,30 @@ sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks );
}
-/* -----------------01.09.99 16:05-------------------
-
- --------------------------------------------------*/
sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
return rTOXSect.IsProtect();
}
-/* -----------------18.10.99 15:53-------------------
- --------------------------------------------------*/
void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadonly)
{
- ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
+ OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase;
((SwTOXBase&)rTOXBase).SetProtected(bReadonly);
- ASSERT( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" );
+ OSL_ENSURE( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" );
SwSectionData aSectionData(rTOXSect);
aSectionData.SetProtectFlag(bReadonly);
UpdateSection( GetSectionFmtPos( *rTOXSect.GetFmt() ), aSectionData, 0 );
}
-/* -----------------02.09.99 07:47-------------------
-
- --------------------------------------------------*/
const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate )
{
return GetDoc()->GetDefaultTOXBase( eTyp, bCreate );
}
-/* -----------------02.09.99 08:05-------------------
- --------------------------------------------------*/
void SwEditShell::SetDefaultTOXBase(const SwTOXBase& rBase)
{
GetDoc()->SetDefaultTOXBase(rBase);
@@ -173,7 +163,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
// Einfuegen des Verzeichnisses
const SwTOXBaseSection* pTOX = pDoc->InsertTableOf(
*GetCrsr()->GetPoint(), rTOX, pSet, sal_True );
- ASSERT(pTOX, "Kein aktuelles Verzeichnis");
+ OSL_ENSURE(pTOX, "Kein aktuelles Verzeichnis");
// Formatierung anstossen
CalcLayout();
@@ -197,9 +187,9 @@ sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pS
{
sal_Bool bRet = sal_False;
- ASSERT( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ OSL_ENSURE( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX;
- ASSERT(pTOX, "Keine aktuelles Verzeichnis");
+ OSL_ENSURE(pTOX, "Keine aktuelles Verzeichnis");
const SwSectionNode* pSectNd;
if( pTOX && 0 != ( pSectNd = pTOX->GetFmt()->GetSectionNode() ) )
{
@@ -295,7 +285,7 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const
pSect->GetFmt()->GetSectionNode() &&
nCnt++ == nPos )
{
- ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
+ OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
return (SwTOXBaseSection*)pSect;
}
}
@@ -315,23 +305,16 @@ sal_Bool SwEditShell::IsUpdateTOX() const
return GetDoc()->IsUpdateTOX();
}
-/* -----------------26.08.99 13:49-------------------
-
- --------------------------------------------------*/
const String& SwEditShell::GetTOIAutoMarkURL() const
{
return GetDoc()->GetTOIAutoMarkURL();
}
-/* -----------------26.08.99 13:49-------------------
- --------------------------------------------------*/
void SwEditShell::SetTOIAutoMarkURL(const String& rSet)
{
GetDoc()->SetTOIAutoMarkURL(rSet);
}
-/* -----------------26.08.99 09:29-------------------
- --------------------------------------------------*/
void SwEditShell::ApplyAutoMark()
{
StartAllAction();
@@ -367,8 +350,6 @@ void SwEditShell::ApplyAutoMark()
//
// SearchOptions to be used in loop below
//
- //SearchAlgorithms eSrchType = SearchAlgorithms_ABSOLUTE;
- //OUString aSrchStr = rText;
sal_Bool bCaseSensitive = sal_True;
sal_Bool bWordOnly = sal_False;
sal_Bool bSrchInSel = sal_False;
@@ -429,13 +410,11 @@ void SwEditShell::ApplyAutoMark()
//
if (!bCaseSensitive)
{
- //nSrchFlags |= SearchFlags::ALL_IGNORE_CASE;
aSearchOpt.transliterateFlags |=
TransliterationModules_IGNORE_CASE;
}
else
{
- //aSearchOpt.searchFlag &= ~SearchFlags::ALL_IGNORE_CASE;
aSearchOpt.transliterateFlags &=
~TransliterationModules_IGNORE_CASE;
}
@@ -483,3 +462,4 @@ void SwEditShell::ApplyAutoMark()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 466db86bd93a..8366ec3bf6fc 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,7 +104,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
{
SET_CURR_SHELL( this );
- // #105332# current undo state was not saved
+ // current undo state was not saved
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
sal_Bool bRet = sal_False;
@@ -148,7 +149,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
- //JP 18.09.97: autom. Erkennung fuer die neue "Box"
+ // autom. Erkennung fuer die neue "Box"
SaveTblBoxCntnt();
}
EndAllAction();
@@ -162,7 +163,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
sal_Bool bRet = sal_False;
- // #105332# undo state was not saved
+ // undo state was not saved
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
StartAllAction();
@@ -197,7 +198,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
- //JP 18.09.97: autom. Erkennung fuer die neue "Box"
+ // autom. Erkennung fuer die neue "Box"
SaveTblBoxCntnt();
}
@@ -232,8 +233,8 @@ bool SwEditShell::Repeat(sal_uInt16 const nCount)
void lcl_SelectSdrMarkList( SwEditShell* pShell,
const SdrMarkList* pSdrMarkList )
{
- ASSERT( pShell != NULL, "need shell!" );
- ASSERT( pSdrMarkList != NULL, "need mark list" );
+ OSL_ENSURE( pShell != NULL, "need shell!" );
+ OSL_ENSURE( pSdrMarkList != NULL, "need mark list" );
if( pShell->ISA( SwFEShell ) )
{
@@ -246,7 +247,8 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
// the old implementation would always unselect
// objects, even if no new ones were selected. If this
// is a problem, we need to re-work this a little.
- ASSERT( pSdrMarkList->GetMarkCount() != 0, "empty mark list" );
+ OSL_ENSURE( pSdrMarkList->GetMarkCount() != 0, "empty mark list" );
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 1a681ad2cf29..bb34343dc65e 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -175,7 +176,7 @@ sal_uInt16 SwEditShell::GetCntType() const
case ND_OLENODE: nRet = CNT_OLE; break;
}
- ASSERT( nRet, ERR_OUTOFSCOPE );
+ OSL_ASSERT( nRet );
return nRet;
}
@@ -324,7 +325,7 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert,
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar );
rACorr.AutoCorrect( aSwAutoCorrDoc,
pTNd->GetTxt(), pCrsr->GetPoint()->nContent.GetIndex(),
- cChar, bInsert );
+ cChar, bInsert, GetWin() );
if( cChar )
SaveTblBoxCntnt( pCrsr->GetPoint() );
EndAllAction();
@@ -363,3 +364,4 @@ SwAutoCompleteWord& SwEditShell::GetAutoCompleteWords()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 8242d2325015..a1570c26e11c 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <editeng/langitem.hxx>
#include <swtypes.hxx>
#include <tools/resid.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <authfld.hxx>
#include <expfld.hxx>
#include <pam.hxx>
@@ -54,9 +53,7 @@
#include <txtfld.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <unoprnms.hxx>
#include <unomid.h>
@@ -76,10 +73,6 @@ typedef SwTOXSortKey* TOXSortKeyPtr;
SV_DECL_PTRARR_DEL( SortKeyArr, TOXSortKeyPtr, 5, 5 )
SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr )
-
-/* -----------------16.09.99 11:53-------------------
-
- --------------------------------------------------*/
SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy)
: nRefCount(0)
{
@@ -96,14 +89,10 @@ sal_Bool SwAuthEntry::operator==(const SwAuthEntry& rComp)
}
// --------------------------------------------------------
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
: SwFieldType( RES_AUTHORITY ),
m_pDoc(pDoc),
m_pDataArr(new SwAuthDataArr ),
- m_pSequArr(new SvLongs(5, 5)),
m_pSortKeyArr(new SortKeyArr(3, 3)),
m_cPrefix('['),
m_cSuffix(']'),
@@ -116,7 +105,6 @@ SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType)
: SwFieldType( RES_AUTHORITY ),
m_pDataArr(new SwAuthDataArr ),
- m_pSequArr(new SvLongs(5, 5)),
m_pSortKeyArr(new SortKeyArr(3, 3)),
m_cPrefix(rFType.m_cPrefix),
m_cSuffix(rFType.m_cSuffix),
@@ -129,30 +117,22 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType)
m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i);
}
-/* -----------------17.09.99 13:52-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::~SwAuthorityFieldType()
{
-// DBG_ASSERT(!m_pDataArr->Count(), "Array is not empty");
m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count());
delete m_pSortKeyArr;
- delete m_pSequArr;
+ m_SequArr.clear();
delete m_pDataArr;
}
-/*-- 14.09.99 16:22:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFieldType* SwAuthorityFieldType::Copy() const
{
return new SwAuthorityFieldType(m_pDoc);
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::RemoveField(long nHandle)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool bRemoved = sal_False;
#endif
for(sal_uInt16 j = 0; j < m_pDataArr->Count(); j++)
@@ -161,7 +141,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
long nRet = (long)(void*)pTemp;
if(nRet == nHandle)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bRemoved = sal_True;
#endif
pTemp->RemoveRef();
@@ -174,13 +154,11 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
break;
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
DBG_ASSERT(bRemoved, "Field unknown" );
#endif
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
long SwAuthorityFieldType::AddField(const String& rFieldContents)
{
long nRet = 0;
@@ -210,9 +188,7 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
}
return nRet;
}
-/* -----------------17.09.99 14:18-------------------
- --------------------------------------------------*/
sal_Bool SwAuthorityFieldType::AddField(long nHandle)
{
sal_Bool bRet = sal_False;
@@ -232,9 +208,7 @@ sal_Bool SwAuthorityFieldType::AddField(long nHandle)
DBG_ASSERT(bRet, "::AddField(long) failed");
return bRet;
}
-/* -----------------17.09.99 14:52-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
{
const SwAuthEntry* pRet = 0;
@@ -248,12 +222,10 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
break;
}
}
- ASSERT( pRet, "invalid Handle" );
+ OSL_ENSURE( pRet, "invalid Handle" );
return pRet;
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::GetAllEntryIdentifiers(
SvStringsDtor& rToFill )const
{
@@ -264,9 +236,7 @@ void SwAuthorityFieldType::GetAllEntryIdentifiers(
AUTH_FIELD_IDENTIFIER )), rToFill.Count() );
}
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
const String& rIdentifier)const
{
@@ -282,9 +252,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
}
return pRet;
}
-/* -----------------------------21.12.99 13:20--------------------------------
- ---------------------------------------------------------------------------*/
bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
{
bool bChanged = false;
@@ -303,7 +271,7 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
}
return bChanged;
}
-/*-- 11.10.99 08:49:22---------------------------------------------------
+/*-----------------------------------------------------------------------
Description: appends a new entry (if new) and returns the array position
-----------------------------------------------------------------------*/
@@ -327,9 +295,6 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
return nRet;
}
-/*-- 11.10.99 08:49:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
{
long nRet = 0;
@@ -340,18 +305,16 @@ long SwAuthorityFieldType::GetHandle(sal_uInt16 nPos)
}
return nRet;
}
-/* -----------------19.10.99 13:46-------------------
- --------------------------------------------------*/
sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
{
//find the field in a sorted array of handles,
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool bCurrentFieldWithoutTextNode = sal_False;
#endif
- if(m_pSequArr->Count() && m_pSequArr->Count() != m_pDataArr->Count())
+ if(!m_SequArr.empty() && m_SequArr.size() != m_pDataArr->Count())
DelSequenceArray();
- if(!m_pSequArr->Count())
+ if(m_SequArr.empty())
{
SwTOXSortTabBases aSortArr;
SwClientIter aIter( *this );
@@ -364,7 +327,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
if(!pTxtFld || !pTxtFld->GetpTxtNode())
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if(nHandle == ((SwAuthorityField*)pFmtFld->GetFld())->GetHandle())
bCurrentFieldWithoutTextNode = sal_True;
#endif
@@ -392,7 +355,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
SwTOXSortTabBase* pOld = aSortArr[i];
if(*pOld == *pNew)
{
- //only the first occurence in the document
+ //only the first occurrence in the document
//has to be in the array
if(*pOld < *pNew)
DELETEZ(pNew);
@@ -422,27 +385,28 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
const SwTOXSortTabBase& rBase = *aSortArr[i];
SwFmtFld& rFmtFld = ((SwTOXAuthority&)rBase).GetFldFmt();
SwAuthorityField* pAFld = (SwAuthorityField*)rFmtFld.GetFld();
- m_pSequArr->Insert(pAFld->GetHandle(), i);
+ m_SequArr.push_back(pAFld->GetHandle());
}
aSortArr.DeleteAndDestroy(0, aSortArr.Count());
}
//find nHandle
sal_uInt16 nRet = 0;
- for(sal_uInt16 i = 0; i < m_pSequArr->Count(); i++)
+ for(sal_uInt16 i = 0; i < m_SequArr.size(); ++i)
{
- if((*m_pSequArr)[i] == nHandle)
+ if(m_SequArr[i] == nHandle)
{
nRet = i + 1;
break;
}
}
- ASSERT(bCurrentFieldWithoutTextNode || nRet, "Handle not found")
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE(bCurrentFieldWithoutTextNode || nRet, "Handle not found");
+#endif
return nRet;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
+
+bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -476,8 +440,8 @@ sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) c
{
Sequence<PropertyValues> aRet(m_pSortKeyArr->Count());
PropertyValues* pValues = aRet.getArray();
- OUString sProp1( C2U(SW_PROP_NAME_STR(UNO_NAME_SORT_KEY)) ),
- sProp2( C2U(SW_PROP_NAME_STR(UNO_NAME_IS_SORT_ASCENDING)));
+ OUString sProp1( rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SORT_KEY)) ),
+ sProp2( rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_SORT_ASCENDING)));
for(sal_uInt16 i = 0; i < m_pSortKeyArr->Count(); i++)
{
const SwTOXSortKey* pKey = (*m_pSortKeyArr)[i];
@@ -492,16 +456,14 @@ sal_Bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) c
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
+bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
String sTmp;
switch( nWhichId )
{
@@ -554,7 +516,7 @@ sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId
if(nVal >= 0 && nVal < AUTH_FIELD_END)
pSortKey->eField = (ToxAuthorityField) nVal;
else
- bRet = sal_False;
+ bRet = false;
}
else if(pValue[j].Name.equalsAsciiL(SW_PROP_NAME(UNO_NAME_IS_SORT_ASCENDING)))
{
@@ -567,29 +529,23 @@ sal_Bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
return bRet;
}
-/* -----------------19.10.99 13:25-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
//re-generate positions of the fields
DelSequenceArray();
SwModify::Modify( pOld, pNew );
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const
{
return m_pSortKeyArr->Count();
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
{
SwTOXSortKey* pRet = 0;
@@ -598,9 +554,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
DBG_ASSERT(pRet, "Sort key not found");
return pRet;
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[])
{
m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count());
@@ -610,9 +564,6 @@ void SwAuthorityFieldType::SetSortKeys(sal_uInt16 nKeyCount, SwTOXSortKey aKeys[
m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++);
}
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
const String& rFieldContents )
: SwField(pInitType),
@@ -620,9 +571,7 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
m_nHandle = pInitType->AddField( rFieldContents );
}
-/* -----------------17.09.99 14:24-------------------
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
long nSetHandle )
: SwField( pInitType ),
@@ -631,16 +580,12 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
pInitType->AddField( m_nHandle );
}
-/* -----------------15.09.99 15:00-------------------
- --------------------------------------------------*/
SwAuthorityField::~SwAuthorityField()
{
((SwAuthorityFieldType* )GetTyp())->RemoveField(m_nHandle);
}
-/*-- 14.09.99 16:20:59---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwAuthorityField::Expand() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
@@ -666,45 +611,32 @@ String SwAuthorityField::Expand() const
sRet += pAuthType->GetSuffix();
return sRet;
}
-/*-- 14.09.99 16:21:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwField* SwAuthorityField::Copy() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
return new SwAuthorityField(pAuthType, m_nHandle);
}
-/* -----------------21.09.99 12:55-------------------
- --------------------------------------------------*/
const String& SwAuthorityField::GetFieldText(ToxAuthorityField eField) const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
const SwAuthEntry* pEntry = pAuthType->GetEntryByHandle( m_nHandle );
return pEntry->GetAuthorField( eField );
}
-/* -----------------21.09.99 14:57-------------------
- --------------------------------------------------*/
void SwAuthorityField::SetPar1(const String& rStr)
{
SwAuthorityFieldType* pInitType = (SwAuthorityFieldType* )GetTyp();
pInitType->RemoveField(m_nHandle);
m_nHandle = pInitType->AddField(rStr);
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
String SwAuthorityField::GetDescription() const
{
return SW_RES(STR_AUTHORITY_ENTRY);
}
-
-
-/* -----------------------------15.11.00 17:33--------------------------------
-
- ---------------------------------------------------------------------------*/
const char* aFieldNames[] =
{
"Identifier",
@@ -739,21 +671,19 @@ const char* aFieldNames[] =
"Custom5",
"ISBN"
};
-/* -----------------------------16.11.00 12:27--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const
+bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const
{
if(!GetTyp())
- return sal_False;
+ return false;
const SwAuthEntry* pAuthEntry = ((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle);
if(!pAuthEntry)
- return sal_False;
+ return false;
Sequence <PropertyValue> aRet(AUTH_FIELD_END);
PropertyValue* pValues = aRet.getArray();
for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++)
{
- pValues[i].Name = C2U(aFieldNames[i]);
+ pValues[i].Name = rtl::OUString::createFromAscii(aFieldNames[i]);
const String& rField = pAuthEntry->GetAuthorField((ToxAuthorityField) i);
if(i == AUTH_FIELD_AUTHORITY_TYPE)
pValues[i].Value <<= sal_Int16(rField.ToInt32());
@@ -761,11 +691,10 @@ sal_Bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) c
pValues[i].Value <<= OUString(rField);
}
rAny <<= aRet;
- return sal_False;
+ /* FIXME: it is weird that we always return false here */
+ return false;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 lcl_Find(const OUString& rFieldName)
{
for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++)
@@ -774,14 +703,14 @@ sal_Int16 lcl_Find(const OUString& rFieldName)
return -1;
}
//----------------------------------------------------------------------------
-sal_Bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
+bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
{
if(!GetTyp() || !((SwAuthorityFieldType*)GetTyp())->GetEntryByHandle(m_nHandle))
- return sal_False;
+ return false;
Sequence <PropertyValue> aParam;
if(!(rAny >>= aParam))
- return sal_False;
+ return false;
String sToSet;
sToSet.Fill(AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER);
@@ -807,11 +736,10 @@ sal_Bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/
((SwAuthorityFieldType*)GetTyp())->RemoveField(m_nHandle);
m_nHandle = ((SwAuthorityFieldType*)GetTyp())->AddField(sToSet);
- return sal_False;
+ /* FIXME: it is weird that we always return false here */
+ return false;
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
{
SwAuthorityFieldType* pSrcTyp = (SwAuthorityFieldType*)GetTyp(),
@@ -829,3 +757,4 @@ SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
return pSrcTyp;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 422285dee10f..12b2d4ede232 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@ 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& , sal_Bool );
+ const String& , const String& , bool );
/*************************************************************************
@@ -71,9 +72,6 @@ String lcl_BoxNmToRel( const SwTable&, const SwTableNode&,
|* oder mit einem Feld, dann hole den Wert.
|* Alle anderen Bedingungen returnen einen Fehler (oder 0 ?)
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
@@ -311,7 +309,7 @@ SwTableFormula::SwTableFormula( const String& rFormel )
: sFormel( rFormel )
{
eNmType = EXTRNL_NAME;
- bValidValue = sal_False;
+ bValidValue = false;
}
SwTableFormula::~SwTableFormula()
@@ -388,7 +386,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, String& rNewStr,
{
// relativen Namen zu Box-Namen (externe Darstellung)
SwNode* pNd = (SwNode*)pPara;
- ASSERT( pNd, "Feld steht in keinem TextNode" );
+ OSL_ENSURE( pNd, "Feld steht in keinem TextNode" );
const SwTableBox *pRelBox, *pBox = (SwTableBox *)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
@@ -418,7 +416,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
{
// relativen Namen zu Box-Pointern (interne Darstellung)
SwNode* pNd = (SwNode*)pPara;
- ASSERT( pNd, "Feld steht in keinem Node" );
+ OSL_ENSURE( pNd, "Feld steht in keinem Node" );
const SwTableBox *pRelBox, *pBox = (SwTableBox*)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
@@ -449,7 +447,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
{
// Box-Namen (externe Darstellung) zu relativen Namen
SwNode* pNd = (SwNode*)pPara;
- ASSERT( pNd, "Feld steht in keinem Node" );
+ OSL_ENSURE( pNd, "Feld steht in keinem Node" );
const SwTableNode* pTblNd = pNd->FindTableNode();
String sRefBoxNm;
@@ -457,7 +455,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
{
const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- ASSERT( pBox, "Feld steht in keiner Tabelle" );
+ OSL_ENSURE( pBox, "Feld steht in keiner Tabelle" );
sRefBoxNm = pBox->GetName();
}
@@ -672,7 +670,7 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
if( pFnd )
pTbl = pFnd;
// ??
- ASSERT( pFnd, "Tabelle nicht gefunden, was nun?" );
+ OSL_ENSURE( pFnd, "Tabelle nicht gefunden, was nun?" );
}
}
}
@@ -724,23 +722,9 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
-/*
-
- // oder besser ueber die Box den Frame suchen
-
- SwClientIter aIter( *pBox->GetFrmFmt() );
- sal_uLong nMinPos = ULONG_MAX;
- const SwFrm* pFnd = 0;
- for( SwFrm* pF = (SwFrm*)aIter.First( TYPE( SwCellFrm )); pF;
- pF = (SwFrm*)aIter.Next() )
- {
- if( pF->Frm().Y() <
- }
-*/
-
SwNodeIndex aIdx( *rBox.GetSttNd() );
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
- ASSERT( pCNd, "Box hat keinen TextNode" );
+ OSL_ENSURE( pCNd, "Box hat keinen TextNode" );
Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
return pCNd->GetFrm( &aPt, NULL, sal_False );
}
@@ -850,7 +834,7 @@ const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
const String& rRefBoxNm, const String& rGetStr,
- sal_Bool bExtrnlNm )
+ bool bExtrnlNm )
{
String sCpy( rRefBoxNm );
String sTmp( rGetStr );
@@ -997,7 +981,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
- sal_Bool* pBValid = (sal_Bool*)pPara;
+ bool* pBValid = (bool*)pPara;
if( *pBValid ) // einmal falsch, immer falsch
{
SwTableBox* pSttBox = 0, *pEndBox = 0;
@@ -1038,13 +1022,13 @@ void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
if( ( pLastBox &&
( !pEndBox || !rTbl.GetTabSortBoxes().Seek_Entry( pEndBox ) ) ) ||
( !pSttBox || !rTbl.GetTabSortBoxes().Seek_Entry( pSttBox ) ) )
- *pBValid = sal_False;
+ *pBValid = false;
}
}
-sal_Bool SwTableFormula::HasValidBoxes() const
+bool SwTableFormula::HasValidBoxes() const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
const SwNode* pNd = GetNodeOfFormula();
if( pNd && 0 != ( pNd = pNd->FindTableNode() ) )
ScanString( &SwTableFormula::_HasValidBoxes,
@@ -1152,7 +1136,7 @@ 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?
- sal_Bool bInNewTbl = sal_False;
+ bool bInNewTbl = false;
if( pLastBox )
{
// das ist die "erste" Box in der Selektion. Die bestimmt ob die
@@ -1230,3 +1214,4 @@ void SwTableFormula::ToSplitMergeBoxNm( SwTableFmlUpdate& rTblUpd )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 837ae47d9174..0fc69d1c244c 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include <ndtxt.hxx>
#include <chpfld.hxx>
#include <expfld.hxx> // fuer GetBodyTxtNode
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <numrule.hxx>
using namespace ::com::sun::star;
@@ -103,27 +102,12 @@ SwField* SwChapterField::Copy() const
return pTmp;
}
-// --> OD 2008-02-14 #i53420#
-//void SwChapterField::ChangeExpansion( const SwFrm* pFrm,
-// const SwTxtNode* pTxtNd,
-// sal_Bool bSrchNum )
-//{
-// ASSERT( pFrm, "in welchem Frame stehe ich denn?" )
-// SwDoc* pDoc = (SwDoc*)pTxtNd->GetDoc();
-// SwPosition aPos( pDoc->GetNodes().GetEndOfContent() );
-
-// if( pFrm->IsInDocBody() )
-// aPos.nNode = *pTxtNd;
-// else if( 0 == (pTxtNd = GetBodyTxtNode( *pDoc, aPos, *pFrm )) )
-// // kein TxtNode (Formatierung Kopf/Fusszeile)
-// return;
-// ChangeExpansion(*pTxtNd, bSrchNum);
-//}
+// #i53420#
void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
const SwCntntNode* pCntntNode,
sal_Bool bSrchNum )
{
- ASSERT( pFrm, "in welchem Frame stehe ich denn?" )
+ OSL_ENSURE( pFrm, "in welchem Frame stehe ich denn?" );
SwDoc* pDoc = (SwDoc*)pCntntNode->GetDoc();
const SwTxtNode* pTxtNode = dynamic_cast<const SwTxtNode*>(pCntntNode);
@@ -138,7 +122,6 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
ChangeExpansion( *pTxtNode, bSrchNum );
}
}
-// <--
void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
{
@@ -154,16 +137,9 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
{
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<sal_uInt8>(pONd->GetOutlineLevel());
- ASSERT( pONd->GetAttrOutlineLevel() >= 0 && pONd->GetAttrOutlineLevel() <= MAXLEVEL,
+ OSL_ENSURE( pONd->GetAttrOutlineLevel() >= 0 && pONd->GetAttrOutlineLevel() <= MAXLEVEL,
"<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect -> please inform OD." );
- nLevel = static_cast<sal_uInt8>(pONd->GetAttrOutlineLevel()); //<-end,zhaojianwei
- // <--
+ nLevel = static_cast<sal_uInt8>(pONd->GetAttrOutlineLevel());
if( nPrevLvl < nLevel )
nLevel = nPrevLvl;
@@ -187,12 +163,10 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
if ( pTxtNd->IsOutline() )
{
- // --> OD 2005-11-17 #128041#
// correction of refactoring done by cws swnumtree:
// retrieve numbering string without prefix and suffix strings
// as stated in the above german comment.
sNumber = pTxtNd->GetNumString( false );
- // <--
SwNumRule* pRule( pTxtNd->GetNumRule() );
if ( pTxtNd->IsCountedInList() && pRule )
@@ -226,10 +200,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
}
}
-/*-----------------05.03.98 16:19-------------------
-
---------------------------------------------------*/
-sal_Bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -258,14 +229,12 @@ sal_Bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 16:19-------------------
---------------------------------------------------*/
-sal_Bool SwChapterField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwChapterField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Bool bRet = sal_True;
switch( nWhichId )
@@ -277,7 +246,7 @@ sal_Bool SwChapterField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
if(nTmp >= 0 && nTmp < MAXLEVEL)
nLevel = nTmp;
else
- bRet = sal_False;
+ bRet = false;
break;
}
@@ -295,15 +264,17 @@ sal_Bool SwChapterField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
case text::ChapterFormat::DIGIT:
SetFormat(CF_NUMBER_NOPREPST);
break;
- //case text::ChapterFormat::NAME_NUMBER:
+
default: SetFormat(CF_NUM_TITLE);
}
}
break;
default:
- DBG_ERROR("illegal property");
- bRet = sal_False;
+ OSL_FAIL("illegal property");
+ bRet = false;
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index a78c2a57d44a..8f1e6bd16c87 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,7 +110,7 @@ const String& SwDBFieldType::GetName() const
void SwDBFieldType::ReleaseRef()
{
- ASSERT(nRefCnt > 0, "RefCount kleiner 0!");
+ OSL_ENSURE(nRefCnt > 0, "RefCount kleiner 0!");
if (--nRefCnt <= 0)
{
@@ -123,10 +124,7 @@ void SwDBFieldType::ReleaseRef()
}
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
-sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -143,14 +141,12 @@ sal_Bool SwDBFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= aDBData.nCommandType;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
-sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+
+bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -188,9 +184,9 @@ sal_Bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= aDBData.nCommandType;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: SwDBField
@@ -279,10 +275,7 @@ SwField* SwDBField::Copy() const
String SwDBField::GetFieldName() const
{
const String& rDBName = static_cast<SwDBFieldType*>(GetTyp())->GetName();
- //TODO/CLEANUP
- //Funktion tut nichts!
- //String sContent( SFX_APP()->LocalizeDBName(INI2NATIONAL,
- // rDBName.GetToken(0, DB_DELIM)));
+
String sContent( rDBName.GetToken(0, DB_DELIM) );
if (sContent.Len() > 1)
@@ -306,10 +299,6 @@ void SwDBField::ChgValue( double d, sal_Bool bVal )
aContent = ((SwValueFieldType*)GetTyp())->ExpandValue(d, GetFormat(), GetLanguage());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFieldType* SwDBField::ChgTyp( SwFieldType* pNewType )
{
SwFieldType* pOld = SwValueField::ChgTyp( pNewType );
@@ -393,28 +382,17 @@ const String& SwDBField::GetPar1() const
return ((SwDBFieldType*)GetTyp())->GetName();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwDBField::GetSubType() const
{
return nSubType;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDBField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
-/*-----------------06.03.98 16:15-------------------
-
---------------------------------------------------*/
-sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -440,15 +418,13 @@ sal_Bool SwDBField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= OUString(sFieldCode);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
-sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -502,9 +478,9 @@ sal_Bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
::GetString( rAny, sFieldCode );
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -530,7 +506,6 @@ SwDBData SwDBNameInfField::GetDBData(SwDoc* pDoc)
return aRet;
}
-// #111840#
void SwDBNameInfField::SetDBData(const SwDBData & rDBData)
{
aDBData = rDBData;
@@ -551,10 +526,7 @@ String SwDBNameInfField::GetFieldName() const
return lcl_DBTrennConv(sStr);
}
-/*-----------------06.03.98 16:55-------------------
-
---------------------------------------------------*/
-sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -574,14 +546,12 @@ sal_Bool SwDBNameInfField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------06.03.98 16:55-------------------
---------------------------------------------------*/
-sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -599,7 +569,7 @@ sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
sal_uInt16 nSubTyp = GetSubType();
sal_Bool bVisible = sal_False;
if(!(rAny >>= bVisible))
- return sal_False;
+ return false;
if(bVisible)
nSubTyp &= ~nsSwExtendedSubType::SUB_INVISIBLE;
else
@@ -608,20 +578,16 @@ sal_Bool SwDBNameInfField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
sal_uInt16 SwDBNameInfField::GetSubType() const
{
return nSubType;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
void SwDBNameInfField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
@@ -696,12 +662,10 @@ void SwDBNextSetField::SetPar1(const String& rStr)
{
aCond = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
-sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -712,12 +676,10 @@ sal_Bool SwDBNextSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
-sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -730,21 +692,6 @@ sal_Bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-/*
-String SwDBNextSetField::GetPar2() const
-{
- return GetDBName();
-}
-
-void SwDBNextSetField::SetPar2(const String& rStr)
-{
- GetDBName() = rStr;
-}
-*/
-
-/*--------------------------------------------------------------------
Beschreibung: Datensatz mit bestimmter ID
--------------------------------------------------------------------*/
@@ -832,12 +779,10 @@ void SwDBNumSetField::SetPar2(const String& rStr)
{
aPar2 = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
-sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -851,12 +796,10 @@ sal_Bool SwDBNumSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
-sal_Bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR3:
@@ -933,17 +876,12 @@ SwField* SwDBNameField::Copy() const
return pTmp;
}
-/*-----------------06.03.98 16:16-------------------
-
---------------------------------------------------*/
-sal_Bool SwDBNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
return SwDBNameInfField::QueryValue(rAny, nWhichId );
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
-sal_Bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
return SwDBNameInfField::PutValue(rAny, nWhichId );
}
@@ -1012,12 +950,10 @@ SwField* SwDBSetNumberField::Copy() const
pTmp->SetSubType(GetSubType());
return pTmp;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
-sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_USHORT1:
@@ -1031,12 +967,10 @@ sal_Bool SwDBSetNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) c
}
return bRet;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
-sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_USHORT1:
@@ -1046,8 +980,6 @@ sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
if(nSet < (sal_Int16) SVX_NUMBER_NONE )
SetFormat(nSet);
else {
- //exception(wrong_value)
- ;
}
}
break;
@@ -1061,3 +993,4 @@ sal_Bool SwDBSetNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 643efc626eb7..ce5aedb329c6 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include <sfx2/linkmgr.hxx>
#include <doc.hxx>
#include <editsh.hxx>
-#include <errhdl.hxx>
#include <ndtxt.hxx>
#include <fmtfld.hxx>
#include <txtfld.hxx>
@@ -40,9 +40,7 @@
#include <swtable.hxx>
#include <swbaslnk.hxx>
#include <swddetbl.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <hints.hxx>
using rtl::OUString;
@@ -110,7 +108,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
return;
}
- ASSERT( rFldType.GetDoc(), "Kein pDoc" );
+ OSL_ENSURE( rFldType.GetDoc(), "Kein pDoc" );
// keine Abhaengigen mehr?
if( rFldType.GetDepends() && !rFldType.IsModifyLocked() && !ChkNoDataFlag() )
@@ -300,7 +298,7 @@ void SwDDEFieldType::SetDoc( SwDoc* pNewDoc )
if( pDoc && refLink.Is() )
{
- ASSERT( !nRefCnt, "wie kommen die Referenzen rueber?" );
+ OSL_ENSURE( !nRefCnt, "wie kommen die Referenzen rueber?" );
pDoc->GetLinkManager().Remove( refLink );
}
@@ -328,10 +326,8 @@ void SwDDEFieldType::_RefCntChgd()
pDoc->GetLinkManager().Remove( refLink );
}
}
-/* -----------------------------28.08.00 16:23--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwDDEFieldType::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
+bool SwDDEFieldType::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
sal_uInt8 nPart = 0;
switch( nWhichId )
@@ -349,16 +345,14 @@ sal_Bool SwDDEFieldType::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
rVal <<= ::rtl::OUString(aExpansion);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
if( nPart )
rVal <<= OUString(GetCmd().GetToken(nPart-1, sfx2::cTokenSeperator));
- return sal_True;
+ return true;
}
-/* -----------------------------28.08.00 16:23--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
+bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
sal_uInt8 nPart = 0;
switch( nWhichId )
@@ -379,7 +373,7 @@ sal_Bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
if( nPart )
{
@@ -389,7 +383,7 @@ sal_Bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
sCmd.SetToken( nPart-1, sfx2::cTokenSeperator, ::GetString( rVal, sTmp ) );
SetCmd( sCmd );
}
- return sal_True;
+ return true;
}
/* ---------------------------------------------------------------------------
@@ -448,3 +442,4 @@ void SwDDEField::SetPar2(const String& rStr)
((SwDDEFieldType*)GetTyp())->SetCmd(rStr);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 05d8f4ff50a3..c10ea7d2895f 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,7 +76,7 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
}
}
-__EXPORT SwDDETable::~SwDDETable()
+SwDDETable::~SwDDETable()
{
SwDDEFieldType* pFldTyp = (SwDDEFieldType*)aDepend.GetRegisteredIn();
SwDoc* pDoc = GetFrmFmt()->GetDoc();
@@ -101,12 +102,12 @@ void SwDDETable::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
void SwDDETable::ChangeContent()
{
- ASSERT( GetFrmFmt(), "Kein FrameFormat" );
+ OSL_ENSURE( GetFrmFmt(), "Kein FrameFormat" );
// Stehen wir im richtigen NodesArray (Wegen UNDO)
if( !aLines.Count() )
return;
- ASSERT( GetTabSortBoxes().Count(), "Tabelle ohne Inhalt?" );
+ OSL_ENSURE( GetTabSortBoxes().Count(), "Tabelle ohne Inhalt?" );
if( !GetTabSortBoxes()[0]->GetSttNd()->GetNodes().IsDocNodes() )
return;
@@ -123,10 +124,10 @@ void SwDDETable::ChangeContent()
for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().Count(); ++i )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ i ];
- ASSERT( pBox->GetSttIdx(), "keine InhaltsBox" );
+ OSL_ENSURE( pBox->GetSttIdx(), "keine InhaltsBox" );
SwNodeIndex aNdIdx( *pBox->GetSttNd(), 1 );
SwTxtNode* pTxtNode = aNdIdx.GetNode().GetTxtNode();
- ASSERT( pTxtNode, "Kein Node" );
+ OSL_ENSURE( pTxtNode, "Kein Node" );
SwIndex aCntIdx( pTxtNode, 0 );
pTxtNode->EraseText( aCntIdx );
pTxtNode->InsertText( aLine.GetToken( i, '\t' ), aCntIdx );
@@ -152,19 +153,19 @@ SwDDEFieldType* SwDDETable::GetDDEFldType()
sal_Bool SwDDETable::NoDDETable()
{
// suche den TabellenNode
- ASSERT( GetFrmFmt(), "Kein FrameFormat" );
+ OSL_ENSURE( GetFrmFmt(), "Kein FrameFormat" );
SwDoc* pDoc = GetFrmFmt()->GetDoc();
// Stehen wir im richtigen NodesArray (Wegen UNDO)
if( !aLines.Count() )
return sal_False;
- ASSERT( GetTabSortBoxes().Count(), "Tabelle ohne Inhalt?" );
+ OSL_ENSURE( GetTabSortBoxes().Count(), "Tabelle ohne Inhalt?" );
SwNode* pNd = (SwNode*)GetTabSortBoxes()[0]->GetSttNd();
if( !pNd->GetNodes().IsDocNodes() )
return sal_False;
SwTableNode* pTblNd = pNd->FindTableNode();
- ASSERT( pTblNd, "wo steht denn die Tabelle ?");
+ OSL_ENSURE( pTblNd, "wo steht denn die Tabelle ?");
SwTable* pNewTbl = new SwTable( *this );
@@ -185,3 +186,4 @@ sal_Bool SwDDETable::NoDDETable()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 9f0e252a6421..9d8100cf36e8 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,6 @@
#include <tools/datetime.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Time.hpp>
@@ -249,10 +249,7 @@ sal_uInt16 SwPageNumberField::GetSubType() const
return nSubType;
}
-/*-----------------05.03.98 10:25-------------------
-
---------------------------------------------------*/
-sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -278,16 +275,14 @@ sal_Bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 10:25-------------------
---------------------------------------------------*/
-sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
sal_Int16 nSet = 0;
switch( nWhichId )
{
@@ -298,8 +293,6 @@ sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
if(nSet <= SVX_NUM_PAGEDESC )
SetFormat(nSet);
else {
- //exception(wrong_value)
- ;
}
break;
case FIELD_PROP_USHORT1:
@@ -319,7 +312,7 @@ sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
nSubType = PG_NEXT;
break;
default:
- bRet = sal_False;
+ bRet = false;
}
break;
case FIELD_PROP_PAR1:
@@ -327,7 +320,7 @@ sal_Bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
return bRet;
}
@@ -383,12 +376,9 @@ SwField* SwAuthorField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 11:15-------------------
-
---------------------------------------------------*/
-sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
- sal_Bool bVal;
+ bool bVal;
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
@@ -406,14 +396,12 @@ sal_Bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 11:15-------------------
---------------------------------------------------*/
-sal_Bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -433,9 +421,9 @@ sal_Bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -463,8 +451,8 @@ String SwFileNameFieldType::Expand(sal_uLong nFmt) const
{
INetURLObject aTemp(rURLObj);
aTemp.removeSegment();
- // #101947# last slash should belong to the pathname
- aRet = aTemp.PathToFileName();//GetFull();
+ // last slash should belong to the pathname
+ aRet = aTemp.PathToFileName();
}
else
{
@@ -478,7 +466,7 @@ String SwFileNameFieldType::Expand(sal_uLong nFmt) const
break;
case FF_NAME:
- aRet = rURLObj.GetLastName( URL_DECODE );
+ aRet = rURLObj.GetLastName( INetURLObject::DECODE_WITH_CHARSET );
break;
case FF_NAME_NOEXT:
@@ -529,10 +517,7 @@ SwField* SwFileNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
-sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -567,14 +552,12 @@ sal_Bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
rAny <<= OUString(GetContent());
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
-sal_Bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -617,9 +600,9 @@ sal_Bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: SwTemplNameFieldType
@@ -633,7 +616,7 @@ SwTemplNameFieldType::SwTemplNameFieldType(SwDoc *pDocument)
String SwTemplNameFieldType::Expand(sal_uLong nFmt) const
{
- ASSERT( nFmt < FF_END, "Expand: kein guelt. Fmt!" );
+ OSL_ENSURE( nFmt < FF_END, "Expand: kein guelt. Fmt!" );
String aRet;
SwDocShell *pDocShell(pDoc->GetDocShell());
@@ -647,7 +630,7 @@ String SwTemplNameFieldType::Expand(sal_uLong nFmt) const
if( FF_UI_NAME == nFmt )
aRet = xDocProps->getTemplateName();
- else if( !xDocProps->getTemplateURL().equalsAscii("") )
+ else if( xDocProps->getTemplateURL().getLength() )
{
if( FF_UI_RANGE == nFmt )
{
@@ -705,10 +688,7 @@ SwField* SwTemplNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
-sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
{
@@ -729,14 +709,12 @@ sal_Bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
-sal_Bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch ( nWhichId )
{
@@ -769,9 +747,9 @@ sal_Bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: SwDocStatFieldType
@@ -803,7 +781,7 @@ String SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const
nFmt = (sal_uInt32)nNumberingType;
break;
default:
- ASSERT( sal_False, "SwDocStatFieldType::Expand: unbekannter SubType" );
+ OSL_ENSURE( sal_False, "SwDocStatFieldType::Expand: unbekannter SubType" );
}
String sRet;
@@ -860,10 +838,7 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm )
pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() );
}
-/*-----------------05.03.98 11:38-------------------
-
---------------------------------------------------*/
-sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
{
@@ -871,16 +846,14 @@ sal_Bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= (sal_Int16)GetFormat();
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 11:38-------------------
---------------------------------------------------*/
-sal_Bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
switch ( nWhichId )
{
case FIELD_PROP_USHORT2:
@@ -892,13 +865,13 @@ sal_Bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
nSet != SVX_NUM_BITMAP)
{
SetFormat(nSet);
- bRet = sal_True;
+ bRet = true;
}
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
return bRet;
}
@@ -993,7 +966,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
aAny = xSet->getPropertyValue( rName );
uno::Reference < script::XTypeConverter > xConverter( comphelper::getProcessServiceFactory()
- ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY );
+ ->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), uno::UNO_QUERY );
uno::Any aNew;
aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
aNew >>= sVal;
@@ -1149,7 +1122,7 @@ String SwDocInfoField::Expand() const
// if the field is "fixed" we don't update it from the property
::rtl::OUString sVal;
uno::Reference < script::XTypeConverter > xConverter( comphelper::getProcessServiceFactory()
- ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY );
+ ->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), uno::UNO_QUERY );
util::Date aDate;
util::DateTime aDateTime;
util::Duration aDuration;
@@ -1261,7 +1234,7 @@ void SwDocInfoField::SetLanguage(sal_uInt16 nLng)
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -1306,12 +1279,12 @@ sal_Bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nValue = 0;
switch( nWhichId )
@@ -1356,7 +1329,7 @@ sal_Bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -1455,7 +1428,7 @@ String SwHiddenTxtField::Expand() const
void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
{
- ASSERT(pDoc, Wo ist das Dokument Seniore);
+ OSL_ENSURE(pDoc, "Wo ist das Dokument Seniore");
if( TYP_CONDTXTFLD == nSubType )
{
@@ -1469,7 +1442,7 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
else
sTmpName = aFALSETxt;
-// OS 21.08.97: #42943# Datenbankausdruecke muessen sich von
+// Datenbankausdruecke muessen sich von
// einfachem Text unterscheiden. also wird der einfache Text
// bevorzugt in Anfuehrungszeichen gesetzt.
// Sind diese vorhanden werden umschliessende entfernt.
@@ -1606,7 +1579,7 @@ sal_uInt16 SwHiddenTxtField::GetSubType() const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
const String* pOut = 0;
switch( nWhichId )
@@ -1630,16 +1603,16 @@ sal_Bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) con
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
if( pOut )
rAny <<= OUString( *pOut );
- return sal_True;
+ return true;
}
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-sal_Bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -1663,9 +1636,9 @@ sal_Bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
bValid = sal_True;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
//------------------------------------------------------------------------------
@@ -1743,10 +1716,8 @@ SwField* SwHiddenParaField::Copy() const
return pFld;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
-sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch ( nWhichId )
{
@@ -1761,14 +1732,12 @@ sal_Bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
-sal_Bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch ( nWhichId )
{
@@ -1780,9 +1749,9 @@ sal_Bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -1908,10 +1877,7 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
return (mpText) ? mpText->Count() : 1;
}
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
-sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -1966,16 +1932,12 @@ sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
-sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -1992,8 +1954,7 @@ sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
case FIELD_PROP_TEXT:
- DBG_ERROR("Not implemented!");
- // ::GetString( rAny, sTxt );
+ OSL_FAIL("Not implemented!");
break;
case FIELD_PROP_DATE:
if( rAny.getValueType() == ::getCppuType((util::Date*)0) )
@@ -2017,9 +1978,9 @@ sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: DokumentinfoFields
@@ -2064,7 +2025,7 @@ String SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) const
case EU_STATE: nRet = USER_OPT_STATE; break;
case EU_FATHERSNAME: nRet = USER_OPT_FATHERSNAME; break;
case EU_APARTMENT: nRet = USER_OPT_APARTMENT; break;
- default: ASSERT( !this, "Field unknown");
+ default: OSL_ENSURE( !this, "Field unknown");
}
if( USHRT_MAX != nRet )
{
@@ -2116,10 +2077,7 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub)
nType = nSub;
}
-/*-----------------05.03.98 14:14-------------------
-
---------------------------------------------------*/
-sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -2140,14 +2098,12 @@ sal_Bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 14:14-------------------
---------------------------------------------------*/
-sal_Bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -2169,9 +2125,9 @@ sal_Bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
SetFormat(GetFormat() & ~AF_FIXED);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
//-------------------------------------------------------------------------
@@ -2236,10 +2192,7 @@ void SwRefPageSetField::SetPar2(const String& rStr)
SetOffset( (short) rStr.ToInt32() );
}
-/*-----------------05.03.98 14:52-------------------
-
---------------------------------------------------*/
-sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -2250,14 +2203,12 @@ sal_Bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
rAny <<= (sal_Int16)nOffset;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
-sal_Bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -2268,9 +2219,9 @@ sal_Bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
rAny >>=nOffset;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: relatives Seitennummern - Abfrage Feld
@@ -2351,8 +2302,8 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
{
// einen sdbcx::Index fuers bestimmen vom TextNode anlegen
SwPosition aPos( pDoc->GetNodes().GetEndOfPostIts() );
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( *pDoc, aPos, *pFrm ),
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( *pDoc, aPos, *pFrm ),
"wo steht das Feld" );
#else
GetBodyTxtNode( *pDoc, aPos, *pFrm );
@@ -2461,7 +2412,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
sTxt.Erase();
- ASSERT( !pFrm->IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
+ OSL_ENSURE( !pFrm->IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
// sammel erstmal alle SetPageRefFelder ein.
_SetGetExpFlds aTmpLst( 10, 5 );
@@ -2507,10 +2458,8 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) );
}
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
-sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -2521,14 +2470,12 @@ sal_Bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
rAny <<= OUString(sTxt);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
-sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -2539,8 +2486,6 @@ sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
if(nSet <= SVX_NUM_PAGEDESC )
SetFormat(nSet);
else {
- //exception(wrong_value)
- ;
}
}
break;
@@ -2552,9 +2497,9 @@ sal_Bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -2643,10 +2588,7 @@ void SwJumpEditField::SetPar2(const String& rStr)
sHelp = rStr;
}
-/*-----------------05.03.98 15:00-------------------
-
---------------------------------------------------*/
-sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -2659,7 +2601,6 @@ sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
case JE_FMT_FRAME: nRet = text::PlaceholderType::TEXTFRAME; break;
case JE_FMT_GRAPHIC:nRet = text::PlaceholderType::GRAPHIC; break;
case JE_FMT_OLE: nRet = text::PlaceholderType::OBJECT; break;
-// case JE_FMT_TEXT:
default:
nRet = text::PlaceholderType::TEXT; break;
}
@@ -2673,14 +2614,12 @@ sal_Bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
rAny <<= OUString(sTxt);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 15:00-------------------
---------------------------------------------------*/
-sal_Bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -2708,9 +2647,9 @@ sal_Bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
::GetString( rAny, sTxt);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
@@ -2758,7 +2697,7 @@ void SwCombinedCharField::SetPar1(const String& rStr)
sCharacters = rStr.Copy( 0, MAX_COMBINED_CHARACTERS );
}
-sal_Bool SwCombinedCharField::QueryValue( uno::Any& rAny,
+bool SwCombinedCharField::QueryValue( uno::Any& rAny,
sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -2767,12 +2706,12 @@ sal_Bool SwCombinedCharField::QueryValue( uno::Any& rAny,
rAny <<= rtl::OUString( sCharacters );
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-sal_Bool SwCombinedCharField::PutValue( const uno::Any& rAny,
+bool SwCombinedCharField::PutValue( const uno::Any& rAny,
sal_uInt16 nWhichId )
{
switch( nWhichId )
@@ -2781,8 +2720,9 @@ sal_Bool SwCombinedCharField::PutValue( const uno::Any& rAny,
::GetString( rAny, sCharacters ).Erase( MAX_COMBINED_CHARACTERS );
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 80daf36db63b..bea6fe8eaf2a 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,7 +105,7 @@ sal_Int32 lcl_APIToSubType(const uno::Any& rAny)
case SetVariableType::FORMULA: nSet = nsSwGetSetExpType::GSE_FORMULA; break;
case SetVariableType::STRING: nSet = nsSwGetSetExpType::GSE_STRING; break;
default:
- DBG_ERROR("wrong value");
+ OSL_FAIL("wrong value");
nSet = -1;
}
return nSet;
@@ -150,7 +151,7 @@ SwTxtNode* GetFirstTxtNode( const SwDoc& rDoc, SwPosition& rPos,
while( 0 != (pCNd = rNodes.GoNext( &rPos.nNode ) ) &&
0 == ( pTxtNode = pCNd->GetTxtNode() ) )
;
- ASSERT( pTxtNode, "wo ist der 1.TextNode" );
+ OSL_ENSURE( pTxtNode, "wo ist der 1.TextNode" );
rPos.nContent.Assign( pTxtNode, 0 );
}
else if ( !pCFrm->IsValid() )
@@ -179,7 +180,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
{
// hole das FlyFormat
SwFrmFmt* pFlyFmt = ((SwFlyFrm*)pLayout)->GetFmt();
- ASSERT( pFlyFmt, "kein FlyFormat gefunden, wo steht das Feld" );
+ OSL_ENSURE( pFlyFmt, "kein FlyFormat gefunden, wo steht das Feld" );
const SwFmtAnchor &rAnchor = pFlyFmt->GetAnchor();
@@ -194,7 +195,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
(FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
(FLY_AS_CHAR == rAnchor.GetAnchorId()))
{
- ASSERT( rAnchor.GetCntntAnchor(), "keine gueltige Position" );
+ OSL_ENSURE( rAnchor.GetCntntAnchor(), "keine gueltige Position" );
rPos = *rAnchor.GetCntntAnchor();
pTxtNode = rPos.nNode.GetNode().GetTxtNode();
if ( FLY_AT_PARA == rAnchor.GetAnchorId() )
@@ -344,7 +345,7 @@ void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld )
if( bIsInBodyTxt ) // nur Felder in Footer, Header, FootNote, Flys
return;
- ASSERT( !rFrm.IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
+ OSL_ENSURE( !rFrm.IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
// bestimme mal das Dokument (oder geht es noch einfacher?)
const SwTxtNode* pTxtNode = &rFld.GetTxtNode();
@@ -425,10 +426,7 @@ void SwGetExpField::SetLanguage(sal_uInt16 nLng)
SwValueField::SetLanguage(nLng);
}
-/*-----------------07.03.98 16:08-------------------
-
---------------------------------------------------*/
-sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -462,12 +460,10 @@ sal_Bool SwGetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
-/*-----------------07.03.98 16:08-------------------
---------------------------------------------------*/
-sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nTmp = 0;
String sTmp;
@@ -504,10 +500,10 @@ sal_Bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
-/*-----------------JP: 17.06.93 -------------------
+/*-------------------------------------------------
Set-Expression-Type
--------------------------------------------------*/
@@ -650,17 +646,14 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd )
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwSetExpFieldType::SetChapter(..)> - text node with numbering rule, but without number. This is a serious defect -> inform OD" );
}
}
}
}
-/* -----------------24.03.99 09:44-------------------
- *
- * --------------------------------------------------*/
-sal_Bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -680,12 +673,12 @@ sal_Bool SwSetExpFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) co
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-sal_Bool SwSetExpFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwSetExpFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -717,9 +710,9 @@ sal_Bool SwSetExpFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
sal_Bool SwSeqFldList::InsertSort( _SeqFldLstElem* pNew )
@@ -909,7 +902,7 @@ void SwGetExpField::SetValue( const double& rAny )
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny, GetFormat(),
GetLanguage());
}
-/* -----------------14.07.99 12:21-------------------
+/* --------------------------------------------------
Description: Find the index of the reference text
following the current field
--------------------------------------------------*/
@@ -1060,10 +1053,7 @@ String SwInputField::Expand() const
return sRet;
}
-/*-----------------06.03.98 11:12-------------------
-
---------------------------------------------------*/
-sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -1080,14 +1070,12 @@ sal_Bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= OUString( aToolTip );
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------06.03.98 11:12-------------------
---------------------------------------------------*/
-sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -1104,9 +1092,9 @@ sal_Bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
::GetString( rAny, aToolTip );
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
Beschreibung: Bedingung setzen
@@ -1170,10 +1158,8 @@ void SwInputField::SetSubType(sal_uInt16 nSub)
{
nSubType = nSub;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
-sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -1235,12 +1221,10 @@ sal_Bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
-sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
sal_Int32 nTmp32 = 0;
sal_Int16 nTmp16 = 0;
@@ -1263,8 +1247,6 @@ sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
if(nTmp16 <= SVX_NUMBER_NONE )
SetFormat(nTmp16);
else {
- //exception(wrong_value)
- ;
}
}
break;
@@ -1317,8 +1299,9 @@ sal_Bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 47c6a0e4be12..b14864d52c98 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,7 +53,6 @@
#include <comcore.hrc>
#include <math.h>
-#include <float.h>
using namespace ::com::sun::star;
using namespace nsSwDocInfoSubType;
@@ -85,7 +85,7 @@ SvStringsDtor* SwFieldType::pFldNames = 0;
DBG_NAME(SwFieldType)
- sal_uInt16 __FAR_DATA aTypeTab[] = {
+ sal_uInt16 aTypeTab[] = {
/* RES_DBFLD */ TYP_DBFLD,
/* RES_USERFLD */ TYP_USERFLD,
/* RES_FILENAMEFLD */ TYP_FILENAMEFLD,
@@ -155,7 +155,7 @@ SwFieldType::SwFieldType( sal_uInt16 nWhichId )
DBG_CTOR( SwFieldType, 0 );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwFieldType::~SwFieldType()
{
@@ -169,13 +169,13 @@ const String& SwFieldType::GetName() const
return aEmptyStr;
}
-sal_Bool SwFieldType::QueryValue( uno::Any&, sal_uInt16 ) const
+bool SwFieldType::QueryValue( uno::Any&, sal_uInt16 ) const
{
- return sal_False;
+ return false;
}
-sal_Bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
+bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
{
- return sal_False;
+ return false;
}
/*--------------------------------------------------------------------
@@ -189,7 +189,7 @@ SwField::SwField(SwFieldType* pTyp, sal_uInt32 nFmt, sal_uInt16 nLng) :
bIsAutomaticLanguage(sal_True),
nFormat(nFmt)
{
- ASSERT( pTyp, "SwField: ungueltiger SwFieldType" );
+ OSL_ENSURE( pTyp, "SwField: ungueltiger SwFieldType" );
pType = pTyp;
}
@@ -201,18 +201,14 @@ SwField::~SwField()
Beschreibung: Statt Umweg ueber den Typ
--------------------------------------------------------------------*/
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 SwField::Which() const
{
- ASSERT(pType, "Kein Typ vorhanden");
+ OSL_ENSURE(pType, "Kein Typ vorhanden");
return pType->Which();
}
#endif
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwField::GetTypeId() const
{
@@ -307,16 +303,14 @@ void SwField::SetPar2(const String& )
sal_uInt16 SwField::GetSubType() const
{
-// ASSERT(0, "Sorry Not implemented");
return 0;
}
void SwField::SetSubType(sal_uInt16 )
{
-// ASSERT(0, "Sorry Not implemented");
}
-sal_Bool SwField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
+bool SwField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -327,11 +321,11 @@ sal_Bool SwField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-sal_Bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
+bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -343,9 +337,9 @@ sal_Bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
@@ -357,7 +351,7 @@ sal_Bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
SwFieldType* SwField::ChgTyp( SwFieldType* pNewType )
{
- ASSERT( pNewType && pNewType->Which() == pType->Which(),
+ OSL_ENSURE( pNewType && pNewType->Which() == pType->Which(),
"kein Typ oder ungleiche Typen" );
SwFieldType* pOld = pType;
@@ -455,7 +449,7 @@ String FormatNumber(sal_uInt16 nNum, sal_uInt32 nFormat)
return String::CreateFromInt32( nNum );
SvxNumberType aNumber;
- ASSERT(nFormat != SVX_NUM_NUMBER_NONE, "Falsches Nummern-Format" );
+ OSL_ENSURE(nFormat != SVX_NUM_NUMBER_NONE, "Falsches Nummern-Format" );
aNumber.SetNumberingType((sal_Int16)nFormat);
return aNumber.GetNumStr(nNum);
@@ -519,7 +513,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
else
nFmt = nNewFormat;
}
- ASSERT(pEntry, "Unbekanntes Zahlenformat!");
+ OSL_ENSURE(pEntry, "Unbekanntes Zahlenformat!");
}
if( pFormatter->IsTextFormat( nFmt ) )
@@ -534,10 +528,6 @@ String SwValueFieldType::ExpandValue( const double& rVal,
return sExpand;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
sal_uInt32 nFmt) const
{
@@ -548,10 +538,6 @@ void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
DoubleToString(rValue, rVal, pEntry->GetLanguage());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
sal_uInt16 nLng ) const
{
@@ -682,17 +668,13 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
}
SetFormat( nNewFormat );
}
- ASSERT(pEntry, "Unbekanntes Zahlenformat!");
+ OSL_ENSURE(pEntry, "Unbekanntes Zahlenformat!");
}
}
SwField::SetLanguage(nLng);
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
double SwValueField::GetValue() const
{
return fValue;
@@ -718,19 +700,11 @@ SwFormulaField::SwFormulaField( const SwFormulaField& rFld )
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String SwFormulaField::GetFormula() const
{
return sFormula;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFormulaField::SetFormula(const String& rStr)
{
sFormula = rStr;
@@ -746,10 +720,6 @@ void SwFormulaField::SetFormula(const String& rStr)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwFormulaField::SetExpandedFormula( const String& rStr )
{
sal_uInt32 nFmt(GetFormat());
@@ -772,10 +742,6 @@ void SwFormulaField::SetExpandedFormula( const String& rStr )
sFormula = rStr;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String SwFormulaField::GetExpandedFormula() const
{
sal_uInt32 nFmt(GetFormat());
@@ -806,3 +772,5 @@ String SwField::GetDescription() const
{
return SW_RES(STR_FIELD);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 253477f118e0..098d7a49ffb9 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// #include <math.h>
#include <tools/datetime.hxx>
#include <svl/zforlist.hxx>
#include <com/sun/star/util/DateTime.hpp>
@@ -46,10 +46,6 @@ SwDateTimeFieldType::SwDateTimeFieldType(SwDoc* pInitDoc)
: SwValueFieldType( pInitDoc, RES_DATETIMEFLD )
{}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwFieldType* SwDateTimeFieldType::Copy() const
{
SwDateTimeFieldType *pTmp = new SwDateTimeFieldType(GetDoc());
@@ -80,10 +76,6 @@ SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String SwDateTimeField::Expand() const
{
double fVal;
@@ -102,10 +94,6 @@ String SwDateTimeField::Expand() const
return ExpandValue(fVal, GetFormat(), GetLanguage());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwField* SwDateTimeField::Copy() const
{
SwDateTimeField *pTmp =
@@ -119,36 +107,21 @@ SwField* SwDateTimeField::Copy() const
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
sal_uInt16 SwDateTimeField::GetSubType() const
{
return nSubType;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDateTimeField::SetSubType(sal_uInt16 nType)
{
nSubType = nType;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwDateTimeField::SetPar2(const String& rStr)
{
nOffset = rStr.ToInt32();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
String SwDateTimeField::GetPar2() const
{
if (nOffset)
@@ -157,19 +130,11 @@ String SwDateTimeField::GetPar2() const
return aEmptyStr;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SwDateTimeField::SetDateTime(const DateTime& rDT)
{
SetValue(GetDateTime(GetDoc(), rDT));
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
double SwDateTimeField::GetDateTime(SwDoc* pDoc, const DateTime& rDT)
{
SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter();
@@ -180,10 +145,6 @@ double SwDateTimeField::GetDateTime(SwDoc* pDoc, const DateTime& rDT)
return fResult;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
double SwDateTimeField::GetValue() const
{
if (IsFixed())
@@ -192,10 +153,6 @@ double SwDateTimeField::GetValue() const
return GetDateTime(GetDoc(), DateTime());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
Date SwDateTimeField::GetDate(sal_Bool bUseOffset) const
{
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
@@ -211,10 +168,6 @@ Date SwDateTimeField::GetDate(sal_Bool bUseOffset) const
return aDate;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
Time SwDateTimeField::GetTime(sal_Bool bUseOffset) const
{
double fDummy;
@@ -226,10 +179,7 @@ Time SwDateTimeField::GetTime(sal_Bool bUseOffset) const
return (Time)aDT;
}
-/*-----------------04.03.98 11:05-------------------
-
---------------------------------------------------*/
-sal_Bool SwDateTimeField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
+bool SwDateTimeField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -269,12 +219,10 @@ sal_Bool SwDateTimeField::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) cons
default:
return SwField::QueryValue(rVal, nWhichId);
}
- return sal_True;
+ return true;
}
-/*-----------------04.03.98 11:05-------------------
---------------------------------------------------*/
-sal_Bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
+bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
{
sal_Int32 nTmp = 0;
switch( nWhichId )
@@ -316,6 +264,7 @@ sal_Bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
default:
return SwField::PutValue(rVal, nWhichId);
}
- return sal_True;
+ return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/flddropdown.cxx b/sw/source/core/fields/flddropdown.cxx
index 44e625edfccb..0e866b1e1c51 100644
--- a/sw/source/core/fields/flddropdown.cxx
+++ b/sw/source/core/fields/flddropdown.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#endif
#include <svl/poolitem.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <unoprnms.hxx>
using namespace com::sun::star;
@@ -142,7 +141,7 @@ uno::Sequence<OUString> SwDropDownField::GetItemSequence() const
int i = 0;
vector<String>::const_iterator aIt;
- for (aIt = aValues.begin(); aIt != aValues.end(); aIt++)
+ for (aIt = aValues.begin(); aIt != aValues.end(); ++aIt)
{
pSeq[i] = rtl::OUString(*aIt);
@@ -200,7 +199,7 @@ void SwDropDownField::SetToolTip(const String & rToolTip)
aToolTip = rToolTip;
}
-sal_Bool SwDropDownField::QueryValue(::uno::Any &rVal, sal_uInt16 nWhich) const
+bool SwDropDownField::QueryValue(::uno::Any &rVal, sal_uInt16 nWhich) const
{
nWhich &= ~CONVERT_TWIPS;
switch( nWhich )
@@ -223,12 +222,12 @@ sal_Bool SwDropDownField::QueryValue(::uno::Any &rVal, sal_uInt16 nWhich) const
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-sal_Bool SwDropDownField::PutValue(const uno::Any &rVal,
+bool SwDropDownField::PutValue(const uno::Any &rVal,
sal_uInt16 nWhich)
{
switch( nWhich )
@@ -278,7 +277,9 @@ sal_Bool SwDropDownField::PutValue(const uno::Any &rVal,
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 2777dc82e9b4..a7ee49314997 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,7 +115,7 @@ sal_uInt16 SwInputFieldList::Count() const
SwField* SwInputFieldList::GetField(sal_uInt16 nId)
{
const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetFld();
- ASSERT( pTxtFld, "kein TextFld" );
+ OSL_ENSURE( pTxtFld, "kein TextFld" );
return (SwField*)pTxtFld->GetFld().GetFld();
}
@@ -231,3 +232,4 @@ void SwInputFieldList::RemoveUnselectedFlds()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index 17926457ea3f..023eb68f800c 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -172,10 +173,7 @@ String SwMacroField::GetPar2() const
return aText;
}
-/*-----------------05.03.98 13:38-------------------
-
---------------------------------------------------*/
-sal_Bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -192,14 +190,12 @@ sal_Bool SwMacroField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= bIsScriptURL ? OUString(GetMacroName()): OUString();
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 13:38-------------------
---------------------------------------------------*/
-sal_Bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
String sTmp;
switch( nWhichId )
@@ -218,10 +214,10 @@ sal_Bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
bIsScriptURL = isScriptURL(aMacro);
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
// create an internally used macro name from the library and macro name parts
@@ -244,8 +240,8 @@ sal_Bool SwMacroField::isScriptURL( const String& str )
uno::Reference< uri::XUriReferenceFactory >
xFactory( xSMgr->createInstance(
- OUString::createFromAscii(
- "com.sun.star.uri.UriReferenceFactory" ) ), uno::UNO_QUERY );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uri.UriReferenceFactory")) ), uno::UNO_QUERY );
if ( xFactory.is() )
{
@@ -259,3 +255,5 @@ sal_Bool SwMacroField::isScriptURL( const String& str )
}
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 1d76dce43117..fb57eebdeef3 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,9 +65,9 @@ struct LayoutInfoOrder
else
{
// corresponding <SwFrm> instances are in different repeating table header rows
- ASSERT( rLayoutInfo.mpAnchorFrm->FindTabFrm(),
+ OSL_ENSURE( rLayoutInfo.mpAnchorFrm->FindTabFrm(),
"<LayoutInfoOrder::operator()> - table frame not found" );
- ASSERT( rNewLayoutInfo.mpAnchorFrm->FindTabFrm(),
+ OSL_ENSURE( rNewLayoutInfo.mpAnchorFrm->FindTabFrm(),
"<LayoutInfoOrder::operator()> - table frame not found" );
const SwTabFrm* pLayoutInfoTabFrm( rLayoutInfo.mpAnchorFrm->FindTabFrm() );
const SwTabFrm* pNewLayoutInfoTabFrm( rNewLayoutInfo.mpAnchorFrm->FindTabFrm() );
@@ -205,19 +206,4 @@ sw::sidebarwindows::SwSidebarWin* SwAnnotationItem::GetSidebarWindow(
pFmtFld );
}
-/*
-SwPosition SwRedCommentItem::GetAnchorPosition()
-{
- return *pRedline->Start();
-}
-
-SwSidebarWin* SwRedCommentItem::GetSidebarWindow(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits)
-{
- return new SwRedComment(pParent,nBits,aMgr,aBits,pRedline);
-}
-
-bool SwRedCommentItem::UseElement()
-{
- return true;
-}
-*/
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 46bdd962df09..5a1b83fe4e5c 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -466,7 +467,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
break;
// <--
default:
- DBG_ERROR("<SwGetRefField::UpdateField(..)> - unknown format type");
+ OSL_FAIL("<SwGetRefField::UpdateField(..)> - unknown format type");
}
}
@@ -478,7 +479,7 @@ String SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField,
if ( rTxtNodeOfReferencedItem.HasNumber() &&
rTxtNodeOfReferencedItem.IsCountedInList() )
{
- ASSERT( rTxtNodeOfReferencedItem.GetNum(),
+ OSL_ENSURE( rTxtNodeOfReferencedItem.GetNum(),
"<SwGetRefField::MakeRefNumStr(..)> - referenced paragraph has number, but no <SwNodeNum> instance --> please inform OD!" );
// Determine, up to which level the superior list labels have to be
@@ -534,7 +535,7 @@ String SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField,
( nRestrictInclToThisLevel < rTxtNodeOfReferencedItem.GetActualListLevel() &&
( nRefNumFormat == REF_NUMBER || nRefNumFormat == REF_NUMBER_FULL_CONTEXT ) ) );
- ASSERT( rTxtNodeOfReferencedItem.GetNumRule(),
+ OSL_ENSURE( rTxtNodeOfReferencedItem.GetNumRule(),
"<SwGetRefField::MakeRefNumStr(..)> - referenced numbered paragraph has no numbering rule set --> please inform OD!" );
return rTxtNodeOfReferencedItem.GetNumRule()->MakeRefNumString(
*(rTxtNodeOfReferencedItem.GetNum()),
@@ -577,10 +578,7 @@ String SwGetRefField::GetPar2() const
return Expand();
}
-/*-----------------06.03.98 13:34-------------------
-
---------------------------------------------------*/
-sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -614,7 +612,7 @@ sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
case REF_SETREFATTR : nSource = ReferenceFieldSource::REFERENCE_MARK; break;
case REF_SEQUENCEFLD: nSource = ReferenceFieldSource::SEQUENCE_FIELD; break;
case REF_BOOKMARK : nSource = ReferenceFieldSource::BOOKMARK; break;
- case REF_OUTLINE : DBG_ERROR("not implemented"); break;
+ case REF_OUTLINE : OSL_FAIL("not implemented"); break;
case REF_FOOTNOTE : nSource = ReferenceFieldSource::FOOTNOTE; break;
case REF_ENDNOTE : nSource = ReferenceFieldSource::ENDNOTE; break;
}
@@ -647,14 +645,12 @@ sal_Bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= (sal_Int16)nSeqNo;
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------06.03.98 13:34-------------------
---------------------------------------------------*/
-sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
String sTmp;
switch( nWhichId )
@@ -678,7 +674,7 @@ sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 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 sal_False;
+ default: return false;
}
SetFormat(nPart);
}
@@ -724,13 +720,11 @@ sal_Bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/* -----------------------------11.01.2002 12:50------------------------------
- ---------------------------------------------------------------------------*/
void SwGetRefField::ConvertProgrammaticToUIName()
{
if(GetTyp() && REF_SEQUENCEFLD == nSubType)
@@ -812,7 +806,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
sal_uInt16 nSubType, sal_uInt16 nSeqNo,
sal_uInt16* pStt, sal_uInt16* pEnd )
{
- ASSERT( pStt, "warum wird keine StartPos abgefragt?" );
+ OSL_ENSURE( pStt, "warum wird keine StartPos abgefragt?" );
SwTxtNode* pTxtNd = 0;
switch( nSubType )
@@ -873,7 +867,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
// --> OD 2007-10-18 #i81002#
if(dynamic_cast< ::sw::mark::CrossRefBookmark const *>(pBkmk))
{
- ASSERT( pTxtNd,
+ OSL_ENSURE( pTxtNd,
"<SwGetRefFieldType::FindAnchor(..)> - node marked by cross-reference bookmark isn't a text node --> crash" );
*pEnd = pTxtNd->Len();
}
@@ -1088,3 +1082,4 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/scrptfld.cxx b/sw/source/core/fields/scrptfld.cxx
index 22c6ba695a05..3db79ca70afd 100644
--- a/sw/source/core/fields/scrptfld.cxx
+++ b/sw/source/core/fields/scrptfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,12 +31,8 @@
#include <docufld.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <tools/resid.hxx>
using namespace ::com::sun::star;
@@ -108,10 +105,8 @@ String SwScriptField::GetPar2() const
{
return sCode;
}
-/*-----------------05.03.98 15:00-------------------
---------------------------------------------------*/
-sal_Bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -125,14 +120,12 @@ sal_Bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny.setValue(&bCodeURL, ::getBooleanCppuType());
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------05.03.98 15:00-------------------
---------------------------------------------------*/
-sal_Bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -146,8 +139,9 @@ sal_Bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
bCodeURL = *(sal_Bool*)rAny.getValue();
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index 5d6500ec3646..c3f081a3f2dd 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -186,13 +187,9 @@ void SwTblField::SetPar2(const String& rStr)
SetFormula( rStr );
}
-
-/*-----------------04.03.98 10:33-------------------
-
---------------------------------------------------*/
-sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nWhichId )
{
case FIELD_PROP_PAR2:
@@ -217,16 +214,14 @@ sal_Bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
rAny <<= (sal_Int32)GetFormat();
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-/*-----------------04.03.98 10:33-------------------
---------------------------------------------------*/
-sal_Bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
String sTmp;
switch ( nWhichId )
{
@@ -250,11 +245,9 @@ sal_Bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx
index 1e994f536801..09d2ddc20fae 100755..100644
--- a/sw/source/core/fields/textapi.cxx
+++ b/sw/source/core/fields/textapi.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -189,3 +190,5 @@ String SwTextAPIEditSource::GetText()
else
return String();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index 8ecb54472f45..8909f588f842 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126,10 +127,7 @@ void SwUserField::SetSubType(sal_uInt16 nSub)
nSubType = nSub & 0xff00;
}
-/*-----------------09.03.98 08:04-------------------
-
---------------------------------------------------*/
-sal_Bool SwUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -151,12 +149,10 @@ sal_Bool SwUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
default:
return SwField::QueryValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
-/*-----------------09.03.98 08:04-------------------
---------------------------------------------------*/
-sal_Bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -182,7 +178,7 @@ sal_Bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
default:
return SwField::PutValue(rAny, nWhichId);
}
- return sal_True;
+ return true;
}
/*--------------------------------------------------------------------
@@ -308,10 +304,7 @@ void SwUserFieldType::SetContent( const String& rStr, sal_uInt32 nFmt )
}
}
-/*-----------------04.03.98 17:05-------------------
-
---------------------------------------------------*/
-sal_Bool SwUserFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
+bool SwUserFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
{
@@ -328,14 +321,12 @@ sal_Bool SwUserFieldType::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) cons
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
-/*-----------------04.03.98 17:05-------------------
---------------------------------------------------*/
-sal_Bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
+bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
switch( nWhichId )
{
@@ -368,10 +359,11 @@ sal_Bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
default:
- DBG_ERROR("illegal property");
+ OSL_FAIL("illegal property");
}
- return sal_True;
+ return true;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index b433c17af7ed..f2a53816c0fe 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,12 +52,8 @@
#include <svx/svdoole2.hxx>
#include <svx/fmmodel.hxx>
#include <svx/unomodel.hxx>
-// --> OD 2005-08-03 #i50824#
-#include <svx/svditer.hxx>
-// <--
-// --> OD 2006-03-01 #b6382898#
+#include <svx/svditer.hxx> // #i50824#
#include <svx/svdograf.hxx>
-// <--
#include <unotools/streamwrap.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
@@ -96,14 +93,11 @@ using namespace ::com::sun::star;
|* SwFEShell::Copy() Copy fuer das Interne Clipboard.
|* Kopiert alle Selektionen in das Clipboard.
|*
-|* Ersterstellung JP ??
-|* Letzte Aenderung MA 22. Feb. 95
-|
|*************************************************************************/
sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
{
- ASSERT( pClpDoc, "kein Clipboard-Dokument" );
+ OSL_ENSURE( pClpDoc, "kein Clipboard-Dokument" );
pClpDoc->GetIDocumentUndoRedo().DoUndo(false); // always false!
@@ -169,7 +163,7 @@ sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
if( rSpzFrmFmts[ 0 ] != pFlyFmt )
{
sal_uInt16 nPos = rSpzFrmFmts.GetPos( pFlyFmt );
- ASSERT( nPos != USHRT_MAX, "Fly steht nicht im Spz-Array" );
+ OSL_ENSURE( nPos != USHRT_MAX, "Fly steht nicht im Spz-Array" );
rSpzFrmFmts.Remove( nPos );
rSpzFrmFmts.Insert( pFlyFmt, 0 );
@@ -468,8 +462,8 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
{
sal_Bool bRet = sal_False;
- ASSERT( pDestShell, "Copy ohne DestShell." );
- ASSERT( this == pDestShell || !pDestShell->IsObjSelected(),
+ OSL_ENSURE( pDestShell, "Copy ohne DestShell." );
+ OSL_ENSURE( this == pDestShell || !pDestShell->IsObjSelected(),
"Dest-Shell darf nie im Obj-Modus sein" );
SET_CURR_SHELL( pDestShell );
@@ -550,7 +544,7 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
aNewAnch = pPg->Frm().Pos();
}
else {
- ASSERT( !this, "was fuer ein Anchor ist es denn?" );
+ OSL_ENSURE( !this, "was fuer ein Anchor ist es denn?" );
}
if( bRet )
@@ -693,9 +687,6 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
|* SwFEShell::Paste() Paste fuer das Interne Clipboard.
|* Kopiert den Inhalt vom Clipboard in das Dokument.
|*
-|* Ersterstellung JP ??
-|* Letzte Aenderung MA 22. Feb. 95
-|
|*************************************************************************/
namespace {
@@ -707,7 +698,7 @@ namespace {
sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
{
SET_CURR_SHELL( this );
- ASSERT( pClpDoc, "kein Clipboard-Dokument" );
+ OSL_ENSURE( pClpDoc, "kein Clipboard-Dokument" );
const sal_uInt16 nStartPageNumber = GetPhyPageNum();
// dann bis zum Ende vom Nodes Array
SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -773,7 +764,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
while( nCount )
{
--nCount;
- ASSERT( aIdx.GetNode().GetCntntNode(), "Who filled the clipboard?!" )
+ OSL_ENSURE( aIdx.GetNode().GetCntntNode(), "Who filled the clipboard?!" );
if( aIdx.GetNode().GetCntntNode() ) // robust
{
Insertion aInsertion( PaMPtr( new SwPaM( aIdx ) ),
@@ -874,7 +865,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
// dann die Tabelle "relativ" kopieren
SwTableBox* pBox = pDestNd->GetTable().GetTblBox(
pSttNd->GetIndex() );
- ASSERT( pBox, "Box steht nicht in dieser Tabelle" );
+ OSL_ENSURE( pBox, "Box steht nicht in dieser Tabelle" );
aBoxes.Insert( pBox );
}
@@ -978,7 +969,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
(FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
SwPosition* pPos = PCURCRSR->GetPoint();
- // #108784# allow shapes (no controls) in header/footer
+ // allow shapes (no controls) in header/footer
if( RES_DRAWFRMFMT == rCpyFmt.Which() &&
GetDoc()->IsInHeaderFooter( pPos->nNode ) &&
CheckControlLayer( rCpyFmt.FindSdrObject() ) )
@@ -1014,7 +1005,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
}
else
{
- ASSERT( RES_DRAWFRMFMT == pNew->Which(), "Neues Format.");
+ OSL_ENSURE( RES_DRAWFRMFMT == pNew->Which(), "Neues Format.");
// --> OD 2005-09-01 #i52780# - drawing object has
// to be made visible on paste.
{
@@ -1134,9 +1125,6 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
return bRet;
}
-/*-- 14.06.2004 13:31:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage)
{
Push();
@@ -1226,7 +1214,7 @@ sal_Bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_u
sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
{
- ASSERT( Imp()->HasDrawView(), "GetDrawObjGraphic without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "GetDrawObjGraphic without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
sal_Bool bConvert = sal_True;
if( rMrkList.GetMarkCount() )
@@ -1237,7 +1225,6 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
// Rahmen selektiert
if( CNT_GRF == GetCntType() )
{
- // --> OD 2005-02-09 #119353# - robust
const Graphic* pGrf( GetGraphic() );
if ( pGrf )
{
@@ -1298,7 +1285,6 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
}
}
}
- // <--
}
}
else if( SOT_FORMAT_GDIMETAFILE == nFmt )
@@ -1310,7 +1296,6 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
}
// --> OD 2005-08-03 #i50824#
-// --> OD 2006-03-01 #b6382898#
// replace method <lcl_RemoveOleObjsFromSdrModel> by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
{
@@ -1347,7 +1332,7 @@ void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
}
}
}
-// <--
+
void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
{
SET_CURR_SHELL( this );
@@ -1375,7 +1360,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
1 == pModel->GetPage(0)->GetObjCount() &&
1 == pView->GetMarkedObjectList().GetMarkCount() )
{
- // OD 10.07.2003 #110742# - replace a marked 'virtual' drawing object
+ // replace a marked 'virtual' drawing object
// by its corresponding 'master' drawing object in the mark list.
SwDrawView::ReplaceMarkedDrawVirtObjs( *pView );
@@ -1441,7 +1426,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
const SwTxtFrm* pTmp = (SwTxtFrm*)pAnchor;
do {
pTmp = pTmp->FindMaster();
- ASSERT( pTmp, "Where's my Master?" );
+ OSL_ENSURE( pTmp, "Where's my Master?" );
} while( pTmp->IsFollow() );
pAnchor = pTmp;
}
@@ -1492,10 +1477,8 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
pView->SetDesignMode( sal_True );
// --> OD 2005-08-03 #i50824#
- // --> OD 2006-03-01 #b6382898#
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
- // <--
pView->Paste( *pModel, aPos );
sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
@@ -1552,3 +1535,5 @@ sal_Bool SwFEShell::Paste( const Graphic &rGrf )
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index 0c79bc4ed159..11ea45c3cdea 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,9 +49,6 @@
|*
|* SwFEShell::GetPageDescCnt()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 25. Jan. 93
-|*
|*************************************************************************/
sal_uInt16 SwFEShell::GetPageDescCnt() const
@@ -62,21 +60,18 @@ sal_uInt16 SwFEShell::GetPageDescCnt() const
|*
|* SwFEShell::ChgCurPageDesc()
|*
-|* Ersterstellung ST ??
-|* Letzte Aenderung MA 01. Aug. 94
-|*
|*************************************************************************/
void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//Die SS veraendert keinen PageDesc, sondern setzt nur das Attribut.
//Der Pagedesc muss im Dokument vorhanden sein!
sal_Bool bFound = sal_False;
for ( sal_uInt16 nTst = 0; nTst < GetPageDescCnt(); ++nTst )
if ( &rDesc == &GetPageDesc( nTst ) )
bFound = sal_True;
- ASSERT( bFound, "ChgCurPageDesc mit ungueltigem Descriptor." );
+ OSL_ENSURE( bFound, "ChgCurPageDesc mit ungueltigem Descriptor." );
#endif
StartAllAction();
@@ -85,7 +80,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
const SwFrm *pFlow = 0;
sal_uInt16 nPageNmOffset = 0;
- ASSERT( !GetCrsr()->HasMark(), "ChgCurPageDesc nur ohne Selektion!");
+ OSL_ENSURE( !GetCrsr()->HasMark(), "ChgCurPageDesc nur ohne Selektion!");
SET_CURR_SHELL( this );
while ( pPage )
@@ -113,7 +108,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
{
pPage = (SwPageFrm*)pPage->GetNext();
pFlow = pPage->FindFirstBodyCntnt();
- ASSERT( pFlow, "Dokuemnt ohne Inhalt?!?" );
+ OSL_ENSURE( pFlow, "Dokuemnt ohne Inhalt?!?" );
}
}
@@ -135,9 +130,6 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
|*
|* SwFEShell::ChgPageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 24. Jan. 95
-|*
|*************************************************************************/
void SwFEShell::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
@@ -159,9 +151,6 @@ void SwFEShell::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
|*
|* SwFEShell::GetPageDesc(), GetCurPageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 23. Apr. 93
-|
|*************************************************************************/
const SwPageDesc& SwFEShell::GetPageDesc( sal_uInt16 i ) const
@@ -291,3 +280,4 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 13db6377c8e2..125c789f0ee3 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,17 +74,11 @@
#include <swundo.hxx>
#include <frame.hxx>
#include <notxtfrm.hxx>
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <frmatr.hxx>
-// --> 3.7.2010 #i972#
+#include <fmtsrnd.hxx> // #i89920#
#include <ndole.hxx>
-// <--
-// --> OD 2009-12-29 #i89920#
-#include <fmtsrnd.hxx>
#include <editeng/opaqitem.hxx>
-// <--
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -97,8 +92,6 @@ void RegistFlys( SwPageFrm*, const SwLayoutFrm* );
#* Methode : UseSpzLayoutFmt
#* Beschreibung: Anhand des Request werden zu dem Format entsprechende
#* Aenderungen an den Spezifischen Layouts vorgenommen.
-#* Datum : MA 23. Sep. 92
-#* Update : JP 09.03.98
#***********************************************************************/
sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
@@ -201,7 +194,7 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
break;
default:
- ASSERT( !&rDoc, "Falsche ID fuer neuen Anker." );
+ OSL_ENSURE( !&rDoc, "Falsche ID fuer neuen Anker." );
}
rSet.Put( aNewAnch );
@@ -224,8 +217,8 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
SwDoc* pDoc = (SwDoc*)rFmt.GetDoc();
-#ifdef DBG_UTIL
- ASSERT( !(nNew == FLY_AT_PAGE &&
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( !(nNew == FLY_AT_PAGE &&
(FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) &&
pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )),
"Unerlaubter Ankerwechsel in Head/Foot." );
@@ -248,7 +241,7 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
SwViewImp *pImpl = Imp();
if( GetWin() && (bNew || !pImpl->GetDrawView()->AreObjectsMarked()) )
{
- ASSERT( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" );
+ OSL_ENSURE( rFrm.IsFlyFrm(), "SelectFlyFrm will einen Fly" );
//Wenn der Fly bereits selektiert ist gibt es hier ja wohl nichts
//zu tun.
@@ -259,13 +252,6 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
if( rFrm.IsFlyInCntFrm() && rFrm.GetAnchorFrm() )
rFrm.GetAnchorFrm()->SetCompletePaint();
- // --> OD 2004-06-11 #i28701# - no format at all.
-// //Hier wurde immer kalkuliert. Leider ist der Sonderfall Fly in Fly mit
-// //Spalten u.U. sehr kritisch wenn der innenliegende zuerst formatiert
-// //wird. Um kein Risiko einzugehen entschaerfen wir nur diesen Sonderfall.
-// if( !rFrm.GetAnchorFrm()->IsInFly() )
-// rFrm.Calc();
-
if( pImpl->GetDrawView()->AreObjectsMarked() )
pImpl->GetDrawView()->UnmarkAll();
@@ -282,8 +268,6 @@ void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew )
|* SwFEShell::FindFlyFrm()
|*
|* Beschreibung Liefert den Fly wenn einer Selektiert ist.
-|* Ersterstellung MA 03. Nov. 92
-|* Letzte Aenderung MA 05. Mar. 96
|*
*************************************************************************/
@@ -308,8 +292,6 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
|*
|* Beschreibung Liefert sal_True, wenn der aktuelle Fly an einem anderen
|* verankert werden koennte (also innerhalb ist)
-|* Ersterstellung AMA 11. Sep. 97
-|* Letzte Aenderung AMA 14. Jan. 98
|*
*************************************************************************/
@@ -343,8 +325,8 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
const SwFrm* pFly = pObj->ISA(SwVirtFlyDrawObj) ?
((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetAnchorFrm() :
((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
- ASSERT( pFly, "IsFlyInFly: Where's my anchor?" );
- ASSERT( pFly->IsFlyFrm(), "IsFlyInFly: Funny anchor!" );
+ OSL_ENSURE( pFly, "IsFlyInFly: Where's my anchor?" );
+ OSL_ENSURE( pFly->IsFlyFrm(), "IsFlyInFly: Funny anchor!" );
return ((SwFlyFrm*)pFly)->GetFmt();
}
@@ -358,9 +340,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
Point aPoint( aTmpPos );
aPoint.X() -= 1; //nicht im Fly landen!!
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
- // OD 01.07.2003 #108784# - determine text frame by left-top-corner
- // of object
- //pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False );
+ // determine text frame by left-top-corner of object
pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aTmpPos, 0, sal_False );
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos );
@@ -374,9 +354,6 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
|*
|* SwFEShell::SetFlyPos
|*
-|* Ersterstellung MA 14. Jan. 93
-|* Letzte Aenderung MA 14. Feb. 95
-|*
*************************************************************************/
void SwFEShell::SetFlyPos( const Point& rAbsPos )
@@ -401,8 +378,6 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
else
{
const SwFrm *pAnch = pFly->GetAnchorFrm();
- // --> OD 2004-06-11 #i28701# - no format here
-// pAnch->Calc();
Point aOrient( pAnch->Frm().Pos() );
if ( pFly->IsFlyInCntFrm() )
@@ -413,8 +388,6 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
aOrient.Y() = rAbsPos.Y() - aOrient.Y();
pFly->ChgRelPos( aOrient );
}
- // --> OD 2004-06-11 #i28701# - no format here
-// pFly->Calc();
CallChgLnk(); // rufe das AttrChangeNotify auf der UI-Seite.
}
@@ -422,9 +395,6 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
|*
|* SwFEShell::FindAnchorPos
|*
-|* Ersterstellung AMA 24. Sep. 97
-|* Letzte Aenderung AMA 24. Sep. 97
-|*
*************************************************************************/
Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
@@ -473,7 +443,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
pFooterOrHeader = pCntnt->FindFooterOrHeader();
}
}
- // OD 26.06.2003 #108784# - set <pFooterOrHeader> also for drawing
+ // set <pFooterOrHeader> also for drawing
// objects, but not for control objects.
// Necessary for moving 'anchor symbol' at the user interface inside header/footer.
else if ( !::CheckControlLayer( pObj ) )
@@ -582,8 +552,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
if( bMoveIt )
{
StartAllAction();
- // --> OD 2006-02-28 #125892#
- // handle change of anchor node:
+ // --> handle change of anchor node:
// if count of the anchor frame also change, the fly frames have to be
// re-created. Thus, delete all fly frames except the <this> before the
// anchor attribute is change and re-create them afterwards.
@@ -614,11 +583,11 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
SwRect aTmpRect( aRet, rAbsPos );
if( aTmpRect.HasArea() )
MakeVisible( aTmpRect );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//TODO: That doesn't seem to be intended
if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() )
{
- ASSERT( sal_False, "Hey, Joe: Where's my Null Pen?" );
+ OSL_ENSURE( sal_False, "Hey, Joe: Where's my Null Pen?" );
GetOut()->SetLineColor( Color(COL_TRANSPARENT) );
}
#endif
@@ -632,8 +601,6 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
#* Class : SwFEShell
#* Methode : NewFlyFrm
#* Beschreibung:
-#* Datum : MA 03. Nov. 92
-#* Update : JP 11. Aug. 93
#***********************************************************************/
const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchValid,
@@ -662,9 +629,6 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
// we better get the current pCurCrsr instead of working with the
// deleted one:
pCrsr = GetCrsr();
- // <--
-
-// KillPams();
}
else
bMoveCntnt = sal_False;
@@ -701,7 +665,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
break;
default:
- ASSERT( !this, "Was sollte das fuer ein Fly werden?" )
+ OSL_ENSURE( !this, "Was sollte das fuer ein Fly werden?" );
break;
}
@@ -794,7 +758,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_INSLAYFMT, NULL );
}
else
- /* #109161# If called from a shell try to propagate an
+ /* 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, sal_True );
@@ -818,8 +782,6 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
/***********************************************************************
#* Class : SwFEShell
#* Methode : Insert
-#* Datum : ??
-#* Update : MA 12. Sep. 94
#***********************************************************************/
void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
@@ -876,7 +838,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
rFltName, pGraphic,
pFlyAttrSet,
pGrfAttrSet, pFrmFmt );
- ASSERT( pFmt, "Doc->Insert(notxt) failed." );
+ OSL_ENSURE( pFmt, "Doc->Insert(notxt) failed." );
} while( (pCursor = dynamic_cast<SwShellCrsr*>(pCursor->GetNext()))
!= pStartCursor );
@@ -906,7 +868,7 @@ SwFlyFrmFmt* SwFEShell::InsertObject( const svt::EmbeddedObjectRef& xObj,
FOREACHPAM_START( this )
pFmt = GetDoc()->Insert(*PCURCRSR, xObj,
pFlyAttrSet, pGrfAttrSet, pFrmFmt );
- ASSERT( pFmt, "Doc->Insert(notxt) failed." );
+ OSL_ENSURE( pFmt, "Doc->Insert(notxt) failed." );
FOREACHPAM_END()
EndAllAction();
@@ -975,8 +937,6 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
/***********************************************************************
#* Class : SwFEShell
#* Methode : GetPageObjs
-#* Datum : ??
-#* Update : MA 11. Jan. 95
#***********************************************************************/
void SwFEShell::GetPageObjs( SvPtrarr& rFillArr )
@@ -998,8 +958,6 @@ void SwFEShell::GetPageObjs( SvPtrarr& rFillArr )
/***********************************************************************
#* Class : SwFEShell
#* Methode : SetPageFlysNewPage
-#* Datum : ??
-#* Update : MA 14. Feb. 95
#***********************************************************************/
void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
@@ -1059,8 +1017,6 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
#* Attributen des aktuellen FlyFrms gefuellt.
#* Sind Attribute nicht zu fuellen weil fehl am Platz oder
#* uneindeutig (Mehrfachtselektionen) so werden sie entfernt.
-#* Datum : MA 03. Nov. 92
-#* Update : MA 03. Feb. 94
#***********************************************************************/
sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
@@ -1068,19 +1024,17 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
SwFlyFrm *pFly = FindFlyFrm();
if ( !pFly )
{
- // --> OD 2006-11-08 #139670# - make code robust
SwFrm* pCurrFrm( GetCurrFrm() );
if ( !pCurrFrm )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::GetFlyFrmAttr(..)> - missing current frame. This is a serious defect, please inform OD." );
return sal_False;
}
- // <--
pFly = GetCurrFrm()->FindFlyFrm();
if ( !pFly )
{
- ASSERT( !this, "GetFlyFrmAttr, no Fly selected." );
+ OSL_ENSURE( !this, "GetFlyFrmAttr, no Fly selected." );
return sal_False;
}
}
@@ -1102,7 +1056,6 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
{
// OD 12.11.2003 #i22341# - content anchor of anchor item is needed.
// Thus, don't overwrite anchor item by default contructed anchor item.
- //rSet.Put( SwFmtAnchor( eType ) );
if ( FLY_AS_CHAR == eType )
{
rSet.ClearItem( RES_OPAQUE );
@@ -1111,7 +1064,7 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
}
}
rSet.SetParent( pFly->GetFmt()->GetAttrSet().GetParent() );
- //JP 11.02.97: Bug #35894#: die Attribute MUESSEN entfern werden!
+ // die Attribute MUESSEN entfern werden!
rSet.ClearItem( RES_FILL_ORDER );
rSet.ClearItem( RES_CNTNT );
//MA: Ersteinmal entfernen (Template by example usw.)
@@ -1122,8 +1075,6 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
#* Class : SwFEShell
#* Methode : SetFlyFrmAttr
#* Beschreibung: Die Attribute des aktuellen Flys aendern sich.
-#* Datum : MA 03. Nov. 92
-#* Update : MA 01. Aug. 95
#***********************************************************************/
sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
@@ -1136,9 +1087,9 @@ sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
SwFlyFrm *pFly = FindFlyFrm();
if( !pFly )
{
- ASSERT( GetCurrFrm(), "Crsr in parking zone" );
+ OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" );
pFly = GetCurrFrm()->FindFlyFrm();
- ASSERT( pFly, "SetFlyFrmAttr, no Fly selected." );
+ OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." );
}
if( pFly )
{
@@ -1164,9 +1115,7 @@ sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet )
}
return bRet;
}
-/*-- 30.03.2004 15:05:07---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
{
sal_Bool bRet = sal_False;
@@ -1212,8 +1161,6 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
#* Methode : ResetFlyFrmAttr
#* Beschreibung: Das gewuenschte Attribut oder die im Set befindlichen
#* werden zurueckgesetzt.
-#* Datum : MA 14. Mar. 97
-#* Update : MA 14. Mar. 97
#***********************************************************************/
sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
@@ -1227,9 +1174,9 @@ sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
SwFlyFrm *pFly = FindFlyFrm();
if( !pFly )
{
- ASSERT( GetCurrFrm(), "Crsr in parking zone" );
+ OSL_ENSURE( GetCurrFrm(), "Crsr in parking zone" );
pFly = GetCurrFrm()->FindFlyFrm();
- ASSERT( pFly, "SetFlyFrmAttr, no Fly selected." );
+ OSL_ENSURE( pFly, "SetFlyFrmAttr, no Fly selected." );
}
if( pFly )
@@ -1264,8 +1211,6 @@ sal_Bool SwFEShell::ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet )
#* Class : SwFEShell
#* Methode : GetCurFrmFmt
#* Beschreibung: liefert wenn Rahmen, dann Rahmenvorlage, sonst 0
-#* Datum : ST 04. Jun. 93
-#* Update :
#***********************************************************************/
SwFrmFmt* SwFEShell::GetCurFrmFmt() const
@@ -1281,8 +1226,6 @@ SwFrmFmt* SwFEShell::GetCurFrmFmt() const
/******************************************************************************
* Methode : void SwFEShell::SetFrmFmt(SwFrmFmt *pNewFmt)
* Beschreibung:
- * Erstellt : OK 14.04.94 15:40
- * Aenderung : MA 23. Apr. 97
******************************************************************************/
void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos )
@@ -1297,7 +1240,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP
}
else
pFly = FindFlyFrm();
- ASSERT( pFly, "SetFrmFmt: kein Frame" );
+ OSL_ENSURE( pFly, "SetFrmFmt: kein Frame" );
if( pFly )
{
StartAllAction();
@@ -1335,9 +1278,6 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocP
|*
|* SwFEShell::GetFlyFrmFmt()
|*
-|* Ersterstellung OK 23.06.93 13:15
-|* Letzte Aenderung OK 23.06.93 13:15
-|*
*************************************************************************/
const SwFrmFmt* SwFEShell::GetFlyFrmFmt() const
@@ -1370,9 +1310,6 @@ SwFrmFmt* SwFEShell::GetFlyFrmFmt()
|*
|* SwFEShell::GetFlyRect()
|*
-|* Ersterstellung AMA 6. Mae. 97
-|* Letzte Aenderung AMA 6. Mae. 97
-|*
*************************************************************************/
SwRect SwFEShell::GetFlyRect() const
@@ -1392,9 +1329,6 @@ SwRect SwFEShell::GetFlyRect() const
|*
|* SwFEShell::GetObjRect()
|*
-|* Ersterstellung MA 22. Aug. 93
-|* Letzte Aenderung MA 11. Jan. 95
-|*
*************************************************************************/
SwRect SwFEShell::GetObjRect() const
@@ -1420,8 +1354,6 @@ void SwFEShell::SetObjRect( const SwRect& rRect )
/***********************************************************************
#* Class : SwFEShell
#* Methode : RequestObjectResize()
-#* Datum : MA 10. Feb. 95
-#* Update : MA 13. Jul. 95
#***********************************************************************/
Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < embed::XEmbeddedObject >& xObj )
@@ -1505,9 +1437,9 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
aResult = pFly->ChgSize( aSz );
//Wenn sich das Objekt aendert ist die Kontur hoechstwahrscheinlich daneben.
- ASSERT( pFly->Lower()->IsNoTxtFrm(), "Request ohne NoTxt" );
+ OSL_ENSURE( pFly->Lower()->IsNoTxtFrm(), "Request ohne NoTxt" );
SwNoTxtNode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetNoTxtNode();
- ASSERT( pNd, "Request ohne Node" );
+ OSL_ENSURE( pNd, "Request ohne Node" );
pNd->SetContour( 0 );
ClrContourCache();
}
@@ -1540,7 +1472,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
}
SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt();
- ASSERT( pFlyFrmFmt, "fly frame format missing!" );
+ OSL_ENSURE( pFlyFrmFmt, "fly frame format missing!" );
if ( pFlyFrmFmt )
pFlyFrmFmt->SetLastFlyFrmPrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect
@@ -1553,8 +1485,6 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
/***********************************************************************
#* Class : SwFEShell
#* Methode : WizzardFindCurFrmFmt
-#* Datum : JP 31.07.95
-#* Update : JP 31.07.95
#***********************************************************************/
SwFrmFmt* SwFEShell::WizzardGetFly()
@@ -1594,7 +1524,7 @@ void SwFEShell::SetFlyName( const String& rName )
if( pFly )
GetDoc()->SetFlyName( *(SwFlyFrmFmt*)pFly->GetFmt(), rName );
else {
- ASSERT( !this, "kein FlyFrame selektiert" )
+ OSL_ENSURE( !this, "kein FlyFrame selektiert" );
}
}
@@ -1604,7 +1534,7 @@ const String& SwFEShell::GetFlyName() const
if( pFly )
return pFly->GetFmt()->GetName();
- ASSERT( !this, "kein FlyFrame selektiert" )
+ OSL_ENSURE( !this, "kein FlyFrame selektiert" );
return aEmptyStr;
}
@@ -1790,7 +1720,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
{
ObjCntType eType = OBJCNT_NONE;
- // OD 23.06.2003 #108784# - investigate 'master' drawing object, if method
+ // investigate 'master' drawing object, if method
// is called for a 'virtual' drawing object.
const SdrObject* pInvestigatedObj;
if ( rObj.ISA(SwDrawVirtObj) )
@@ -1811,7 +1741,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
if( xModel.is() )
{
uno::Any aVal;
- OUString sName = OUString::createFromAscii("ButtonType");
+ OUString sName(RTL_CONSTASCII_USTRINGPARAM("ButtonType"));
uno::Reference< beans::XPropertySet > xSet(xModel, uno::UNO_QUERY);
uno::Reference< beans::XPropertySetInfo > xInfo = xSet->getPropertySetInfo();
@@ -1842,7 +1772,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(GetUserCall( pInvestigatedObj ) ) );
if ( !pDrawContact )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::GetObjCntType(..)> - missing draw contact object" );
eType = OBJCNT_NONE;
}
@@ -1851,7 +1781,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
SwFrmFmt* pFrmFmt( pDrawContact->GetFmt() );
if ( !pFrmFmt )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::GetObjCntType(..)> - missing frame format" );
eType = OBJCNT_NONE;
}
@@ -1966,11 +1896,6 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
pFmt = GetDoc()->Insert( *GetCrsr(), rGrfName, rFltName, pGrf, &aFrmSet, NULL, NULL );
- // die Ordnungsnummer (Z-Order) noch uebertragen
- // JP 04.07.98: klappt aber nicht richtig!
- //SdrObject* pNewObj = ::FindSdrObject( pFmt );
- //pNewObj->SetOrdNum( nOrdNum );
-
EndUndo();
EndAllAction();
bRet = sal_True;
@@ -1980,7 +1905,7 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam
static sal_uInt16 SwFmtGetPageNum(const SwFlyFrmFmt * pFmt)
{
- ASSERT(pFmt != NULL, "invalid argument");
+ OSL_ENSURE(pFmt != NULL, "invalid argument");
SwFlyFrm * pFrm = pFmt->GetFrm();
@@ -2196,7 +2121,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
#if OSL_DEBUG_LEVEL > 1
SvGlobalName aCLSID( xObj->getClassID() );
const bool bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );
- ASSERT( bStarMath, "AlignFormulaToBaseline should only be called for Math objects" );
+ OSL_ENSURE( bStarMath, "AlignFormulaToBaseline should only be called for Math objects" );
if ( !bStarMath )
return;
@@ -2204,7 +2129,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
if (!pFly)
pFly = FindFlyFrm( xObj );
- ASSERT( pFly , "No fly frame!" );
+ OSL_ENSURE( pFly , "No fly frame!" );
SwFrmFmt * pFrmFmt = pFly ? pFly->GetFmt() : 0;
// baseline to baseline alignment should only be applied to formulas anchored as char
@@ -2223,7 +2148,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
}
catch ( uno::Exception& )
{
- ASSERT( sal_False , "Baseline could not be retrieved from Starmath!" );
+ OSL_ENSURE( sal_False , "Baseline could not be retrieved from Starmath!" );
}
}
}
@@ -2233,10 +2158,10 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
const MapMode aTargetMapMode( MAP_TWIP );
nBaseline = OutputDevice::LogicToLogic( nBaseline, aSourceMapMode.GetMapUnit(), aTargetMapMode.GetMapUnit() );
- ASSERT( nBaseline > 0, "Wrong value of Baseline while retrieving from Starmath!" );
+ OSL_ENSURE( nBaseline > 0, "Wrong value of Baseline while retrieving from Starmath!" );
//nBaseline must be moved by aPrt position
const SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt();
- ASSERT( pFlyFrmFmt, "fly frame format missing!" );
+ OSL_ENSURE( pFlyFrmFmt, "fly frame format missing!" );
if ( pFlyFrmFmt )
nBaseline += pFlyFrmFmt->GetLastFlyFrmPrtRectPos().Y();
@@ -2279,3 +2204,5 @@ void SwFEShell::AlignAllFormulasToBaseline()
EndAllAction();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index 96373fffb57b..43df3c04d3a4 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/embed/EmbedStates.hpp>
-#ifndef _SFX_CLIENTSH_HXX
#include <sfx2/ipclient.hxx>
-#endif
#include <sfx2/viewsh.hxx>
#include <sfx2/app.hxx>
#include <unotools/moduleoptions.hxx>
@@ -88,7 +87,8 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
nSttIdx = pStNd->EndOfSectionIndex() + 1;
}
- ASSERT( bExist, "OLE-Object unknown and FlyFrm not found." );
+ OSL_ENSURE( bExist, "OLE-Object unknown and FlyFrm not found." );
+ (void)bExist;
}
return pFly;
}
@@ -148,3 +148,4 @@ sal_Bool SwFEShell::FinishOLEObj() // Server wird beendet
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index d32db01ee73e..0a9522813c85 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,11 +88,8 @@
#include "txtfrm.hxx"
#include "txatbase.hxx"
#include "mdiexp.hxx" // fuer Update der Statuszeile bei drag
-// OD 2004-05-24 #i28701#
-#include <sortedobjs.hxx>
-// --> OD 2006-03-06 #125892#
+#include <sortedobjs.hxx> // #i28701#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <basegfx/polygon/b2dpolygon.hxx>
#define SCROLLVAL 75
@@ -132,8 +130,7 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
}
else if( !pFlyFmt || RES_DRAWFRMFMT == pFlyFmt->Which() )
{
- // --> OD 2007-07-25 #136039#
- // assure consistent cursor
+ // --> assure consistent cursor
pSh->KillPams();
pSh->ClearMark();
// <--
@@ -145,9 +142,6 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
|*
|* SwFEShell::SelectObj()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 22. Oct. 96
-|*
*************************************************************************/
sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
@@ -215,7 +209,7 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
if ( pObj )
{
- ASSERT( !bEnterGroup, "SW_ENTER_GROUP is not supported" );
+ OSL_ENSURE( !bEnterGroup, "SW_ENTER_GROUP is not supported" );
pDView->MarkObj( pObj, Imp()->GetPageView() );
}
else
@@ -248,7 +242,7 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
if ( GetCntType() & CNT_GRF )
{
const SwFlyFrm *pTmp = GetFlyFromMarked( &rMrkList, this );
- ASSERT( pTmp, "Graphic without Fly" );
+ OSL_ENSURE( pTmp, "Graphic without Fly" );
if ( ((SwNoTxtFrm*)pTmp->Lower())->HasAnimation() )
((SwNoTxtFrm*)pTmp->Lower())->StopAnimation( GetOut() );
}
@@ -270,9 +264,6 @@ sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pOb
|*
|* sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
-|* Created AMA 05/28/2002
-|* Last modify AMA 05/30/2002
-|*
|* Description: MoveAnchor( nDir ) looked for an another Anchor for
|* the selected drawing object (or fly frame) in the given direction.
|* An object "as character" doesn't moves anyway.
@@ -345,7 +336,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
switch ( nAnchorId ) {
case FLY_AT_PAGE:
{
- ASSERT( pOld->IsPageFrm(), "Wrong anchor, page exspected." );
+ OSL_ENSURE( pOld->IsPageFrm(), "Wrong anchor, page exspected." );
if( SW_MOVE_UP == nDir )
pNew = pOld->GetPrev();
else if( SW_MOVE_DOWN == nDir )
@@ -359,7 +350,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
}
case FLY_AT_CHAR:
{
- ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
+ OSL_ENSURE( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
if( SW_MOVE_LEFT == nDir || SW_MOVE_RIGHT == nDir )
{
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
@@ -393,7 +384,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
} // no break!
case FLY_AT_PARA:
{
- ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
+ OSL_ENSURE( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
if( SW_MOVE_UP == nDir )
pNew = pOld->FindPrev();
else if( SW_MOVE_DOWN == nDir )
@@ -419,9 +410,9 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
}
case FLY_AT_FLY:
{
- ASSERT( pOld->IsFlyFrm(), "Wrong anchor, fly frame exspected.");
+ OSL_ENSURE( pOld->IsFlyFrm(), "Wrong anchor, fly frame exspected.");
SwPageFrm* pPage = pOld->FindPageFrm();
- ASSERT( pPage, "Where's my page?" );
+ OSL_ENSURE( pPage, "Where's my page?" );
SwFlyFrm* pNewFly = NULL;
if( pPage->GetSortedObjs() )
{
@@ -510,8 +501,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
if( bRet )
{
StartAllAction();
- // --> OD 2006-02-28 #125892#
- // handle change of anchor node:
+ // --> handle change of anchor node:
// if count of the anchor frame also change, the fly frames have to be
// re-created. Thus, delete all fly frames except the <this> before the
// anchor attribute is change and re-create them afterwards.
@@ -544,9 +534,6 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
|*
|* SwFEShell::GetSelFrmType()
|*
-|* Ersterstellung MA 12. Jan. 93
-|* Letzte Aenderung JP 19.03.96
-|*
*************************************************************************/
const SdrMarkList* SwFEShell::_GetMarkList() const
@@ -578,7 +565,7 @@ sal_uInt16 SwFEShell::GetSelFrmType() const
eType = FRMTYPE_FLY_ATCNT;
else
{
- ASSERT( pFly->IsFlyInCntFrm(), "Neuer Rahmentyp?" );
+ OSL_ENSURE( pFly->IsFlyInCntFrm(), "Neuer Rahmentyp?" );
eType = FRMTYPE_FLY_INCNT;
}
}
@@ -589,7 +576,7 @@ sal_uInt16 SwFEShell::GetSelFrmType() const
return eType;
}
-// #108784# does the draw selection contain a control?
+// does the draw selection contain a control?
bool SwFEShell::IsSelContainsControl() const
{
bool bRet = false;
@@ -611,9 +598,6 @@ bool SwFEShell::IsSelContainsControl() const
|*
|* SwFEShell::Scroll()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 27. Jul. 95
-|*
*************************************************************************/
void SwFEShell::ScrollTo( const Point &rPt )
@@ -623,7 +607,6 @@ void SwFEShell::ScrollTo( const Point &rPt )
(!Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ||
Imp()->IsDragPossible( rPt )) )
{
- //SwSaveHdl aSave( Imp() );
ScrollMDI( this, aRect, SCROLLVAL, SCROLLVAL );
}
}
@@ -632,9 +615,6 @@ void SwFEShell::ScrollTo( const Point &rPt )
|*
|* SwFEShell::SetDragMode()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
@@ -647,9 +627,6 @@ void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
|*
|* SwFEShell::BeginDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
@@ -659,7 +636,7 @@ long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
{
delete pChainFrom; delete pChainTo; pChainFrom = pChainTo = 0;
SdrHdl* pHdl = pView->PickHandle( *pPt );
- pView->BegDragObj( *pPt, 0 /*GetWin()*/, pHdl );
+ pView->BegDragObj( *pPt, 0, pHdl );
::FrameNotify( this, FLY_DRAG );
return 1;
}
@@ -669,14 +646,11 @@ long SwFEShell::BeginDrag( const Point* pPt, sal_Bool )
|*
|* SwFEShell::Drag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::Drag( const Point *pPt, sal_Bool )
{
- ASSERT( Imp()->HasDrawView(), "Drag without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "Drag without DrawView?" );
if ( Imp()->GetDrawView()->IsDragObj() )
{
ScrollTo( *pPt );
@@ -692,14 +666,11 @@ long SwFEShell::Drag( const Point *pPt, sal_Bool )
|*
|* SwFEShell::EndDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::EndDrag( const Point *, sal_Bool )
{
- ASSERT( Imp()->HasDrawView(), "EndDrag without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "EndDrag without DrawView?" );
SdrView *pView = Imp()->GetDrawView();
if ( pView->IsDragObj() )
{
@@ -745,14 +716,11 @@ long SwFEShell::EndDrag( const Point *, sal_Bool )
|*
|* SwFEShell::BreakDrag()
|*
-|* Ersterstellung OM 02. Okt. 95
-|* Letzte Aenderung OM 02. Okt. 95
-|*
*************************************************************************/
void SwFEShell::BreakDrag()
{
- ASSERT( Imp()->HasDrawView(), "BreakDrag without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "BreakDrag without DrawView?" );
if ( Imp()->GetDrawView()->IsDragObj() )
Imp()->GetDrawView()->BrkDragObj();
SetChainMarker();
@@ -764,8 +732,6 @@ void SwFEShell::BreakDrag()
|*
|* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in
|* den ersten CntntFrm
-|* Ersterstellung MA 11. Dec. 92
-|* Letzte Aenderung MA 07. Oct. 96
|*
*************************************************************************/
@@ -778,14 +744,11 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
if( pFly )
{
- // --> OD 2004-06-11 #i28701# - no format here
-// pFly->GetAnchorFrm()->Calc();
SwCntntFrm *pCFrm = pFly->ContainsCntnt();
if ( pCFrm )
{
SwCntntNode *pCNode = pCFrm->GetNode();
- // --> OD 2007-07-25 #126039#
- // assure, that the cursor is consistent.
+ // --> assure, that the cursor is consistent.
KillPams();
ClearMark();
// <--
@@ -812,9 +775,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
|*
|* Beschreibung Selektion nach oben/unten (Z-Order)
|*
-|* Ersterstellung MA 05. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 96
-|*
*************************************************************************/
void lcl_NotifyNeighbours( const SdrMarkList *pLst )
@@ -900,9 +860,9 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
void SwFEShell::SelectionToTop( sal_Bool bTop )
{
- ASSERT( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
+ OSL_ENSURE( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
if ( pFly && pFly->IsFlyInCntFrm() )
@@ -920,9 +880,9 @@ void SwFEShell::SelectionToTop( sal_Bool bTop )
void SwFEShell::SelectionToBottom( sal_Bool bBottom )
{
- ASSERT( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
+ OSL_ENSURE( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
if ( pFly && pFly->IsFlyInCntFrm() )
@@ -944,8 +904,6 @@ void SwFEShell::SelectionToBottom( sal_Bool bBottom )
|*
|* Beschreibung Objekt ueber/unter dem Dokument?
|* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 20. Dec. 94
|*
*************************************************************************/
@@ -977,11 +935,8 @@ short SwFEShell::GetLayerId() const
|* SwFEShell::SelectionToHeaven(), SelectionToHell()
|*
|* Beschreibung Objekt ueber/unter dem Dokument
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung AMA 04. Jun. 98
|*
*************************************************************************/
-// OD 25.06.2003 #108784#
// Note: only visible objects can be marked. Thus, objects with invisible
// layer IDs have not to be considered.
// If <SwFEShell> exists, layout exists!!
@@ -991,16 +946,16 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
{
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
- // OD 25.06.2003 #108784# - correct type of <nControls>
+ // correct type of <nControls>
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- // OD 21.08.2003 #i18447# - no change of layer for controls
+ // #i18447# - no change of layer for controls
// or group objects containing controls.
- // --> OD 2010-09-14 #i113730#
+ // --> #i113730#
// consider that a member of a drawing group has been selected.
const SwContact* pContact = ::GetUserCall( pObj );
- ASSERT( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
+ OSL_ENSURE( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" );
const bool bControlObj = ( pContact && pContact->GetMaster() )
? ::CheckControlLayer( pContact->GetMaster() )
: ::CheckControlLayer( pObj );
@@ -1036,9 +991,6 @@ void SwFEShell::SelectionToHell()
|*
|* SwFEShell::IsObjSelected(), IsFrmSelected()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 17. Jan. 95
-|*
*************************************************************************/
sal_uInt16 SwFEShell::IsObjSelected() const
@@ -1071,9 +1023,6 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
|*
|* SwFEShell::EndTextEdit()
|*
-|* Ersterstellung MA 19. Feb. 96
-|* Letzte Aenderung MA 19. Feb. 96
-|*
*************************************************************************/
void SwFEShell::EndTextEdit()
@@ -1082,7 +1031,7 @@ void SwFEShell::EndTextEdit()
//keinen Text mehr enthaelt und keine Attribute traegt) wird das
//Objekt gel�scht. Alle anderen markierten Objekte bleiben erhalten.
- ASSERT( Imp()->HasDrawView() && Imp()->GetDrawView()->IsTextEdit(),
+ OSL_ENSURE( Imp()->HasDrawView() && Imp()->GetDrawView()->IsTextEdit(),
"EndTextEdit an no Object" );
StartAllAction();
@@ -1132,9 +1081,6 @@ void SwFEShell::EndTextEdit()
|*
|* SwFEShell::IsInsideSelectedObj()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 08. Nov. 96
-|*
*************************************************************************/
int SwFEShell::IsInsideSelectedObj( const Point &rPt )
@@ -1156,19 +1102,11 @@ int SwFEShell::IsInsideSelectedObj( const Point &rPt )
|*
|* SwFEShell::IsObjSelectable()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 02. Feb. 95
-|*
*************************************************************************/
bool SwFEShell::IsObjSelectable( const Point& rPt )
{
SET_CURR_SHELL(this);
-#ifdef OLD
- if( Imp()->HasDrawView() )
- return Imp()->GetDrawView()->PickSomething( rPt, MINMOVE );
- return 0;
-#else
SwDrawView *pDView = Imp()->GetDrawView();
bool bRet = false;
if( pDView )
@@ -1182,10 +1120,8 @@ bool SwFEShell::IsObjSelectable( const Point& rPt )
pDView->SetHitTolerancePixel( nOld );
}
return bRet;
-#endif
}
-// #107513#
// Test if there is a object at that position and if it should be selected.
sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
{
@@ -1290,11 +1226,9 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
|*
|* Beschreibung Wenn ein Obj selektiert ist, gehen wir von dessen
|* TopLeft aus, andernfalls von der Mitte des aktuellen CharRects.
-|* Ersterstellung MA 01. Jun. 95
-|* Letzte Aenderung MA 30. Apr. 96
|*
*************************************************************************/
-/* -----------------23.09.98 10:29-------------------
+/* --------------------------------------------------
* Beinhaltet das Objekt ein Control oder Gruppen,
* die nur aus Controls bestehen
* --------------------------------------------------*/
@@ -1399,7 +1333,7 @@ const SdrObject* SwFEShell::GetBestObject( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_
}
- ASSERT( pList, "No object list to iterate" )
+ OSL_ENSURE( pList, "No object list to iterate" );
SdrObjListIter aObjIter( *pList, bFlat ? IM_FLAT : IM_DEEPNOGROUPS );
while ( aObjIter.IsMore() )
@@ -1541,9 +1475,6 @@ sal_Bool SwFEShell::GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
|*
|* SwFEShell::BeginCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 21. Mar. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
@@ -1592,14 +1523,11 @@ sal_Bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sa
|*
|* SwFEShell::MoveCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 24. Jan. 95
-|*
*************************************************************************/
void SwFEShell::MoveCreate( const Point &rPos )
{
- ASSERT( Imp()->HasDrawView(), "MoveCreate without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "MoveCreate without DrawView?" );
if ( GetPageNumber( rPos ) )
{
ScrollTo( rPos );
@@ -1612,9 +1540,6 @@ void SwFEShell::MoveCreate( const Point &rPos )
|*
|* SwFEShell::EndCreate(), ImpEndCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 14. Oct. 96
-|*
*************************************************************************/
sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
@@ -1622,7 +1547,7 @@ sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
// JP 18.08.95: 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?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "EndCreate without DrawView?" );
if( !Imp()->GetDrawView()->IsGroupEntered() )
{
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
@@ -1648,7 +1573,7 @@ sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
sal_Bool SwFEShell::ImpEndCreate()
{
- ASSERT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
+ OSL_ENSURE( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
"Neues Object nicht selektiert." );
SdrObject& rSdrObj = *Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
@@ -1731,7 +1656,7 @@ sal_Bool SwFEShell::ImpEndCreate()
if( !bCharBound )
{
- // OD 16.05.2003 #108784# - allow native drawing objects in header/footer.
+ // allow native drawing objects in header/footer.
// Thus, set <bBodyOnly> to <false> for these objects using value
// of <nIdent> - value <0xFFFF> indicates control objects, which aren't
// allowed in header/footer.
@@ -1827,7 +1752,7 @@ sal_Bool SwFEShell::ImpEndCreate()
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
do {
pTmp = pTmp->FindMaster();
- ASSERT( pTmp, "Where's my Master?" );
+ OSL_ENSURE( pTmp, "Where's my Master?" );
// OD 2004-03-30 #i26791# - correction: add frame area height
// of master frames.
nYOffset += pTmp->IsVertical() ?
@@ -1920,7 +1845,7 @@ sal_Bool SwFEShell::ImpEndCreate()
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
do {
pTmp = pTmp->FindMaster();
- ASSERT( pTmp, "Where's my Master?" );
+ OSL_ENSURE( pTmp, "Where's my Master?" );
nYOffset += pTmp->IsVertical() ?
pTmp->Prt().Width() : pTmp->Prt().Height();
} while ( pTmp->IsFollow() );
@@ -1942,7 +1867,7 @@ sal_Bool SwFEShell::ImpEndCreate()
// <--
if( bCharBound )
{
- ASSERT( aAnch.GetAnchorId() == FLY_AS_CHAR, "wrong AnchorType" );
+ OSL_ENSURE( aAnch.GetAnchorId() == FLY_AS_CHAR, "wrong AnchorType" );
SwTxtNode *pNd = aAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
SwFmtFlyCnt aFmt( pFmt );
pNd->InsertItem(aFmt,
@@ -1956,14 +1881,14 @@ sal_Bool SwFEShell::ImpEndCreate()
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
do {
pTmp = pTmp->FindMaster();
- ASSERT( pTmp, "Where's my Master?" );
+ OSL_ENSURE( pTmp, "Where's my Master?" );
} while( pTmp->IsFollow() );
pAnch = pTmp;
}
pContact->ConnectToLayout();
- // OD 25.06.2003 #108784# - mark object at frame the object is inserted at.
+ // mark object at frame the object is inserted at.
{
SdrObject* pMarkObj = pContact->GetDrawObjectByAnchorFrm( *pAnch );
if ( pMarkObj )
@@ -1992,14 +1917,11 @@ sal_Bool SwFEShell::ImpEndCreate()
|*
|* SwFEShell::BreakCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 09. Jan. 95
-|*
*************************************************************************/
void SwFEShell::BreakCreate()
{
- ASSERT( Imp()->HasDrawView(), "BreakCreate without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "BreakCreate without DrawView?" );
Imp()->GetDrawView()->BrkCreateObj();
::FrameNotify( this, FLY_DRAG_END );
}
@@ -2008,9 +1930,6 @@ void SwFEShell::BreakCreate()
|*
|* SwFEShell::IsDrawCreate()
|*
-|* Ersterstellung OM 16. Mar. 95
-|* Letzte Aenderung OM 16. Mar. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::IsDrawCreate() const
@@ -2022,9 +1941,6 @@ sal_Bool SwFEShell::IsDrawCreate() const
|*
|* SwFEShell::BeginMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::BeginMark( const Point &rPos )
@@ -2049,20 +1965,16 @@ sal_Bool SwFEShell::BeginMark( const Point &rPos )
|*
|* SwFEShell::MoveMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::MoveMark( const Point &rPos )
{
- ASSERT( Imp()->HasDrawView(), "MoveMark without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "MoveMark without DrawView?" );
if ( GetPageNumber( rPos ) )
{
ScrollTo( rPos );
SwDrawView* pDView = Imp()->GetDrawView();
-// Imp()->GetDrawView()->MovMarkObj( rPos );
if (pDView->IsInsObjPoint())
pDView->MovInsObjPoint( rPos );
@@ -2077,15 +1989,12 @@ void SwFEShell::MoveMark( const Point &rPos )
|*
|* SwFEShell::EndMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung MA 08. Feb. 95
-|*
*************************************************************************/
sal_Bool SwFEShell::EndMark()
{
sal_Bool bRet = sal_False;
- ASSERT( Imp()->HasDrawView(), "EndMark without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "EndMark without DrawView?" );
if (Imp()->GetDrawView()->IsMarkObj())
{
@@ -2108,7 +2017,6 @@ sal_Bool SwFEShell::EndMark()
{
if ( !bShowHdl )
{
- //HMHpDView->HideMarkHdl();
bShowHdl = sal_True;
}
rMrkList.DeleteMark( i );
@@ -2120,7 +2028,6 @@ sal_Bool SwFEShell::EndMark()
{
pDView->MarkListHasChanged();
pDView->AdjustMarkHdl();
- //HMHpDView->ShowMarkHdl();
}
if ( rMrkList.GetMarkCount() )
@@ -2145,14 +2052,11 @@ sal_Bool SwFEShell::EndMark()
|*
|* SwFEShell::BreakSelect()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::BreakMark()
{
- ASSERT( Imp()->HasDrawView(), "BreakMark without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "BreakMark without DrawView?" );
Imp()->GetDrawView()->BrkMarkObj();
}
@@ -2160,9 +2064,6 @@ void SwFEShell::BreakMark()
|*
|* SwFEShell::GetAnchorId()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
short SwFEShell::GetAnchorId() const
@@ -2199,14 +2100,11 @@ short SwFEShell::GetAnchorId() const
|*
|* SwFEShell::ChgAnchor()
|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr )
{
- ASSERT( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
+ OSL_ENSURE( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
if( rMrkList.GetMarkCount() &&
!rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -2226,14 +2124,11 @@ void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr
|*
|* SwFEShell::DelSelectedObj()
|*
-|* Ersterstellung MA 03. Nov. 92
-|* Letzte Aenderung MA 14. Nov. 95
-|*
*************************************************************************/
void SwFEShell::DelSelectedObj()
{
- ASSERT( Imp()->HasDrawView(), "DelSelectedObj(), no DrawView available" );
+ OSL_ENSURE( Imp()->HasDrawView(), "DelSelectedObj(), no DrawView available" );
if ( Imp()->HasDrawView() )
{
StartAllAction();
@@ -2249,8 +2144,6 @@ void SwFEShell::DelSelectedObj()
|*
|* Beschreibung Fuer die Statuszeile zum Erfragen der aktuellen
|* Verhaeltnisse
-|* Ersterstellung MA 25. Apr. 95
-|* Letzte Aenderung MA 25. Apr. 95
|*
*************************************************************************/
@@ -2270,7 +2163,7 @@ Size SwFEShell::GetObjSize() const
Point SwFEShell::GetAnchorObjDiff() const
{
const SdrView *pView = Imp()->GetDrawView();
- ASSERT( pView, "GetAnchorObjDiff without DrawView?" );
+ OSL_ENSURE( pView, "GetAnchorObjDiff without DrawView?" );
Rectangle aRect;
if ( Imp()->GetDrawView()->IsAction() )
@@ -2298,7 +2191,7 @@ Point SwFEShell::GetAnchorObjDiff() const
Point SwFEShell::GetObjAbsPos() const
{
- ASSERT( Imp()->GetDrawView(), "GetObjAbsPos() without DrawView?" );
+ OSL_ENSURE( Imp()->GetDrawView(), "GetObjAbsPos() without DrawView?" );
return Imp()->GetDrawView()->GetDragStat().GetActionRect().TopLeft();
}
@@ -2308,9 +2201,6 @@ Point SwFEShell::GetObjAbsPos() const
|*
|* SwFEShell::IsGroupSelected()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
sal_Bool SwFEShell::IsGroupSelected()
@@ -2321,10 +2211,10 @@ sal_Bool SwFEShell::IsGroupSelected()
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- // OD 30.06.2003 #108784# - consider 'virtual' drawing objects.
+ // consider 'virtual' drawing objects.
// Thus, use corresponding method instead of checking type.
if ( pObj->IsGroupObject() &&
- // --> FME 2004-12-08 #i38505# No ungroup allowed for 3d objects
+ // --> #i38505# No ungroup allowed for 3d objects
!pObj->Is3DObj() &&
// <--
FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))->
@@ -2337,8 +2227,8 @@ sal_Bool SwFEShell::IsGroupSelected()
return sal_False;
}
-// OD 27.06.2003 #108784# - change return type.
-// OD 27.06.2003 #108784# - adjustments for drawing objects in header/footer:
+// Change return type.
+// Adjustments for drawing objects in header/footer:
// allow group, only if all selected objects are in the same header/footer
// or not in header/footer.
bool SwFEShell::IsGroupAllowed() const
@@ -2363,7 +2253,7 @@ bool SwFEShell::IsGroupAllowed() const
SwFrmFmt* pFrmFmt( ::FindFrmFmt( const_cast<SdrObject*>(pObj) ) );
if ( !pFrmFmt )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::IsGroupAllowed()> - missing frame format" );
bIsGroupAllowed = false;
}
@@ -2373,7 +2263,7 @@ bool SwFEShell::IsGroupAllowed() const
}
}
- // OD 27.06.2003 #108784# - check, if all selected objects are in the
+ // check, if all selected objects are in the
// same header/footer or not in header/footer.
if ( bIsGroupAllowed )
{
@@ -2421,8 +2311,6 @@ bool SwFEShell::IsGroupAllowed() const
|*
|* Beschreibung Die Gruppe bekommt den Anker und das Contactobjekt
|* des ersten in der Selektion
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 23. Apr. 95
|*
*************************************************************************/
@@ -2446,8 +2334,6 @@ void SwFEShell::GroupSelection()
|*
|* Beschreibung Die Einzelobjekte bekommen eine Kopie vom Anker und
|* Contactobjekt der Gruppe.
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 01. Feb. 95
|*
*************************************************************************/
@@ -2469,9 +2355,6 @@ void SwFEShell::UnGroupSelection()
|*
|* SwFEShell::MirrorSelection()
|*
-|* Ersterstellung MA 06. Aug. 95
-|* Letzte Aenderung MA 06. Aug. 95
-|*
*************************************************************************/
void SwFEShell::MirrorSelection( sal_Bool bHorizontal )
@@ -2491,7 +2374,7 @@ void SwFEShell::MirrorSelection( sal_Bool bHorizontal )
sal_Bool SwFEShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bSelFrm )
{
sal_Bool bRet = sal_False;
-static sal_uInt8 __READONLY_DATA aChkArr[ 4 ] = {
+ static sal_uInt8 const aChkArr[ 4 ] = {
/* FLYCNTTYPE_ALL */ 0,
/* FLYCNTTYPE_FRM */ ND_TEXTNODE,
/* FLYCNTTYPE_GRF */ ND_GRFNODE,
@@ -2507,7 +2390,7 @@ static sal_uInt8 __READONLY_DATA aChkArr[ 4 ] = {
SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm ));
if( pFrm )
{
- ASSERT( pFrm->IsFlyFrm(), "Wrong FrmType" );
+ OSL_ENSURE( pFrm->IsFlyFrm(), "Wrong FrmType" );
if( bSelFrm )
{
SelectObj( pFrm->Frm().Pos(), 0, ((SwFlyFrm*)pFrm)->GetVirtDrawObj() );
@@ -2516,8 +2399,6 @@ static sal_uInt8 __READONLY_DATA aChkArr[ 4 ] = {
}
else
{
- // --> OD 2004-06-11 #i28701# - no format here
-// pFrm->GetAnchorFrm()->Calc();
SwCntntFrm *pCFrm = pFrm->ContainsCntnt();
if ( pCFrm )
{
@@ -2638,8 +2519,8 @@ sal_Bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- // --> OD 2007-07-24 #143008# - make code robust
- ASSERT( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact> - please inform OD." );
+ // --> make code robust
+ OSL_ENSURE( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact> - please inform OD." );
if ( pContact )
{
if ( i )
@@ -2657,7 +2538,7 @@ sal_Bool SwFEShell::SetObjAttr( const SfxItemSet& rSet )
SET_CURR_SHELL( this );
if ( !rSet.Count() )
- { ASSERT( !this, "SetObjAttr, empty set." );
+ { OSL_ENSURE( !this, "SetObjAttr, empty set." );
return sal_False;
}
@@ -2721,7 +2602,7 @@ void SwFEShell::CheckUnboundObjects()
}
if ( !pPage )
pPage = pLast;
- ASSERT( pPage, "Page not found." );
+ OSL_ENSURE( pPage, "Page not found." );
//Fremde Identifier sollen in den Default laufen.
//Ueberschneidungen sind moeglich!!
@@ -2809,9 +2690,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
}
return SW_CHAIN_NOT_FOUND;
}
-/* -----------------------------09.08.2002 07:40------------------------------
- ---------------------------------------------------------------------------*/
int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
return GetDoc()->Chain(rSource, rDest);
@@ -2941,10 +2820,8 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
}
return 0;
}
-/* -----------------------------2002/06/24 15:07------------------------------
- ---------------------------------------------------------------------------*/
-void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
+ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
sal_uInt16 nSlotId)
{
SdrView* pDrawView = GetDrawView();
@@ -3127,8 +3004,6 @@ void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind,
}
/** SwFEShell::GetShapeBackgrd
-
- OD 02.09.2002 for #102450#:
method determines background color of the page the selected drawing
object is on and returns this color.
If no color is found, because no drawing object is selected or ...,
@@ -3144,29 +3019,29 @@ const Color SwFEShell::GetShapeBackgrd() const
Color aRetColor;
// check, if a draw view exists
- ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
+ OSL_ENSURE( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
if( Imp()->GetDrawView() )
{
// determine list of selected objects
const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
// check, if exactly one object is selected.
- ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
+ OSL_ENSURE( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
if ( pMrkList->GetMarkCount() == 1)
{
// get selected object
const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
// check, if selected object is a shape (drawing object)
- ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
+ OSL_ENSURE( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
{
// determine page frame of the frame the shape is anchored.
const SwFrm* pAnchorFrm =
static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
- ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
+ OSL_ENSURE( pAnchorFrm, "inconsistent modell - no anchor at shape!");
if ( pAnchorFrm )
{
const SwPageFrm* pPageFrm = pAnchorFrm->FindPageFrm();
- ASSERT( pPageFrm, "inconsistent modell - no page!");
+ OSL_ENSURE( pPageFrm, "inconsistent modell - no page!");
if ( pPageFrm )
{
aRetColor = pPageFrm->GetDrawBackgrdColor();
@@ -3180,8 +3055,6 @@ const Color SwFEShell::GetShapeBackgrd() const
}
/** Is default horizontal text direction for selected drawing object right-to-left
-
- OD 09.12.2002 #103045#
Because drawing objects only painted for each page only, the default
horizontal text direction of a drawing object is given by the corresponding
page property.
@@ -3196,29 +3069,29 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
bool bRet = false;
// check, if a draw view exists
- ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
+ OSL_ENSURE( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
if( Imp()->GetDrawView() )
{
// determine list of selected objects
const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
// check, if exactly one object is selected.
- ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
+ OSL_ENSURE( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
if ( pMrkList->GetMarkCount() == 1)
{
// get selected object
const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
// check, if selected object is a shape (drawing object)
- ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
+ OSL_ENSURE( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
{
// determine page frame of the frame the shape is anchored.
const SwFrm* pAnchorFrm =
static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
- ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
+ OSL_ENSURE( pAnchorFrm, "inconsistent modell - no anchor at shape!");
if ( pAnchorFrm )
{
const SwPageFrm* pPageFrm = pAnchorFrm->FindPageFrm();
- ASSERT( pPageFrm, "inconsistent modell - no page!");
+ OSL_ENSURE( pPageFrm, "inconsistent modell - no page!");
if ( pPageFrm )
{
bRet = pPageFrm->IsRightToLeft() ? true : false;
@@ -3230,9 +3103,7 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
return bRet;
}
-/* -----------------20.03.2003 14:35-----------------
- --------------------------------------------------*/
Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
{
Point aRet(-1, -1);
@@ -3248,3 +3119,4 @@ Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index fe05bc4c4dcf..7564308d877c 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <tools/errinf.hxx>
#include <vcl/svapp.hxx>
#include <basegfx/vector/b2dvector.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <editeng/protitem.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/frmdiritem.hxx>
@@ -118,7 +117,7 @@ void SwFEShell::ParkCursorInTab()
{
SwCursor * pSwCrsr = GetSwCrsr();
- ASSERT(pSwCrsr, "no SwCursor");
+ OSL_ENSURE(pSwCrsr, "no SwCursor");
SwPosition aStartPos = *pSwCrsr->GetPoint(), aEndPos = aStartPos;
@@ -202,8 +201,6 @@ void SwFEShell::ParkCursorInTab()
/***********************************************************************
#* Class : SwFEShell
#* Methoden : InsertRow(), InsertCol
-#* Datum : MA 03. May. 93
-#* Update : MA 19. Apr. 95
#***********************************************************************/
sal_Bool SwFEShell::InsertRow( sal_uInt16 nCnt, sal_Bool bBehind )
{
@@ -277,8 +274,6 @@ sal_Bool SwFEShell::InsertCol( sal_uInt16 nCnt, sal_Bool bBehind )
/***********************************************************************
#* Class : SwFEShell
#* Methoden : DeleteRow(), DeleteCol()
-#* Datum : MA 03. May. 93
-#* Update : MA 19. Apr. 95
#***********************************************************************/
/**
@@ -470,8 +465,6 @@ sal_Bool SwFEShell::DeleteRow()
/***********************************************************************
#* Class : SwFEShell
#* Methoden : MergeTab(), SplitTab()
-#* Datum : MA 03. May. 93
-#* Update : MA 19. Apr. 95
#***********************************************************************/
sal_uInt16 SwFEShell::MergeTab()
@@ -552,8 +545,6 @@ sal_Bool SwFEShell::SplitTab( sal_Bool bVert, sal_uInt16 nCnt, sal_Bool bSameHei
/***********************************************************************
#* Class : SwFEShell
#* Methoden : _GetTabCols
-#* Datum : MA 30. Nov. 95
-#* Update : MA 08. Jan. 97
#***********************************************************************/
void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
{
@@ -583,10 +574,6 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
{
pLastCols->SetLeftMin( nLeftMin );
- //ASSERT( bVert ||
- // pLastCols->GetLeftMin() == (pTab->Frm().*fnRect->fnGetLeft)(),
- // "GetTabCols: wrong result" )
-
pColumnCacheLastTabFrm = pTab;
}
else
@@ -636,8 +623,6 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : _GetTabRows
-#* Datum : FME 2004-01-14
-#* Update :
#***********************************************************************/
void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
{
@@ -690,8 +675,6 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetTabCols(), GetTabCols()
-#* Datum : MA 03. May. 93
-#* Update : MA 18. May. 93
#***********************************************************************/
void SwFEShell::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly )
{
@@ -722,9 +705,6 @@ void SwFEShell::GetTabCols( SwTabCols &rToFill ) const
_GetTabCols( rToFill, pFrm );
}
-/*-- 19.01.2004 08:56:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwFEShell::GetTabRows( SwTabCols &rToFill ) const
{
const SwFrm *pFrm = GetCurrFrm();
@@ -736,9 +716,7 @@ void SwFEShell::GetTabRows( SwTabCols &rToFill ) const
_GetTabRows( rToFill, pFrm );
}
-/*-- 19.01.2004 08:56:44---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFEShell::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly )
{
SwFrm *pBox = GetCurrFrm();
@@ -755,18 +733,14 @@ void SwFEShell::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly )
GetDoc()->SetTabRows( rNew, bCurColOnly, 0, (SwCellFrm*)pBox );
EndAllActionAndCall();
}
-/*-- 19.01.2004 08:59:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFEShell::GetMouseTabRows( SwTabCols &rToFill, const Point &rPt ) const
{
const SwFrm *pBox = GetBox( rPt );
if ( pBox )
_GetTabRows( rToFill, pBox );
}
-/*-- 19.01.2004 08:59:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFEShell::SetMouseTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const Point &rPt )
{
const SwFrm *pBox = GetBox( rPt );
@@ -782,7 +756,6 @@ void SwFEShell::SetMouseTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, co
/***********************************************************************
* Class : SwFEShell
* Methoden : SetRowSplit(), GetRowSplit()
- * Datum : FME 13.11.2003
***********************************************************************/
void SwFEShell::SetRowSplit( const SwFmtRowSplit& rNew )
@@ -802,8 +775,6 @@ void SwFEShell::GetRowSplit( SwFmtRowSplit*& rpSz ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetRowHeight(), GetRowHeight()
-#* Datum : MA 17. May. 93
-#* Update : JP 29.04.98
#***********************************************************************/
void SwFEShell::SetRowHeight( const SwFmtFrmSize &rNew )
@@ -855,8 +826,6 @@ sal_Bool SwFEShell::GetRowBackground( SvxBrushItem &rToFill ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetTabBorders(), GetTabBorders()
-#* Datum : MA 18. May. 93
-#* Update : JP 29.04.98
#***********************************************************************/
void SwFEShell::SetTabBorders( const SfxItemSet& rSet )
@@ -886,8 +855,6 @@ void SwFEShell::GetTabBorders( SfxItemSet& rSet ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetBoxBackground(), GetBoxBackground()
-#* Datum : MA 01. Jun. 93
-#* Update : MA 03. Jul. 96
#***********************************************************************/
void SwFEShell::SetBoxBackground( const SvxBrushItem &rNew )
{
@@ -905,8 +872,6 @@ sal_Bool SwFEShell::GetBoxBackground( SvxBrushItem &rToFill ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetBoxDirection(), GetBoxDirection()
-#* Datum : FME 2004-02-03
-#* Update : FME 2004-02-03
#***********************************************************************/
void SwFEShell::SetBoxDirection( const SvxFrameDirectionItem& rNew )
{
@@ -924,8 +889,6 @@ sal_Bool SwFEShell::GetBoxDirection( SvxFrameDirectionItem& rToFill ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetBoxAlign, SetBoxAlign
-#* Datum : MA 18. Dec. 96
-#* Update : JP 29.04.98
#***********************************************************************/
void SwFEShell::SetBoxAlign( sal_uInt16 nAlign )
{
@@ -943,8 +906,6 @@ sal_uInt16 SwFEShell::GetBoxAlign() const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : SetTabBackground(), GetTabBackground()
-#* Datum : MA 08. Jul. 96
-#* Update : MA 08. Jul. 96
#***********************************************************************/
void SwFEShell::SetTabBackground( const SvxBrushItem &rNew )
{
@@ -970,8 +931,6 @@ void SwFEShell::GetTabBackground( SvxBrushItem &rToFill ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : HasWholeTabSelection()
-#* Datum : MA 18. May. 93
-#* Update : MA 20. Jul. 93
#***********************************************************************/
sal_Bool SwFEShell::HasWholeTabSelection() const
{
@@ -1000,9 +959,7 @@ sal_Bool SwFEShell::HasBoxSelection() const
if( IsTableMode() )
return sal_True;
SwPaM* pPam = GetCrsr();
- // leere Boxen gelten auch ohne Selektion als selektiert
-// if( !pPam->HasMark() )
-// return sal_False;
+ // empty boxes are also selected as the absence of selection
sal_Bool bChg = sal_False;
if( pPam->GetPoint() == pPam->End())
{
@@ -1021,7 +978,7 @@ sal_Bool SwFEShell::HasBoxSelection() const
if( !pCNd )
{
pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx );
- ASSERT( pCNd, "kein ContentNode in der Box ??" );
+ OSL_ENSURE( pCNd, "kein ContentNode in der Box ??" );
}
if( pPam->GetMark()->nContent == pCNd->Len() )
{
@@ -1038,8 +995,6 @@ sal_Bool SwFEShell::HasBoxSelection() const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : ProtectCells(), UnProtectCells()
-#* Datum : MA 20. Jul. 93
-#* Update : JP 25. Sep. 93
#***********************************************************************/
void SwFEShell::ProtectCells()
{
@@ -1253,8 +1208,6 @@ sal_Bool SwFEShell::CheckHeadline( bool bRepeat ) const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : AdjustCellWidth()
-#* Datum : MA 20. Feb. 95
-#* Update : MA 27. Jul. 95
#***********************************************************************/
void SwFEShell::AdjustCellWidth( sal_Bool bBalance )
@@ -1386,8 +1339,6 @@ sal_Bool SwFEShell::GetTableAutoFmt( SwTableAutoFmt& rGet )
/***********************************************************************
#* Class : SwFEShell
#* Methoden : DeleteTblSel()
-#* Datum : MA 03. May. 93
-#* Update : MA 19. Apr. 95
#***********************************************************************/
sal_Bool SwFEShell::DeleteTblSel()
{
@@ -1436,9 +1387,6 @@ sal_Bool SwFEShell::DeleteTblSel()
|*
|* SwFEShell::GetCurTabColNum()
|*
-|* Ersterstellung MA 03. Feb. 95
-|* Letzte Aenderung MA 21. May. 95
-|
|*************************************************************************/
sal_uInt16 SwFEShell::GetCurTabColNum() const
{
@@ -1446,7 +1394,7 @@ sal_uInt16 SwFEShell::GetCurTabColNum() const
sal_uInt16 nRet = 0;
SwFrm *pFrm = GetCurrFrm();
- ASSERT( pFrm, "Crsr geparkt?" );
+ OSL_ENSURE( pFrm, "Crsr geparkt?" );
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
if( pFrm && pFrm->IsInTab() )
@@ -1505,9 +1453,6 @@ sal_uInt16 SwFEShell::GetCurTabColNum() const
|*
|* SwFEShell::GetBox()
|*
-|* Ersterstellung MA 22. Jun. 95
-|* Letzte Aenderung MA 21. Nov. 96
-|*
|*************************************************************************/
const SwFrm *lcl_FindFrmInTab( const SwLayoutFrm *pLay, const Point &rPt, SwTwips nFuzzy )
@@ -1570,7 +1515,7 @@ const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
// We first check if the given point is 'close' to the left or top
// border of the table frame:
- ASSERT( pFrm, "Nested table frame without outer table" )
+ OSL_ENSURE( pFrm, "Nested table frame without outer table" );
SWRECTFN( pFrm )
const bool bRTL = pFrm->IsRightToLeft();
@@ -1668,7 +1613,7 @@ const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
if ( !bMouseMoveRowCols )
{
- ASSERT( pbCol && pbRow, "pbCol or pbRow missing" )
+ OSL_ENSURE( pbCol && pbRow, "pbCol or pbRow missing" );
if ( bCloseToRow || bCloseToCol )
{
@@ -1717,7 +1662,7 @@ const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
}
// robust:
- ASSERT( !pRet || pRet->IsCellFrm(), "lcl_FindFrm() is supposed to find a cell frame!" )
+ OSL_ENSURE( !pRet || pRet->IsCellFrm(), "lcl_FindFrm() is supposed to find a cell frame!" );
return pRet && pRet->IsCellFrm() ? static_cast<const SwCellFrm*>(pRet) : 0;
}
@@ -1889,7 +1834,7 @@ Point lcl_ProjectOntoClosestTableFrm( const SwTabFrm& rTab, const Point& rPoint,
else if ( aRet.Y() < aMin1.Y() )
aRet.Y() = aMin1.Y();
}
- else //if ( bTop )
+ else
{
aRet.Y() = aMin1.Y();
if ( aRet.X() > aMin2.X() )
@@ -2026,9 +1971,6 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
|*
|* SwFEShell::WhichMouseTabCol()
|*
-|* Ersterstellung MA 22. Jun. 95
-|* Last change AMA 12. Jun. 02
-|
|*************************************************************************/
sal_uInt8 SwFEShell::WhichMouseTabCol( const Point &rPt ) const
{
@@ -2173,9 +2115,6 @@ bool SwFEShell::IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
|*
|* SwFEShell::GetMouseTabCols()
|*
-|* Ersterstellung MA 22. Jun. 95
-|* Letzte Aenderung MA 27. Aug. 96
-|
|*************************************************************************/
void SwFEShell::GetMouseTabCols( SwTabCols &rToFill, const Point &rPt ) const
{
@@ -2201,9 +2140,6 @@ void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
|*
|* SwFEShell::GetMouseColNum(), GetMouseTabColNum()
|*
-|* Ersterstellung MA 04. Jul. 95
-|* Letzte Aenderung MA 04. Jul. 95
-|
|*************************************************************************/
sal_uInt16 SwFEShell::GetCurMouseColNum( const Point &rPt,
SwGetCurColNumPara* pPara ) const
@@ -2217,7 +2153,7 @@ sal_uInt16 SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const
sal_uInt16 nRet = 0;
const SwFrm *pFrm = GetBox( rPt );
- ASSERT( pFrm, "Table not found" );
+ OSL_ENSURE( pFrm, "Table not found" );
if( pFrm )
{
const long nX = pFrm->Frm().Left();
@@ -2251,9 +2187,6 @@ void ClearFEShellTabCols()
|*
|* SwFEShell::GetTblAttr(), SetTblAttr()
|*
-|* Ersterstellung MA 09. Dec. 96
-|* Letzte Aenderung MA 09. Dec. 96
-|
|*************************************************************************/
void SwFEShell::GetTblAttr( SfxItemSet &rSet ) const
{
@@ -2284,13 +2217,13 @@ void SwFEShell::SetTblAttr( const SfxItemSet &rNew )
*/
bool lcl_GoTableRow( SwCrsrShell* pShell, bool bUp )
{
- ASSERT( pShell != NULL, "need shell" );
+ OSL_ENSURE( pShell != NULL, "need shell" );
bool bRet = false;
SwPaM* pPam = pShell->GetCrsr();
const SwStartNode* pTableBox = pPam->GetNode()->FindTableBoxStartNode();
- ASSERT( pTableBox != NULL, "I'm living in a box... NOT!" );
+ OSL_ENSURE( pTableBox != NULL, "I'm living in a box... NOT!" );
// move cursor to start node of table box
pPam->GetPoint()->nNode = pTableBox->GetIndex();
@@ -2539,24 +2472,12 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const
if( nW )
{
rFml += ')';
-
-/*
- // TabellenSelektion erzeugen??
- SwTblBoxFormula aTmp( rFml );
- SwSelBoxes aBoxes;
- for( sal_uInt16 nSelBoxes = aTmp.GetBoxesOfFormula( rTbl,aBoxes );
- nSelBoxes; )
- {
- }
-*/
}
}
return sal_True;
}
-/* -----------------------------22.08.2002 12:50------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwFEShell::IsTableRightToLeft() const
{
SwFrm *pFrm = GetCurrFrm();
@@ -2566,20 +2487,14 @@ sal_Bool SwFEShell::IsTableRightToLeft() const
return pFrm->ImplFindTabFrm()->IsRightToLeft();
}
-/* -----------------------------22.08.2002 12:50------------------------------
-
- ---------------------------------------------------------------------------*/
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" );
+ OSL_ENSURE( pTabFrm, "Table not found" );
return pTabFrm ? pTabFrm->IsRightToLeft() : sal_False;
}
-/* -----------------------------11.02.2004 12:50------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool SwFEShell::IsTableVertical() const
{
SwFrm *pFrm = GetCurrFrm();
@@ -2591,3 +2506,4 @@ sal_Bool SwFEShell::IsTableVertical() const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 7ea3d079cc4b..a0e3a816df45 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <tools/list.hxx>
#include <svx/svdobj.hxx>
#include <init.hxx>
#include <fesh.hxx>
@@ -55,14 +55,10 @@
#include <edimp.hxx>
#include <pagedesc.hxx>
#include <fmtanchr.hxx>
-// OD 29.10.2003 #113049#
#include <environmentofanchoredobject.hxx>
-// OD 12.11.2003 #i22341#
-#include <ndtxt.hxx>
-// OD 27.11.2003 #112045#
+#include <ndtxt.hxx> // #i22341#
#include <dflyobj.hxx>
-// OD 2004-03-29 #i26791#
-#include <dcontact.hxx>
+#include <dcontact.hxx> // #i26791#
using namespace com::sun::star;
@@ -73,9 +69,6 @@ TYPEINIT1(SwFEShell,SwEditShell)
/***********************************************************************
#* Class : SwFEShell
#* Methode : EndAllActionAndCall()
-#*
-#* Datum : MA 03. May. 93
-#* Update : MA 31. Oct. 95
#***********************************************************************/
void SwFEShell::EndAllActionAndCall()
@@ -97,8 +90,6 @@ void SwFEShell::EndAllActionAndCall()
#* Class : SwFEShell
#* Methode : GetCntntPos
#* Beschreibung: Ermitteln des Cntnt's der dem Punkt am naechsten liegt
-#* Datum : MA 02. Jun. 92
-#* Update : MA 02. May. 95
#***********************************************************************/
Point SwFEShell::GetCntntPos( const Point& rPoint, sal_Bool bNext ) const
@@ -156,14 +147,14 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
case RECT_OUTTABSECTION : if( pFrm->IsInTab() )
pFrm = pFrm->FindTabFrm();
else {
- ASSERT( sal_False, "Missing Table" );
+ OSL_ENSURE( sal_False, "Missing Table" );
}
/* KEIN BREAK */
case RECT_SECTION_PRT:
case RECT_SECTION: if( pFrm->IsInSct() )
pFrm = pFrm->FindSctFrm();
else {
- ASSERT( sal_False, "Missing section" );
+ OSL_ENSURE( sal_False, "Missing section" );
}
if( RECT_OUTTABSECTION_PRT == eType ||
@@ -249,9 +240,6 @@ bool SwFEShell::IsDirectlyInSection() const
|*
|* SwFEShell::GetFrmType()
|*
-|* Ersterstellung MA 12. Jan. 93
-|* Letzte Aenderung AMA 25. Nov. 98
-|*
*************************************************************************/
sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const
@@ -300,7 +288,7 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const
nReturn |= FRMTYPE_FLY_ATCNT;
else
{
- ASSERT( ((SwFlyFrm*)pFrm)->IsFlyInCntFrm(),
+ OSL_ENSURE( ((SwFlyFrm*)pFrm)->IsFlyInCntFrm(),
"Neuer Rahmentyp?" );
nReturn |= FRMTYPE_FLY_INCNT;
}
@@ -325,9 +313,6 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const
|*
|* SwFEShell::ShLooseFcs(), ShGetFcs()
|*
-|* Ersterstellung MA 10. May. 93
-|* Letzte Aenderung MA 09. Sep. 98
-|*
*************************************************************************/
void SwFEShell::ShGetFcs( sal_Bool bUpdate )
@@ -352,7 +337,6 @@ void SwFEShell::ShLooseFcs()
Imp()->GetDrawView()->hideMarkHandles();
FrameNotify( this, FLY_DRAG_END );
}
-// ::ResetShell();
}
/*************************************************************************
@@ -360,9 +344,6 @@ void SwFEShell::ShLooseFcs()
|* SwFEShell::GetPhyPageNum()
|* SwFEShell::GetVirtPageNum()
|*
-|* Ersterstellung OK 07.07.93 08:20
-|* Letzte Aenderung MA 03. Jan. 94
-|*
*************************************************************************/
sal_uInt16 SwFEShell::GetPhyPageNum()
@@ -388,15 +369,12 @@ sal_uInt16 SwFEShell::GetVirtPageNum( const sal_Bool bCalcFrm )
|* void SwFEShell::SetPageOffset()
|* sal_uInt16 SwFEShell::GetPageOffset() const
|*
-|* Ersterstellung OK 07.07.93 08:20
-|* Letzte Aenderung MA 30. Mar. 95
-|*
*************************************************************************/
void lcl_SetAPageOffset( sal_uInt16 nOffset, SwPageFrm* pPage, SwFEShell* pThis )
{
pThis->StartAllAction();
- ASSERT( pPage->FindFirstBodyCntnt(),
+ OSL_ENSURE( pPage->FindFirstBodyCntnt(),
"SwFEShell _SetAPageOffset() ohne CntntFrm" );
SwFmtPageDesc aDesc( pPage->GetPageDesc() );
@@ -466,9 +444,6 @@ sal_uInt16 SwFEShell::GetPageOffset() const
|*
|* SwFEShell::InsertLabel()
|*
-|* Ersterstellung MA 10. Feb. 94
-|* Letzte Aenderung MA 10. Feb. 94
-|*
*************************************************************************/
void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
@@ -495,7 +470,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
//Bei Flys den Index auf den StartNode herunterreichen.
nIdx = pCnt->FindFlyFrm()->
GetFmt()->GetCntnt().GetCntntIdx()->GetIndex();
-//warum?? Bug 61913 ParkCrsr( GetCrsr()->GetPoint()->nNode );
}
break;
case LTYPE_TABLE:
@@ -514,7 +488,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
const SdrMarkList& rMrkList = pDView->GetMarkedObjectList();
StartUndo();
- // OD 27.11.2003 #112045# - copy marked drawing objects to
+ // copy marked drawing objects to
// local list to perform the corresponding action for each object
std::vector<SdrObject*> aDrawObjs;
{
@@ -544,7 +518,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
}
break;
default:
- ASSERT( !this, "Crsr weder in Tabelle noch in Fly." );
+ OSL_ENSURE( !this, "Crsr weder in Tabelle noch in Fly." );
}
if( nIdx )
@@ -564,8 +538,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
/***********************************************************************
#* Class : SwFEShell
#* Methoden : Sort
-#* Datum : ??
-#* Update : ??
#***********************************************************************/
sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
@@ -581,7 +553,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
// Tabelle sortieren
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
SwFrm *pFrm = GetCurrFrm( sal_False );
- ASSERT( pFrm->FindTabFrm(), "Crsr nicht in Tabelle." );
+ OSL_ENSURE( pFrm->FindTabFrm(), "Crsr nicht in Tabelle." );
// lasse ueber das Layout die Boxen suchen
SwSelBoxes aBoxes;
@@ -593,7 +565,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
while( !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
{
- /* #107993# ParkCursor->ParkCursorTab */
+ /* ParkCursor->ParkCursorTab */
ParkCursorInTab();
}
@@ -642,9 +614,6 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
|*
|* SwFEShell::GetCurColNum(), _GetColNum()
|*
-|* Ersterstellung MA 03. Feb. 95
-|* Letzte Aenderung MA 20. Apr. 95
-|
|*************************************************************************/
sal_uInt16 SwFEShell::_GetCurColNum( const SwFrm *pFrm,
@@ -692,7 +661,7 @@ sal_uInt16 SwFEShell::_GetCurColNum( const SwFrm *pFrm,
sal_uInt16 SwFEShell::GetCurColNum( SwGetCurColNumPara* pPara ) const
{
- ASSERT( GetCurrFrm(), "Crsr geparkt?" );
+ OSL_ENSURE( GetCurrFrm(), "Crsr geparkt?" );
return _GetCurColNum( GetCurrFrm(), pPara );
}
@@ -700,12 +669,12 @@ sal_uInt16 SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const
{
sal_uInt16 nRet = 0;
SwFrm* pFrm = GetCurrFrm();
- ASSERT( pFrm, "Crsr geparkt?" );
+ OSL_ENSURE( pFrm, "Crsr geparkt?" );
if( pFrm )
{
pFrm = pFrm->IsInTab() ? (SwFrm*)pFrm->FindTabFrm()
: (SwFrm*)pFrm->FindSctFrm();
- ASSERT( pFrm, "No Tab, no Sect" );
+ OSL_ENSURE( pFrm, "No Tab, no Sect" );
if( pFrm )
nRet = _GetCurColNum( pFrm, pPara );
}
@@ -730,11 +699,11 @@ SwFEShell::~SwFEShell()
delete pChainTo;
}
-// OD 18.09.2003 #i17567#, #108749#, #110354# - adjustments for allowing
+// #i17567# - adjustments for allowing
// negative vertical positions for fly frames anchored to paragraph/to character.
-// OD 06.11.2003 #i22305# - adjustments for option 'Follow text flow'
+// #i22305# - adjustments for option 'Follow text flow'
// for to frame anchored objects.
-// OD 12.11.2003 #i22341# - adjustments for vertical alignment at top of line
+// #i22341# - adjustments for vertical alignment at top of line
// for to character anchored objects.
void SwFEShell::CalcBoundRect( SwRect& _orRect,
const RndStdIds _nAnchorId,
@@ -922,7 +891,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aPos = pFrm->Frm().TopRight();
else
aPos = (pFrm->Frm().*fnRect->fnGetPos)();
- // OD 08.09.2003 #i17567#, #108749#, #110354# - allow negative positions
+ // #i17567# - allow negative positions
// for fly frames anchor to paragraph/to character.
if ((_nAnchorId == FLY_AT_PARA) || (_nAnchorId == FLY_AT_CHAR))
{
@@ -931,7 +900,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// and vertically by the printing area of the vertical environment,
// if the object follows the text flow, or by the frame area of the
// vertical environment, if the object doesn't follow the text flow.
- // OD 29.10.2003 #113049# - new class <SwEnvironmentOfAnchoredObject>
+ // new class <SwEnvironmentOfAnchoredObject>
objectpositioning::SwEnvironmentOfAnchoredObject aEnvOfObj(
_bFollowTextFlow );
const SwLayoutFrm& rHoriEnvironLayFrm =
@@ -944,7 +913,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
{
aVertEnvironRect = rVertEnvironLayFrm.Prt();
aVertEnvironRect.Pos() += rVertEnvironLayFrm.Frm().Pos();
- // OD 19.09.2003 #i18732# - adjust vertical 'virtual' anchor position
+ // #i18732# - adjust vertical 'virtual' anchor position
// (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
@@ -968,7 +937,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
else
{
- ASSERT( rVertEnvironLayFrm.IsPageFrm(),
+ OSL_ENSURE( rVertEnvironLayFrm.IsPageFrm(),
"<SwFEShell::CalcBoundRect(..)> - not following text flow, but vertical environment *not* page!" );
aVertEnvironRect = rVertEnvironLayFrm.Frm();
// OD 19.09.2003 #i18732# - adjustment vertical 'virtual' anchor position
@@ -1013,7 +982,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
}
- // OD 12.11.2003 #i22341# - adjust vertical 'virtual' anchor position
+ // #i22341# - adjust vertical 'virtual' anchor position
// (<aPos.Y()> respectively <aPos.X()>), if object is anchored to
// character and vertical aligned at character or top of line
// --> OD 2005-12-29 #125800#
@@ -1323,9 +1292,7 @@ Size SwFEShell::GetGraphicDefaultSize() const
}
return aRet;
}
-/* -----------------------------12.08.2002 12:51------------------------------
- ---------------------------------------------------------------------------*/
// --> OD 2009-08-31 #mongolianlayou#
// add output parameter <bVertL2R>
sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, sal_Bool& bVertL2R) const
@@ -1341,33 +1308,27 @@ sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, s
return bVert;
SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- // --> OD 2006-01-06 #123831# - make code robust:
if ( !pObj )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::IsFrmVertical(..)> - missing SdrObject instance in marked object list -> This is a serious situation, please inform OD" );
return bVert;
}
- // <--
- // OD 2004-03-29 #i26791#
+ // #i26791#
SwContact* pContact = static_cast<SwContact*>(GetUserCall( pObj ));
- // --> OD 2006-01-06 #123831# - make code robust:
if ( !pContact )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::IsFrmVertical(..)> - missing SwContact instance at marked object -> This is a serious situation, please inform OD" );
return bVert;
}
- // <--
const SwFrm* pRef = pContact->GetAnchoredObj( pObj )->GetAnchorFrm();
- // --> OD 2006-01-06 #123831# - make code robust:
if ( !pRef )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFEShell::IsFrmVertical(..)> - missing anchor frame at marked object -> This is a serious situation, please inform OD" );
return bVert;
}
- // <--
if ( pObj->ISA(SwVirtFlyDrawObj) && !bEnvironment )
pRef = static_cast<const SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
@@ -1386,3 +1347,4 @@ void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& )
// does not do anything, only avoids crash if the method is used for wrong shell
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 4006e30922e8..89e16c0f1bb1 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -217,7 +218,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTblSearchType eSearchType )
{
//Start- und Endzelle besorgen und den naechsten fragen.
- ASSERT( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
+ OSL_ENSURE( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
// Zeilen-Selektion:
@@ -249,14 +250,14 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const sal_uLong nMarkSectionStart = pMarkNode->StartOfSectionIndex();
const SwTableBox* pMarkBox = rTbl.GetTblBox( nMarkSectionStart );
- ASSERT( pMarkBox, "Point in table, mark outside?" )
+ OSL_ENSURE( pMarkBox, "Point in table, mark outside?" );
const SwTableLine* pLine = pMarkBox ? pMarkBox->GetUpper() : 0;
sal_uInt16 nSttPos = rLines.GetPos( pLine );
- ASSERT( USHRT_MAX != nSttPos, "Wo ist meine Zeile in der Tabelle?" );
+ OSL_ENSURE( USHRT_MAX != nSttPos, "Wo ist meine Zeile in der Tabelle?" );
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?" );
+ OSL_ENSURE( 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 )
{
@@ -304,20 +305,18 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
SwSelBoxes& rBoxes, SwCellFrms* pCells,
const SwTblSearchType eSearchType )
{
- // #112697# Robust:
const SwTabFrm* pStartTab = pStart->FindTabFrm();
if ( !pStartTab )
{
- ASSERT( false, "GetTblSel without start table" )
+ OSL_ENSURE( false, "GetTblSel without start table" );
return;
}
int bChkProtected = nsSwTblSearchType::TBLSEARCH_PROTECT & eSearchType;
sal_Bool bTblIsValid;
- // --> FME 2006-01-25 #i55421# Reduced value 10
- int nLoopMax = 10; //JP 28.06.99: max 100 loops - Bug 67292
- // <--
+ // #i55421# Reduced value 10
+ int nLoopMax = 10;
sal_uInt16 i;
do {
@@ -372,7 +371,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
break;
}
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
SwTableBox* pBox = (SwTableBox*)
@@ -465,11 +464,11 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
break;
}
- // --> FME 2005-10-13 #125337# Make code robust, check if pStart has
+ // --> Make code robust, check if pStart has
// been deleted due to the formatting of the table:
if ( aDelCheck.HasBeenDeleted() )
{
- ASSERT( false, "Current box has been deleted during GetTblSel()" )
+ OSL_ENSURE( false, "Current box has been deleted during GetTblSel()" );
break;
}
// <--
@@ -479,7 +478,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
--nLoopMax;
} while( sal_True );
- ASSERT( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
+ OSL_ENSURE( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
}
@@ -497,31 +496,31 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if( !pCNd )
pCNd = aIdx.GetNodes().GoNextSection( &aIdx, sal_False, sal_False );
- // #109394# if table is invisible, return
+ // if table is invisible, return
// (layout needed for forming table selection further down, so we can't
// continue with invisible tables)
- // OD 07.11.2003 #i22135# - Also the content of the table could be
+ // #i22135# - Also the content of the table could be
// invisible - e.g. in a hidden section
// Robust: check, if content was found (e.g. empty table cells)
if ( !pCNd || pCNd->GetFrm() == NULL )
return sal_False;
const SwLayoutFrm *pStart = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
- ASSERT( pStart, "ohne Frame geht gar nichts" );
+ OSL_ENSURE( pStart, "ohne Frame geht gar nichts" );
aIdx = rEndNd;
pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
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
+ // #i22135# - Robust: check, if content was found and if it's visible
if ( !pCNd || pCNd->GetFrm() == NULL )
{
return sal_False;
}
const SwLayoutFrm *pEnd = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
- ASSERT( pEnd, "ohne Frame geht gar nichts" );
+ OSL_ENSURE( pEnd, "ohne Frame geht gar nichts" );
sal_Bool bTblIsValid, bValidChartSel;
@@ -584,7 +583,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
break;
}
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
const SwRect& rUnion = pUnion->GetUnion(),
& rFrmRect = pCell->Frm();
@@ -737,7 +736,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
pGetCLines->DeleteAndDestroy( 0, pGetCLines->Count() );
} while( sal_True );
- ASSERT( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
+ OSL_ENSURE( nLoopMax, "das Layout der Tabelle wurde nicht valide!" );
if( !bValidChartSel && pGetCLines )
pGetCLines->DeleteAndDestroy( 0, pGetCLines->Count() );
@@ -748,7 +747,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
sal_Bool IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell )
{
- ASSERT( pCell->IsCellFrm(), "Frame ohne Gazelle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Gazelle" );
if( pCell->FindTabFrm()->IsVertical() )
return ( rUnion.Right() >= pCell->Frm().Right() &&
@@ -828,7 +827,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
break;
}
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
pUpperCell = (SwCellFrm*)pCell;
@@ -897,7 +896,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
break;
}
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
const SwCellFrm* pC = (SwCellFrm*)pCell;
@@ -947,7 +946,7 @@ _CmpLPt::_CmpLPt( const Point& rPt, const SwTableBox* pBox, sal_Bool bVertical )
void lcl_InsTblBox( SwTableNode* pTblNd, SwDoc* pDoc, SwTableBox* pBox,
sal_uInt16 nInsPos, sal_uInt16 nCnt = 1 )
{
- ASSERT( pBox->GetSttNd(), "Box ohne Start-Node" );
+ OSL_ENSURE( pBox->GetSttNd(), "Box ohne Start-Node" );
SwCntntNode* pCNd = pDoc->GetNodes()[ pBox->GetSttIdx() + 1 ]
->GetCntntNode();
if( pCNd && pCNd->IsTxtNode() )
@@ -1007,13 +1006,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
//Zuerst lassen wir uns die Tabellen und die Rechtecke heraussuchen.
- ASSERT( rPam.GetCntntNode() && rPam.GetCntntNode( sal_False ),
+ OSL_ENSURE( rPam.GetCntntNode() && rPam.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
//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( rShell.GetCharRect().Pos() );
Point aPt( 0, 0 );
const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
&aPt )->GetUpper(),
@@ -1055,7 +1053,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
while ( pCell && pRow->IsAnLower( pCell ) )
{
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
// in der vollen Breite ueberlappend ?
if( rUnion.Top() <= pCell->Frm().Top() &&
rUnion.Bottom() >= pCell->Frm().Bottom() )
@@ -1205,7 +1203,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if ( pCell->GetNext() )
{
pCell = (const SwLayoutFrm*)pCell->GetNext();
- // --> FME 2005-11-03 #125288# Check if table cell is not empty
+ // --> Check if table cell is not empty
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -1485,7 +1483,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// in der MergeBox sollte jetzt der gesamte Text stehen
// loesche jetzt noch den initialen TextNode
- ASSERT( (*ppMergeBox)->GetSttIdx()+2 <
+ OSL_ENSURE( (*ppMergeBox)->GetSttIdx()+2 <
(*ppMergeBox)->GetSttNd()->EndOfSectionIndex(),
"leere Box" );
SwNodeIndex aIdx( *(*ppMergeBox)->GetSttNd()->EndOfSectionNode(), -1 );
@@ -1608,31 +1606,6 @@ SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish,
return nRet;
}
-/* MA: 20. Sep. 93 wird nicht mehr gebraucht.
-static const SwLayoutFrm *GetPrevCell( const SwLayoutFrm *pCell )
-{
- const SwLayoutFrm *pLay = pCell->GetPrevLayoutLeaf();
- if ( pLay && pLay->IsLayoutFrm() && !pLay->IsTab() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch die Umgebung einer Tab zurueck
- //(naehmlich genau dann, wenn die Zelle noch Vorgaenger hat).
- const SwFrm *pFrm = pLay->Lower();
- while ( pFrm->GetNext() )
- pFrm = pFrm->GetNext();
- pLay = pFrm->IsTabFrm() ? (SwLayoutFrm*)pFrm : 0;
- }
- if ( pLay && pLay->IsTabFrm() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch Tabellen zurueck die letzte
- //Zelle dieser Tabelle ist das das gesuchte Blatt.
- pLay = ((SwTabFrm*)pLay)->FindLastCntnt()->GetUpper();
- while ( !pLay->IsCellFrm() )
- pLay = pLay->GetUpper();
- }
- return pLay;
-}
-*/
-
void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
const SwLayoutFrm *&rpEnd,
const int bChkProtected )
@@ -1728,7 +1701,7 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
while ( pTab->IsFollow() )
{
const SwFrm *pTmp = pTab->FindPrev();
- ASSERT( pTmp->IsTabFrm(), "Vorgaenger vom Follow nicht der Master." );
+ OSL_ENSURE( pTmp->IsTabFrm(), "Vorgaenger vom Follow nicht der Master." );
pTab = (const SwTabFrm*)pTmp;
}
@@ -1796,7 +1769,7 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
const SwCntntFrm* pLastCntnt = pTab->FindLastCntnt();
rpEnd = pLastCntnt ? pLastCntnt->GetUpper() : 0;
- // --> FME 2006-07-17 #134385# Made code robust. If pTab does not have a lower,
+ // --> Made code robust. If pTab does not have a lower,
// we would crash here.
if ( !pLastCntnt ) return;
// <--
@@ -1851,7 +1824,7 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
if ( !pTmpLeaf || !pTmpTab->IsAnLower( pTmpLeaf ) )
{
pTmpTab = (const SwTabFrm*)pTmpTab->FindPrev();
- ASSERT( pTmpTab->IsTabFrm(), "Vorgaenger vom Follow nicht der Master.");
+ OSL_ENSURE( pTmpTab->IsTabFrm(), "Vorgaenger vom Follow nicht der Master.");
rpEnd = pTmpTab->FindLastCntnt()->GetUpper();
while( !rpEnd->IsCellFrm() )
rpEnd = rpEnd->GetUpper();
@@ -1872,10 +1845,9 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
while ( pEnd && !pEnd->IsCellFrm() )
pEnd = pEnd->GetUpper();
- // #112697# Robust:
if ( !pStart || !pEnd )
{
- ASSERT( false, "MakeSelUnions with pStart or pEnd not in CellFrm" )
+ OSL_ENSURE( false, "MakeSelUnions with pStart or pEnd not in CellFrm" );
return;
}
@@ -1889,7 +1861,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
{
if ( !pTable->IsAnFollow( pEndTable ) )
{
- ASSERT( pEndTable->IsAnFollow( pTable ), "Tabkette verknotet." );
+ OSL_ENSURE( pEndTable->IsAnFollow( pTable ), "Tabkette verknotet." );
bExchange = sal_True;
}
}
@@ -1923,11 +1895,9 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
else if( nsSwTblSearchType::TBLSEARCH_COL == ((~nsSwTblSearchType::TBLSEARCH_PROTECT ) & eSearchType ) )
::lcl_FindStartEndCol( pStart, pEnd, nsSwTblSearchType::TBLSEARCH_PROTECT & eSearchType );
- // --> FME 2006-07-17 #134385# Made code robust.
- if ( !pEnd ) return;
- // <--
+ if ( !pEnd ) return; // Made code robust.
- //neu besorgen, da sie jetzt verschoben sind. MA: 28. Dec. 93 Bug 5190
+ //neu besorgen, da sie jetzt verschoben sind.
pTable = pStart->FindTabFrm();
pEndTable = pEnd->FindTabFrm();
@@ -2013,7 +1983,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
pTmpCell = static_cast<const SwRowFrm*>(pTmpRow)->Lower();
pTmpRow = static_cast<const SwCellFrm*>(pTmpCell)->Lower();
}
- ASSERT( !pTmpCell || pTmpCell->IsCellFrm(), "Lower of rowframe != cellframe?!" )
+ OSL_ENSURE( !pTmpCell || pTmpCell->IsCellFrm(), "Lower of rowframe != cellframe?!" );
}
// <--
@@ -2119,7 +2089,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
while ( pCell && pRow->IsAnLower( pCell ) )
{
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
if( (pCell->Frm().*fnRect->fnGetWidth)() < nMinValue )
@@ -2231,7 +2201,7 @@ void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable )
const sal_uInt16 nPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLine ) + 1;
- ASSERT( nPos != USHRT_MAX, "TableLine not found." );
+ OSL_ENSURE( nPos != USHRT_MAX, "TableLine not found." );
if( nStPos > nPos )
nStPos = nPos;
@@ -2259,13 +2229,13 @@ void _FndBox::SetTableLines( const SwTable &rTable )
SwTableLine* pTmpLine = GetLines()[0]->GetLine();
sal_uInt16 nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pTmpLine );
- ASSERT( USHRT_MAX != nPos, "Line steht nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nPos, "Line steht nicht in der Tabelle" );
if( nPos )
pLineBefore = rTable.GetTabLines()[ nPos - 1 ];
pTmpLine = GetLines()[GetLines().Count()-1]->GetLine();
nPos = rTable.GetTabLines().C40_GETPOS( SwTableLine, pTmpLine );
- ASSERT( USHRT_MAX != nPos, "Line steht nicht in der Tabelle" );
+ OSL_ENSURE( USHRT_MAX != nPos, "Line steht nicht in der Tabelle" );
if( ++nPos < rTable.GetTabLines().Count() )
pLineBehind = rTable.GetTabLines()[nPos];
}
@@ -2291,7 +2261,7 @@ void _FndBox::DelFrms( SwTable &rTable )
{
nStPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLineBefore );
- ASSERT( nStPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
+ OSL_ENSURE( nStPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
++nStPos;
}
if( rTable.IsNewModel() && pLineBehind )
@@ -2300,7 +2270,7 @@ void _FndBox::DelFrms( SwTable &rTable )
{
nEndPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLineBehind );
- ASSERT( nEndPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
+ OSL_ENSURE( nEndPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
--nEndPos;
}
@@ -2344,7 +2314,7 @@ void _FndBox::DelFrms( SwTable &rTable )
if ( pPrev )
{
SwFrm *pTmp = pPrev->FindPrev();
- ASSERT( pTmp->IsTabFrm(),
+ OSL_ENSURE( pTmp->IsTabFrm(),
"Vorgaenger vom Follow kein Master.");
pPrev = (SwTabFrm*)pTmp;
}
@@ -2420,7 +2390,7 @@ sal_Bool lcl_IsLineOfTblFrm( const SwTabFrm& rTable, const SwFrm& rChk )
*/
void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers )
{
- ASSERT( rTabFrm.IsFollow(), "lcl_UpdateRepeatedHeadlines called for non-follow tab" )
+ OSL_ENSURE( rTabFrm.IsFollow(), "lcl_UpdateRepeatedHeadlines called for non-follow tab" );
// Delete remaining headlines:
SwRowFrm* pLower = 0;
@@ -2459,7 +2429,7 @@ void _FndBox::MakeFrms( SwTable &rTable )
{
nStPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLineBefore );
- ASSERT( nStPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
+ OSL_ENSURE( nStPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
++nStPos;
}
@@ -2467,7 +2437,7 @@ void _FndBox::MakeFrms( SwTable &rTable )
{
nEndPos = rTable.GetTabLines().GetPos(
(const SwTableLine*&)pLineBehind );
- ASSERT( nEndPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
+ OSL_ENSURE( nEndPos != USHRT_MAX, "Fuchs Du hast die Line gestohlen!" );
--nEndPos;
}
//Jetzt die grosse Einfuegeoperation fuer alle Tabllen.
@@ -2660,8 +2630,8 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
lcl_UpdateRepeatedHeadlines( *pTable, true );
}
- ASSERT( ((SwRowFrm*)pTable->Lower())->GetTabLine() ==
- rTable.GetTabLines()[0], "MakeNewFrms: Table corruption!" )
+ OSL_ENSURE( ((SwRowFrm*)pTable->Lower())->GetTabLine() ==
+ rTable.GetTabLines()[0], "MakeNewFrms: Table corruption!" );
}
}
}
@@ -2694,7 +2664,7 @@ sal_Bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const
if ( nBfPos == nBhPos ) //Duerfte eigentlich nie vorkommen.
{
- ASSERT( sal_False, "Table, Loeschen auf keinem Bereich !?!" );
+ OSL_ENSURE( sal_False, "Table, Loeschen auf keinem Bereich !?!" );
return sal_False;
}
@@ -2732,3 +2702,4 @@ sal_Bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 85c9a028e5af..e652a0a12c2b 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,12 +48,8 @@
#include <grfatr.hxx>
#include <swunohelper.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _UNOMID_H
#include <unomid.h>
-#endif
using namespace ::com::sun::star;
@@ -91,10 +88,10 @@ sal_Bool lcl_IsHoriOnOddPages(int nEnum)
nEnum == RES_MIRROR_GRAPH_BOTH;
return bEnum;
}
-sal_Bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True,
- bVal;
+ bool bRet = true;
+ sal_Bool bVal;
// Vertikal und Horizontal sind mal getauscht worden!
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
@@ -110,16 +107,16 @@ sal_Bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
GetValue() == RES_MIRROR_GRAPH_BOTH;
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
rVal.setValue( &bVal, ::getBooleanCppuType() );
return bRet;
}
-sal_Bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
sal_Bool bVal = *(sal_Bool*)rVal.getValue();
// Vertikal und Horizontal sind mal getauscht worden!
nMemberId &= ~CONVERT_TWIPS;
@@ -159,8 +156,8 @@ sal_Bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -198,15 +195,15 @@ int SwRotationGrf::operator==( const SfxPoolItem& rCmp ) const
}
-sal_Bool SwRotationGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
+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 sal_True;
+ return true;
}
-sal_Bool SwRotationGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
+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
@@ -215,11 +212,11 @@ sal_Bool SwRotationGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
{
// sal_uInt16 argument needed
SetValue( (sal_uInt16) nValue );
- return sal_True;
+ return true;
}
- DBG_ERROR( "SwRotationGrf::PutValue - Wrong type!" );
- return sal_False;
+ OSL_FAIL( "SwRotationGrf::PutValue - Wrong type!" );
+ return false;
}
// ------------------------------------------------------------------
@@ -270,13 +267,13 @@ int SwGammaGrf::operator==( const SfxPoolItem& rCmp ) const
nValue == ((SwGammaGrf&)rCmp).GetValue();
}
-sal_Bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
+bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
rVal <<= nValue;
- return sal_True;
+ return true;
}
-sal_Bool SwGammaGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
+bool SwGammaGrf::PutValue( const uno::Any& rVal, sal_uInt8 )
{
return rVal >>= nValue;
}
@@ -295,35 +292,34 @@ SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
return new SwTransparencyGrf( *this );
}
// ------------------------------------------------------------------
-sal_Bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
+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 sal_True;
+ return true;
}
// ------------------------------------------------------------------
-sal_Bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
+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 sal_False;
+ return false;
if(nVal < 0)
{
// for compatibility with old documents
- // OD 05.11.2002 #104308# - introduce rounding as for SO 6.0 PP2
- // introduced by fix of #104293#.
+ // introduce rounding as for SO 6.0 PP2
nVal = ( ( nVal * 128 ) - (99/2) ) / 100;
nVal += 128;
}
DBG_ASSERT( 0 <= nVal && nVal <= 100, "value out of range" );
SetValue(static_cast<sal_uInt8>(nVal));
- return sal_True;
+ return true;
}
// ------------------------------------------------------------------
@@ -335,32 +331,29 @@ SfxPoolItem* SwDrawModeGrf::Clone( SfxItemPool * ) const
sal_uInt16 SwDrawModeGrf::GetValueCount() const
{
- // GRAPHICDRAWMODE_STANDARD = 0,
- // GRAPHICDRAWMODE_GREYS = 1,
- // GRAPHICDRAWMODE_MONO = 2,
- // GRAPHICDRAWMODE_WATERMARK = 3
return GRAPHICDRAWMODE_WATERMARK + 1;
}
-sal_Bool SwDrawModeGrf::QueryValue( uno::Any& rVal,
+bool SwDrawModeGrf::QueryValue( uno::Any& rVal,
sal_uInt8 ) const
{
drawing::ColorMode eRet = (drawing::ColorMode)GetEnumValue();
rVal <<= eRet;
- return sal_True;
+ return true;
}
-sal_Bool SwDrawModeGrf::PutValue( const uno::Any& rVal,
+bool SwDrawModeGrf::PutValue( const uno::Any& rVal,
sal_uInt8 )
{
sal_Int32 eVal = SWUnoHelper::GetEnumAsInt32( rVal );
if(eVal >= 0 && eVal <= GRAPHICDRAWMODE_WATERMARK)
{
SetEnumValue((sal_uInt16)eVal);
- return sal_True;
+ return true;
}
- return sal_False;
+ return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 1f8dc1ee488b..aa34ff35f0e1 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <vcl/salbtype.hxx> // FRound
#include <tools/urlobj.hxx>
#include <svl/undo.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
#include <svl/fstathelper.hxx>
-#endif
#include <svtools/imap.hxx>
#include <svtools/filter.hxx>
#include <sot/storage.hxx>
@@ -151,13 +150,13 @@ sal_Bool SwGrfNode::ReRead(
{
sal_Bool bReadGrf = sal_False, bSetTwipSize = sal_True;
- ASSERT( pGraphic || pGrfObj || rGrfName.Len(),
+ OSL_ENSURE( pGraphic || pGrfObj || rGrfName.Len(),
"GraphicNode without a name, Graphic or GraphicObject" );
// ReadRead mit Namen
if( refLink.Is() )
{
- ASSERT( !bInSwapIn, "ReRead: stehe noch im SwapIn" );
+ OSL_ENSURE( !bInSwapIn, "ReRead: stehe noch im SwapIn" );
if( rGrfName.Len() )
{
@@ -288,10 +287,7 @@ sal_Bool SwGrfNode::ReRead(
// der neue Kink nicht geladen werden konnte.
Graphic aGrf; aGrf.SetDefaultType();
aGrfObj.SetGraphic( aGrf, rGrfName );
- // --> OD 2006-11-03 #i59688#
- // do not load linked graphic, if it isn't a new linked graphic.
-// //TODO refLink->setInputStream(getInputStream());
-// ((SwBaseLink*)&refLink)->SwapIn();
+ // #i59688# - do not load linked graphic, if it isn't a new linked graphic.
if ( bNewGrf )
{
((SwBaseLink*)&refLink)->SwapIn();
@@ -326,7 +322,7 @@ SwGrfNode::~SwGrfNode()
SwDoc* pDoc = GetDoc();
if( refLink.Is() )
{
- ASSERT( !bInSwapIn, "DTOR: stehe noch im SwapIn" );
+ OSL_ENSURE( !bInSwapIn, "DTOR: stehe noch im SwapIn" );
pDoc->GetLinkManager().Remove( refLink );
refLink->Disconnect();
}
@@ -366,7 +362,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
SwAttrSet* pAutoAttr,
sal_Bool bDelayed )
{
- ASSERT( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
+ OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
SwGrfNode *pNode;
// Delayed erzeugen nur aus dem SW/G-Reader
if( bDelayed )
@@ -383,7 +379,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
SwGrfFmtColl* pGrfColl,
SwAttrSet* pAutoAttr )
{
- ASSERT( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
+ OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
return new SwGrfNode( rWhere, rGrfObj, pGrfColl, pAutoAttr );
}
@@ -460,10 +456,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
// --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
+ // #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
@@ -479,7 +472,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
catch ( uno::Exception& )
{
// --> OD 2005-04-25 #i48434#
- ASSERT( false, "<SwGrfNode::SwapIn(..)> - unhandled exception!" );
+ OSL_ENSURE( false, "<SwGrfNode::SwapIn(..)> - unhandled exception!" );
// <--
}
// <--
@@ -562,7 +555,7 @@ sal_Bool SwGrfNode::SavePersistentData()
{
if( refLink.Is() )
{
- ASSERT( !bInSwapIn, "SavePersistentData: stehe noch im SwapIn" );
+ OSL_ENSURE( !bInSwapIn, "SavePersistentData: stehe noch im SwapIn" );
GetDoc()->GetLinkManager().Remove( refLink );
return sal_True;
}
@@ -641,8 +634,6 @@ void SwGrfNode::ReleaseLink()
{
if( refLink.Is() )
{
- // erst die Grafik reinswappen!
-// if( aGraphic.IsSwapOut() || !refLink->IsSynchron() )
{
bInSwapIn = sal_True;
SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
@@ -699,7 +690,7 @@ void SwGrfNode::ScaleImageMap()
nWidth -= rBox.CalcLineSpace(BOX_LINE_LEFT) +
rBox.CalcLineSpace(BOX_LINE_RIGHT);
- ASSERT( nWidth>0, "Gibt es 0 twip breite Grafiken!?" );
+ OSL_ENSURE( nWidth>0, "Gibt es 0 twip breite Grafiken!?" );
if( nGrfSize.Width() != nWidth )
{
@@ -714,7 +705,7 @@ void SwGrfNode::ScaleImageMap()
nHeight -= rBox.CalcLineSpace(BOX_LINE_TOP) +
rBox.CalcLineSpace(BOX_LINE_BOTTOM);
- ASSERT( nHeight>0, "Gibt es 0 twip hohe Grafiken!?" );
+ OSL_ENSURE( nHeight>0, "Gibt es 0 twip hohe Grafiken!?" );
if( nGrfSize.Height() != nHeight )
{
@@ -754,7 +745,7 @@ void SwGrfNode::DelStreamName()
catch ( uno::Exception& )
{
// --> OD 2005-04-25 #i48434#
- ASSERT( false, "<SwGrfNode::DelStreamName()> - unhandled exception!" );
+ OSL_ENSURE( false, "<SwGrfNode::DelStreamName()> - unhandled exception!" );
// <--
}
}
@@ -773,7 +764,7 @@ uno::Reference< embed::XStorage > SwGrfNode::_GetDocSubstorageOrRoot( const Stri
{
uno::Reference < embed::XStorage > refStor =
const_cast<SwGrfNode*>(this)->GetDoc()->GetDocStorage();
- ASSERT( refStor.is(), "Kein Storage am Doc" );
+ OSL_ENSURE( refStor.is(), "Kein Storage am Doc" );
if ( aStgName.Len() )
{
@@ -808,15 +799,11 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
// re-generating its name.
// A save action can have changed the filename of the embedded graphic,
// because a changed unique ID of the graphic is calculated.
- // --> OD 2006-01-30 #b6364738#
- // recursive calls of <GetUniqueID()> have to be avoided.
+ // --> recursive calls of <GetUniqueID()> have to be avoided.
// Thus, use local static boolean to assure this.
- static bool bInRegenerateStrmName( false );
- if ( !bInRegenerateStrmName &&
- ( !_refPics->hasByName( _aStrmName ) ||
- !_refPics->isStreamElement( _aStrmName ) ) )
+ if ( !_refPics->hasByName( _aStrmName ) ||
+ !_refPics->isStreamElement( _aStrmName ) )
{
- bInRegenerateStrmName = true;
xub_StrLen nExtPos = _aStrmName.Search( '.' );
String aExtStr = _aStrmName.Copy( nExtPos );
Graphic aGraphic( GetGrfObj().GetGraphic() );
@@ -825,7 +812,6 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
_aStrmName = String( GetGrfObj().GetUniqueID(), RTL_TEXTENCODING_ASCII_US );
_aStrmName += aExtStr;
}
- bInRegenerateStrmName = false;
}
// <--
@@ -838,7 +824,7 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
}
else
{
- ASSERT( false, "<SwGrfNode::_GetStreamForEmbedGrf(..)> - embedded graphic file not found!" );
+ OSL_ENSURE( false, "<SwGrfNode::_GetStreamForEmbedGrf(..)> - embedded graphic file not found!" );
}
}
@@ -858,7 +844,11 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
if( !aUserData.Len() )
return;
- String aProt( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.Package:" ) );
+ if (aNewStrmName.Len()>0) {
+ aUserData=aNewStrmName;
+ }
+
+ String aProt( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) );
if( 0 == aUserData.CompareTo( aProt, aProt.Len() ) )
{
// 6.0 (XML) Package
@@ -878,10 +868,10 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwGrfNode::_GetStreamStorageNames(..)> - unknown graphic URL type. Code for handling 3.1 - 5.2 storages has been deleted by issue i53025." );
}
- ASSERT( STRING_NOTFOUND == rStrmName.Search( '/' ),
+ OSL_ENSURE( STRING_NOTFOUND == rStrmName.Search( '/' ),
"invalid graphic stream name" );
}
// <--
@@ -898,10 +888,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
+ // #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
@@ -916,7 +903,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
catch ( uno::Exception& )
{
// --> OD 2005-04-25 #i48434#
- ASSERT( false, "<SwGrfNode::MakeCopy(..)> - unhandled exception!" );
+ OSL_ENSURE( false, "<SwGrfNode::MakeCopy(..)> - unhandled exception!" );
// <--
}
// <--
@@ -953,7 +940,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
{
SvStream* pRet;
- // #101174#: Keep graphic while in swap in. That's at least important
+ // Keep graphic while in swap in. That's at least important
// when breaking links, because in this situation a reschedule call and
// a DataChanged call lead to a paint of the graphic.
if( pGrfObj->IsInSwapOut() && (IsSelected() || bInSwapIn) )
@@ -985,10 +972,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
// --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
- // --> OD, MAV 2005-08-17 #i53025# - needed correction of new
- // method <_GetStreamForEmbedGrf(..)>
-// bool bGraphic(false);
-// SvStream* pStrm = _GetStreamForEmbedGrf( bGraphic );
+ // #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
String aStrmName, aPicStgName;
_GetStreamStorageNames( aStrmName, aPicStgName );
uno::Reference < embed::XStorage > refPics = _GetDocSubstorageOrRoot( aPicStgName );
@@ -1011,7 +995,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
catch ( uno::Exception& )
{
// --> OD 2005-04-25 #i48434#
- ASSERT( false, "<SwapGraphic> - unhandled exception!" );
+ OSL_ENSURE( false, "<SwapGraphic> - unhandled exception!" );
// <--
}
// <--
@@ -1143,7 +1127,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
{
if ( !IsLinkedFile() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwGrfNode::TriggerAsyncLoad()> - Method is misused. Method call is only valid for graphic nodes, which refer a linked graphic file" );
return;
}
@@ -1209,7 +1193,7 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
{
String sGrfNm;
refLink->GetLinkManager()->GetDisplayNames( refLink, 0, &sGrfNm, 0, 0 );
- String sProtocol( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.pkg:" ) );
+ String sProtocol( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.pkg:" ) );
if ( sGrfNm.CompareTo( sProtocol, sProtocol.Len() ) != 0 )
{
bRet = true;
@@ -1219,3 +1203,5 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
return bRet;
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/GetMetricVal.hxx b/sw/source/core/inc/GetMetricVal.hxx
index 0d897cfa395a..a752aa53b0d1 100644
--- a/sw/source/core/inc/GetMetricVal.hxx
+++ b/sw/source/core/inc/GetMetricVal.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ inline sal_uInt16 GetMetricVal( int n )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 5b03672f461f..415b8e7b6a68 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,5 @@ namespace sw { namespace mark
};
}}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwGrammarMarkUp.hxx b/sw/source/core/inc/SwGrammarMarkUp.hxx
index 393c917bfc45..0d831d3f0b2a 100644
--- a/sw/source/core/inc/SwGrammarMarkUp.hxx
+++ b/sw/source/core/inc/SwGrammarMarkUp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index 11888f67a8ae..a78e00bbc753 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwUndoFmt.hxx b/sw/source/core/inc/SwUndoFmt.hxx
index 1df5436e7ad2..0eeb4df3f802 100644
--- a/sw/source/core/inc/SwUndoFmt.hxx
+++ b/sw/source/core/inc/SwUndoFmt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,7 +95,6 @@ class SwUndoRenameFmt : public SwUndo
protected:
String sOldName, sNewName;
SwDoc * pDoc;
-// SwUndoId nId;
public:
SwUndoRenameFmt(SwUndoId nUndoId, const String & sOldName,
@@ -251,3 +251,5 @@ class SwUndoNumruleRename : public SwUndo
};
#endif // SW_UNDO_TXT_FMT_COLL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwUndoPageDesc.hxx b/sw/source/core/inc/SwUndoPageDesc.hxx
index 1de717a453d6..7acb98053e52 100644
--- a/sw/source/core/inc/SwUndoPageDesc.hxx
+++ b/sw/source/core/inc/SwUndoPageDesc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,14 +57,14 @@ public:
class SwUndoPageDescCreate : public SwUndo
{
- const SwPageDesc * pDesc; // #116530#
+ const SwPageDesc * pDesc;
SwPageDescExt aNew;
SwDoc * pDoc;
void DoImpl();
public:
- SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc); // #116530#
+ SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc);
virtual ~SwUndoPageDescCreate();
virtual void UndoImpl( ::sw::UndoRedoContext & );
@@ -91,3 +92,5 @@ public:
virtual SwRewriter GetRewriter() const;
};
#endif // _SW_UNDO_PAGE_DESC_CHANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwUndoTOXChange.hxx b/sw/source/core/inc/SwUndoTOXChange.hxx
index 5fa221b23979..a661ab5de571 100644
--- a/sw/source/core/inc/SwUndoTOXChange.hxx
+++ b/sw/source/core/inc/SwUndoTOXChange.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@ public:
};
#endif // SW_UNDO_TOX_CHANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXMLBlockExport.hxx b/sw/source/core/inc/SwXMLBlockExport.hxx
index 59ca2b59540e..8d02e47a4e8f 100644
--- a/sw/source/core/inc/SwXMLBlockExport.hxx
+++ b/sw/source/core/inc/SwXMLBlockExport.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ public:
void _ExportContent() {}
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXMLBlockImport.hxx b/sw/source/core/inc/SwXMLBlockImport.hxx
index a9aa3bb32b08..4d37e9b417ee 100644
--- a/sw/source/core/inc/SwXMLBlockImport.hxx
+++ b/sw/source/core/inc/SwXMLBlockImport.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,5 @@ public:
throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXMLBlockListContext.hxx b/sw/source/core/inc/SwXMLBlockListContext.hxx
index 8208d78db2d6..64c9dbb8c0e9 100644
--- a/sw/source/core/inc/SwXMLBlockListContext.hxx
+++ b/sw/source/core/inc/SwXMLBlockListContext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -124,3 +125,5 @@ public:
~SwXMLTextBlockParContext ( void );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx
index 8e487a21fc85..c87b08d77360 100644
--- a/sw/source/core/inc/SwXMLTextBlocks.hxx
+++ b/sw/source/core/inc/SwXMLTextBlocks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXTextDefaults.hxx b/sw/source/core/inc/SwXTextDefaults.hxx
index f1ed6bbf1371..931ed54006bf 100644
--- a/sw/source/core/inc/SwXTextDefaults.hxx
+++ b/sw/source/core/inc/SwXTextDefaults.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
-#ifndef _COM_SUN_STAR_BEANS_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
#include <svl/itemprop.hxx>
class SwDoc;
@@ -82,3 +81,5 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx
index 8680dcaa3e59..3d92ff7ce1c7 100644
--- a/sw/source/core/inc/UndoNumbering.hxx
+++ b/sw/source/core/inc/UndoNumbering.hxx
@@ -28,17 +28,9 @@
#ifndef SW_UNDO_NUMBERING_HXX
#define SW_UNDO_NUMBERING_HXX
+#include <vector>
#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 <boost/shared_ptr.hpp>
#include <numrule.hxx>
@@ -78,9 +70,13 @@ public:
class SwUndoDelNum : public SwUndo, private SwUndRng
{
- SvULongs aNodeIdx;
- SvBytes aLevels;
- SvBools aRstLRSpaces;
+ struct NodeLevel
+ {
+ sal_uLong index;
+ int level;
+ inline NodeLevel(sal_uLong idx, int lvl) : index(idx), level(lvl) {};
+ };
+ std::vector<NodeLevel> aNodes;
SwHistory* pHistory;
public:
SwUndoDelNum( const SwPaM& rPam );
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 40032e9dfa86..d7705a398ee2 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -39,10 +39,10 @@
#include <svl/svstdarr.hxx>
#endif
+#include <vector>
#include <swtypes.hxx>
#include <itabenum.hxx>
-
class SfxItemSet;
struct SwSaveRowSpan;
@@ -188,7 +188,7 @@ class SwUndoTblNdsChg : public SwUndo
SvULongs* pNewSttNds;
SwUndoSaveSections* pDelSects;
} Ptrs;
- SvBools aMvBoxes; // for SplitRow (split Nodes of Box)
+ std::vector<bool> 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;
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index d52d3a70f4b5..38975d37969f 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,3 +121,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
index 178a07c7bec7..88affdb989b2 100644
--- a/sw/source/core/inc/anchoredobjectposition.hxx
+++ b/sw/source/core/inc/anchoredobjectposition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#define _ANCHOREDOBJECTPOSITION_HXX
#include <swtypes.hxx>
-// OD 2004-03-16 #i11860#
+// #i11860#
#include <frame.hxx>
class SdrObject;
@@ -40,7 +41,7 @@ class SwRect;
class SvxLRSpaceItem;
class SvxULSpaceItem;
class SwFmtHoriOrient;
-// OD 2004-03-23 #i26701#
+// #i26701#
class SwAnchoredObject;
namespace objectpositioning
@@ -56,7 +57,7 @@ namespace objectpositioning
// information about object
// does the object represents a Writer fly frame
bool mbIsObjFly;
- // OD 2004-03-23 #i26791# - anchored object the object belongs to;
+ // #i26791# - anchored object the object belongs to;
SwAnchoredObject* mpAnchoredObj;
// frame the object is anchored at
SwFrm* mpAnchorFrm;
@@ -64,25 +65,20 @@ namespace objectpositioning
SwContact* mpContact;
// frame format
const SwFrmFmt* mpFrmFmt;
- // --> OD 2006-03-15 #i62875#
+ // #i62875#
bool mbFollowTextFlow;
- // <--
- // --> OD 2006-03-15 #i62875#
+ // #i62875#
// for compatibility option <DoNotCaptureDrawObjsOnPage>
bool mbDoNotCaptureAnchoredObj;
- // <--
/** determine information about object
- OD 30.07.2003 #110978#
member <mbIsObjFly>, <mpAnchoredObj>, <mpAnchorFrm>, <mpContact>
and <mpFrmFmt> are set
-
- @author OD
*/
void _GetInfoAboutObj();
- // --> OD 2006-03-15 #i62875#
+ // #i62875#
// --> OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
SwTwips _ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
const bool bVert,
@@ -93,7 +89,6 @@ namespace objectpositioning
const bool bCheckBottom = true ) const;
SwTwips _ImplAdjustHoriRelPos( const SwFrm& _rPageAlignLayFrm,
const SwTwips _nProposedRelPosX ) const;
- // <--
protected:
SwAnchoredObjectPosition( SdrObject& _rDrawObj );
@@ -124,27 +119,24 @@ namespace objectpositioning
{
return *mpFrmFmt;
}
- // --> OD 2006-03-15 #i62875#
+ // #i62875#
inline bool DoesObjFollowsTextFlow() const
{
return mbFollowTextFlow;
}
- // <--
// virtual methods providing data for to character anchored objects.
virtual bool IsAnchoredToChar() const;
virtual const SwFrm* ToCharOrientFrm() const;
virtual const SwRect* ToCharRect() const;
- // OD 12.11.2003 #i22341#
+ // #i22341#
virtual SwTwips ToCharTopOfLine() const;
// *********************************************************************
/** helper method to determine top of a frame for the vertical
object positioning
- OD 2004-03-11 #i11860#
-
- @author OD
+ #i11860#
*/
SwTwips _GetTopForObjPos( const SwFrm& _rFrm,
const SwRectFn& _fnRect,
@@ -158,7 +150,7 @@ namespace objectpositioning
SwTwips& _orAlignAreaOffset ) const;
// *********************************************************************
- // --> OD 2004-06-17 #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos>
+ // #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos>
SwTwips _GetVertRelPos( const SwFrm& _rVertOrientFrm,
const SwFrm& _rPageAlignLayFrm,
const sal_Int16 _eVertOrient,
@@ -172,9 +164,9 @@ namespace objectpositioning
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
- OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
+ #i31805# - add parameter <_bCheckBottom>
+ #i26945# - add parameter <_bFollowTextFlow>
+ #i62875# - made inline, intrinsic actions moved
to private method <_ImplAdjustVertRelPos>, which is only
called, if <mbDoNotCaptureAnchoredObj> not set.
OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
@@ -207,8 +199,6 @@ namespace objectpositioning
input parameter - boolean indicating, if bottom of anchored
object has to be checked and thus, (if needed) the proposed
relative position has to be adjusted. default value <true>
-
- @author OD
*/
inline SwTwips _AdjustVertRelPos( const SwTwips nTopOfAnch,
const bool bVert,
@@ -230,11 +220,9 @@ namespace objectpositioning
// *********************************************************************
/** calculate relative horizontal position
- --> OD 2004-06-17 #i26791# - add output parameter
+ #i26791# - add output parameter
<_roHoriOffsetToFrmAnchorPos>
- @author OD
-
@param _rHoriOrientFrm
input parameter - frame the horizontal position of the object
is oriented at.
@@ -280,12 +268,10 @@ namespace objectpositioning
/** adjust calculated horizontal in order to keep object inside
'page' alignment layout frame for object type position TO_CNTNT
- OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
+ #i62875# - made inline, intrinsic actions moved
to private method <_ImplAdjustHoriRelPos>, which is only
called, if <mbDoNotCaptureAnchoredObj> not set.
- @author OD
-
@param _rPageAlignLayFrm
input paramter - layout frame, which determines the 'page area'
the object has to be horizontal positioned in.
@@ -307,8 +293,6 @@ namespace objectpositioning
// *********************************************************************
/** toggle given horizontal orientation and relative alignment
- @author OD
-
@param _bToggleLeftRight
input parameter - boolean indicating, if horizontal orientation
and relative alignment has to be toggled.
@@ -329,8 +313,6 @@ namespace objectpositioning
// *********************************************************************
/** determine alignment values for horizontal position of object
- @author OD
-
@param _rHoriOrientFrm
input parameter - frame the horizontal position of the object
is oriented at.
@@ -378,8 +360,6 @@ namespace objectpositioning
/** adjust calculated horizontal position in order to draw object
aside other objects with same positioning
- @author OD
-
@param _rHoriOrientFrm
input parameter - frame the horizontal position of the object
is oriented at.
@@ -423,8 +403,6 @@ namespace objectpositioning
method used by <_AdjustHoriRelPosForDrawAside(..)>
- @author OD
-
@param _pFly
input parameter - fly frame the draw aside check is done for.
@@ -468,8 +446,6 @@ namespace objectpositioning
positioning.
method used by <_DrawAsideFly(..)>
- @author OD
-
@param _eRelOrient1
input parameter - alignment 1
@@ -494,3 +470,5 @@ namespace objectpositioning
} // namespace objectpositioning
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ascharanchoredobjectposition.hxx b/sw/source/core/inc/ascharanchoredobjectposition.hxx
index 2f5e2d1bb164..f83cdf6259c7 100644
--- a/sw/source/core/inc/ascharanchoredobjectposition.hxx
+++ b/sw/source/core/inc/ascharanchoredobjectposition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -169,3 +170,5 @@ namespace objectpositioning
} // namespace objectpositioning
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/blink.hxx b/sw/source/core/inc/blink.hxx
index 11f11d6d188a..1a4b0a9252c0 100644
--- a/sw/source/core/inc/blink.hxx
+++ b/sw/source/core/inc/blink.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ extern SwBlink *pBlink;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 9bd12a45205f..5d8a7f30f43b 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,7 +44,11 @@ protected:
public:
SwBodyFrm( SwFrmFmt* );
+ virtual void Paint( const SwRect&, const SwPrintData *pPrintData = NULL ) const;
+
DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
};
#endif //_BODYFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 90c6a44fa239..b495e987d404 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,7 @@
#include <boost/scoped_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <map>
+#include <rtl/ustring.hxx>
#include <IMark.hxx>
@@ -255,7 +257,11 @@ namespace sw { namespace mark
virtual void InitDoc(SwDoc* const io_pDoc);
bool IsChecked() const;
void SetChecked(bool checked);
+
+ virtual rtl::OUString toString( ) const;
};
}}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 1a5b24b58fa1..b50a1a7e3612 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,3 +71,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 431f93912140..3a21ef14e0bc 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -145,3 +146,5 @@ inline SwCntntFrm *SwCntntFrm::GetFollow()
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/colfrm.hxx b/sw/source/core/inc/colfrm.hxx
index 4d8a54528aa5..011daf07fa74 100644
--- a/sw/source/core/inc/colfrm.hxx
+++ b/sw/source/core/inc/colfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,3 +41,5 @@ public:
};
#endif //_COLFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx
index 27f920be7651..ef5f8933a81a 100644
--- a/sw/source/core/inc/crossrefbookmark.hxx
+++ b/sw/source/core/inc/crossrefbookmark.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,3 +98,5 @@ namespace sw { namespace mark
}}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/dbg_lay.hxx b/sw/source/core/inc/dbg_lay.hxx
index 3885d9d7dda5..d290e9c8c178 100644
--- a/sw/source/core/inc/dbg_lay.hxx
+++ b/sw/source/core/inc/dbg_lay.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@
#define SNAP_FLYFRAMES 0x00000002
#define SNAP_TABLECONT 0x00000004
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include "swtypes.hxx"
@@ -118,3 +119,5 @@ public:
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 23216709a50a..9e3cf0dff55e 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -127,7 +128,7 @@ public:
void SetRect() const;
// ist eine URL an einer Grafik gesetzt, dann ist das ein Makro-Object
- virtual FASTBOOL HasMacro() const;
+ virtual bool HasMacro() const;
virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
@@ -138,3 +139,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx
index dbce10e51db0..26d19dc4d859 100644
--- a/sw/source/core/inc/docfld.hxx
+++ b/sw/source/core/inc/docfld.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -191,3 +192,4 @@ public:
#endif // _DOCFLD_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx
index 5d87e37e9219..aa2d096f3cb8 100644
--- a/sw/source/core/inc/docsort.hxx
+++ b/sw/source/core/inc/docsort.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,6 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#ifndef _SORT_HXX
#define _SORT_HXX
@@ -174,3 +176,5 @@ private:
inline sal_Bool FlatFndBox::HasItemSets() const { return 0 != ppItemSets; }
#endif // _NDSORT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index 5e3adfb1fd3d..842b6a319726 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,9 +110,7 @@ public:
sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const;
};
-/* -----------------02.09.99 07:52-------------------
- --------------------------------------------------*/
struct SwDefTOXBase_Impl
{
SwTOXBase* pContBase;
@@ -145,3 +144,5 @@ struct SwDefTOXBase_Impl
};
#endif // _DOCTXM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/drawdev.hxx b/sw/source/core/inc/drawdev.hxx
index 7b851403355b..31d630a741e4 100644
--- a/sw/source/core/inc/drawdev.hxx
+++ b/sw/source/core/inc/drawdev.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include "swrect.hxx"
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
/*************************************************************************
* class SwDrawDev
@@ -138,3 +137,5 @@ inline void SwDrawDev::DrawRect( const SwRect& rRect,
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index ba16257d3189..aad3c9f00787 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include <tools/solar.h>
#include <tools/string.hxx>
-#include <errhdl.hxx>
class SwTxtFrm;
class OutputDevice;
@@ -94,7 +94,7 @@ class SwDrawTextInfo
SwDrawTextInfo(); // nicht zulaessig
public:
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 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
@@ -157,7 +157,7 @@ public:
bUpper = sal_False;
bDrawSpace = sal_False;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// 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:
@@ -198,13 +198,17 @@ public:
const Point &GetPos() const
{
- ASSERT( bPos, "DrawTextInfo: Undefined Position" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bPos, "DrawTextInfo: Undefined Position" );
+#endif
return *pPos;
}
xub_StrLen *GetHyphPos() const
{
- ASSERT( bHyph, "DrawTextInfo: Undefined Hyph Position" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bHyph, "DrawTextInfo: Undefined Hyph Position" );
+#endif
return pHyphPos;
}
@@ -215,13 +219,17 @@ public:
const SwWrongList* GetWrong() const
{
- ASSERT( bWrong, "DrawTextInfo: Undefined WrongList" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bWrong, "DrawTextInfo: Undefined WrongList" );
+#endif
return pWrong;
}
const SwWrongList* GetGrammarCheck() const
{
- ASSERT( bGrammarCheck, "DrawTextInfo: Undefined GrammarCheck List" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bGrammarCheck, "DrawTextInfo: Undefined GrammarCheck List" );
+#endif
return pGrammarCheck;
}
@@ -232,13 +240,17 @@ public:
const Size &GetSize() const
{
- ASSERT( bSize, "DrawTextInfo: Undefined Size" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bSize, "DrawTextInfo: Undefined Size" );
+#endif
return *pSize;
}
SwFont* GetFont() const
{
- ASSERT( bFnt, "DrawTextInfo: Undefined Font" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bFnt, "DrawTextInfo: Undefined Font" );
+#endif
return pFnt;
}
@@ -259,7 +271,9 @@ public:
xub_StrLen GetOfst() const
{
- ASSERT( bOfst, "DrawTextInfo: Undefined Offset" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bOfst, "DrawTextInfo: Undefined Offset" );
+#endif
return nOfst;
}
@@ -270,19 +284,25 @@ public:
long GetLeft() const
{
- ASSERT( bLeft, "DrawTextInfo: Undefined left range" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bLeft, "DrawTextInfo: Undefined left range" );
+#endif
return nLeft;
}
long GetRight() const
{
- ASSERT( bRight, "DrawTextInfo: Undefined right range" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bRight, "DrawTextInfo: Undefined right range" );
+#endif
return nRight;
}
long GetKanaDiff() const
{
- ASSERT( bKana, "DrawTextInfo: Undefined kana difference" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bKana, "DrawTextInfo: Undefined kana difference" );
+#endif
return nKanaDiff;
}
@@ -293,7 +313,9 @@ public:
sal_uInt16 GetAscent() const
{
- ASSERT( bAscent, "DrawTextInfo: Undefined Ascent" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bAscent, "DrawTextInfo: Undefined Ascent" );
+#endif
return nAscent;
}
@@ -304,7 +326,9 @@ public:
long GetSperren() const
{
- ASSERT( bSperr, "DrawTextInfo: Undefined >Sperren<" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bSperr, "DrawTextInfo: Undefined >Sperren<" );
+#endif
return nSperren;
}
@@ -315,13 +339,17 @@ public:
long GetSpace() const
{
- ASSERT( bSpace, "DrawTextInfo: Undefined Spacing" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bSpace, "DrawTextInfo: Undefined Spacing" );
+#endif
return nSpace;
}
xub_StrLen GetNumberOfBlanks() const
{
- ASSERT( bNumberOfBlanks, "DrawTextInfo::Undefined NumberOfBlanks" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bNumberOfBlanks, "DrawTextInfo::Undefined NumberOfBlanks" );
+#endif
return nNumberOfBlanks;
}
@@ -337,13 +365,17 @@ public:
sal_Bool GetUpper() const
{
- ASSERT( bUppr, "DrawTextInfo: Undefined Upperflag" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bUppr, "DrawTextInfo: Undefined Upperflag" );
+#endif
return bUpper;
}
sal_Bool GetDrawSpace() const
{
- ASSERT( bDrawSp, "DrawTextInfo: Undefined DrawSpaceflag" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bDrawSp, "DrawTextInfo: Undefined DrawSpaceflag" );
+#endif
return bDrawSpace;
}
@@ -380,7 +412,7 @@ public:
void SetPos( const Point &rNew )
{
pPos = &rNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bPos = sal_True;
#endif
}
@@ -388,7 +420,7 @@ public:
void SetHyphPos( xub_StrLen *pNew )
{
pHyphPos = pNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bHyph = sal_True;
#endif
}
@@ -401,7 +433,7 @@ public:
void SetWrong( const SwWrongList* pNew )
{
pWrong = pNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bWrong = sal_True;
#endif
}
@@ -409,7 +441,7 @@ public:
void SetGrammarCheck( const SwWrongList* pNew )
{
pGrammarCheck = pNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bGrammarCheck = sal_True;
#endif
}
@@ -422,7 +454,7 @@ public:
void SetSize( const Size &rNew )
{
pSize = &rNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bSize = sal_True;
#endif
}
@@ -430,7 +462,7 @@ public:
void SetFont( SwFont* pNew )
{
pFnt = pNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bFnt = sal_True;
#endif
}
@@ -448,7 +480,7 @@ public:
void SetOfst( xub_StrLen nNew )
{
nOfst = nNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bOfst = sal_True;
#endif
}
@@ -456,7 +488,7 @@ public:
void SetLeft( long nNew )
{
nLeft = nNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bLeft = sal_True;
#endif
}
@@ -464,7 +496,7 @@ public:
void SetRight( long nNew )
{
nRight = nNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bRight = sal_True;
#endif
}
@@ -472,7 +504,7 @@ public:
void SetKanaDiff( long nNew )
{
nKanaDiff = nNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bKana = sal_True;
#endif
}
@@ -485,7 +517,7 @@ public:
void SetAscent( sal_uInt16 nNew )
{
nAscent = nNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bAscent = sal_True;
#endif
}
@@ -507,7 +539,7 @@ public:
nSpace = nNew;
nSperren = 0;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bSpace = sal_True;
bSperr = sal_True;
#endif
@@ -515,7 +547,7 @@ public:
void SetNumberOfBlanks( xub_StrLen nNew )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bNumberOfBlanks = sal_True;
#endif
nNumberOfBlanks = nNew;
@@ -544,7 +576,7 @@ public:
void SetUpper( sal_Bool bNew )
{
bUpper = bNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bUppr = sal_True;
#endif
}
@@ -552,7 +584,7 @@ public:
void SetDrawSpace( sal_Bool bNew )
{
bDrawSpace = bNew;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bDrawSp = sal_True;
#endif
}
@@ -592,3 +624,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index 60021d8fef84..b51f555ea384 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,3 +133,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/environmentofanchoredobject.hxx b/sw/source/core/inc/environmentofanchoredobject.hxx
index 00a1d509ece4..0700256555f2 100644
--- a/sw/source/core/inc/environmentofanchoredobject.hxx
+++ b/sw/source/core/inc/environmentofanchoredobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,10 +41,6 @@ namespace objectpositioning
public:
/** construtor
- OD 05.11.2003
-
- @author OD
-
@param _bFollowTextFlow
input parameter - indicates, if the anchored object, for which
this environment is instantiated, follow the text flow or not
@@ -51,17 +48,12 @@ namespace objectpositioning
SwEnvironmentOfAnchoredObject( const bool _bFollowTextFlow );
/** destructor
-
- OD 05.11.2003
-
- @author OD
*/
~SwEnvironmentOfAnchoredObject();
/** determine environment layout frame for possible horizontal object
positions respectively for alignment to 'page areas'
- OD 05.11.2003
this is, if object has to follow the text flow:
- cell frame, if anchored inside a cell
- fly frame, if anchored inside a fly frame
@@ -69,11 +61,9 @@ namespace objectpositioning
this is, if object hasn't to follow the text flow:
- page frame.
- OD 2005-01-20 #118546# - no exception any more. Thus remove
+ - no exception any more. Thus remove
parameter <_bForPageAlignment>
- @author OD
-
@param _rHoriOrientFrm
input parameter - frame, at which the horizontal position is
oriented at (typically it's the anchor frame).
@@ -87,7 +77,6 @@ namespace objectpositioning
/** determine environment layout frame for possible vertical object
positions respectively for alignments to 'page areas'
- OD 05.11.2003
this is, if object has to follow the text flow:
- cell frame, if anchored inside a cell
- fly frame, if anchored inside a fly frame
@@ -97,11 +86,9 @@ namespace objectpositioning
this is, if object hasn't to follow the text flow:
- page frame.
- OD 2005-01-20 #118546# - no exception any more. Thus remove
+ - no exception any more. Thus remove
parameter <_bForPageAlignment>
- @author OD
-
@param _rVertOrientFrm
input parameter - frame, at which the vertical position is
oriented at (typically it's the anchor frame).
@@ -115,3 +102,5 @@ namespace objectpositioning
} // namespace objectpositioning
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/finalthreadmanager.hxx b/sw/source/core/inc/finalthreadmanager.hxx
index 4d60514506c8..19e902c53a37 100644
--- a/sw/source/core/inc/finalthreadmanager.hxx
+++ b/sw/source/core/inc/finalthreadmanager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -103,3 +104,5 @@ private:
bool mbRegisteredAtDesktop;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index d1290c66e989..1403718101d8 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,16 +48,13 @@
//diesem befreundet. So kann der FlowFrm anstelle des this-Pointer mit der
//Referenz auf den SwFrm arbeiten.
-//#include "frame.hxx" //fuer inlines
-
class SwPageFrm;
class SwRect;
class SwBorderAttrs;
class SwDoc;
class SwNodeIndex;
-// --> OD 2005-03-04 #i44049#
+// #i44049#
class SwObjectFormatterTxtFrm;
-// <--
void MakeFrms( SwDoc *, const SwNodeIndex &, const SwNodeIndex & );
@@ -67,9 +65,8 @@ class SwFlowFrm
friend inline void PrepareUnlock( SwFlowFrm * );
friend inline void TableSplitRecalcLock( SwFlowFrm * );
friend inline void TableSplitRecalcUnlock( SwFlowFrm * );
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
friend class SwObjectFormatterTxtFrm;
- // <--
//TblSel darf das Follow-Bit zuruecksetzen.
friend inline void UnsetFollow( SwFlowFrm *pFlow );
@@ -92,31 +89,25 @@ class SwFlowFrm
/** helper method to determine previous frame for calculation of the
upper space
- OD 2004-03-10 #i11860#
+ #i11860#
@param _pProposedPrevFrm
optional input parameter - pointer to frame, which should be used
instead of the direct previous frame.
-
- @author OD
*/
const SwFrm* _GetPrevFrmForUpperSpaceCalc( const SwFrm* _pProposedPrevFrm = 0L ) const;
/** method to detemine the upper space amount, which is considered for
the previous frame
- OD 2004-03-11 #i11860#
-
- @author OD
+ #i11860#
*/
SwTwips _GetUpperSpaceAmountConsideredForPrevFrm() const;
/** method to detemine the upper space amount, which is considered for
the page grid
- OD 2004-03-12 #i11860#
-
- @author OD
+ #i11860#
*/
SwTwips _GetUpperSpaceAmountConsideredForPageGrid(
const SwTwips _nUpperSpaceWithoutGrid ) const;
@@ -137,9 +128,8 @@ protected:
//Prueft ob Vorwaertsfluss noch Sinn macht Endloswanderschaften (unterbinden)
inline sal_Bool IsFwdMoveAllowed();
- // --> OD 2005-03-08 #i44049# - method <CalcCntnt(..)> has to check this property.
+ // #i44049# - method <CalcCntnt(..)> has to check this property.
friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
- // <--
sal_Bool IsKeepFwdMoveAllowed(); //Wie oben, Move fuer Keep.
//Prueft ob ein Obj das Umlauf wuenscht ueberlappt.
@@ -202,11 +192,9 @@ public:
/** method to determine the upper space hold by the frame
- OD 2004-03-12 #i11860# - add 3rd parameter <_bConsiderGrid> to get
+ #i11860# - add 3rd parameter <_bConsiderGrid> to get
the upper space with and without considering the page grid
(default value: <sal_True>)
-
- @author ?
*/
SwTwips CalcUpperSpace( const SwBorderAttrs *pAttrs = NULL,
const SwFrm* pPr = NULL,
@@ -216,26 +204,18 @@ public:
the previous frame and the page grid, if option 'Use former object
positioning' is OFF
- OD 2004-03-18 #i11860#
-
- @author OD
+ #i11860#
*/
SwTwips GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() const;
/** calculation of lower space
-
- OD 2004-03-02 #106629#
-
- @author OD
*/
SwTwips CalcLowerSpace( const SwBorderAttrs* _pAttrs = 0L ) const;
/** calculation of the additional space to be considered, if flow frame
is the last inside a table cell
- OD 2004-07-16 #i26250
-
- @author OD
+ #i26250
@param _pAttrs
optional input parameter - border attributes of the flow frame.
@@ -271,3 +251,5 @@ inline sal_Bool SwFlowFrm::IsFwdMoveAllowed()
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index d171bd0b0a26..7b1adc88c661 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ class SwSpzFrmFmts;
class SwAttrSetChg;
class PolyPolygon;
-// OD 2004-03-22 #i26791#
+// #i26791#
#include <anchoredobject.hxx>
//Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen.
@@ -53,7 +54,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
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>
+// #i26791# - inherit also from <SwAnchoredFlyFrm>
class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
{
//darf Locken. Definiert in frmtool.cxx
@@ -75,7 +76,7 @@ protected:
SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
*pNextLink; // Textfluss
- // OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
+ // #i26791# - moved to <SwAnchoredObject>
// Point aRelPos; //Die Relative Position zum Master
private:
@@ -116,8 +117,6 @@ protected:
// invisible layer.
friend class SwNoTxtFrm; // Darf NotifyBackground rufen
-// virtual void NotifyBackground( SwPageFrm *pPage,
-// const SwRect& rRect, PrepareHint eHint) = 0;
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
void MakePrtArea( const SwBorderAttrs &rAttrs );
@@ -136,22 +135,19 @@ protected:
/** method to assure that anchored object is registered at the correct
page frame
- OD 2004-07-02 #i28701#
-
- @author OD
+ #i28701#
*/
virtual void RegisterAtCorrectPage();
- // --> OD 2006-08-10 #i68520#
+ // #i68520#
virtual bool _SetObjTop( const SwTwips _nTop );
virtual bool _SetObjLeft( const SwTwips _nLeft );
- // <--
- // --> OD 2006-10-05 #i70122#
+ // #i70122#
virtual const SwRect GetObjBoundRect() const;
- // <--
+
public:
- // OD 2004-03-23 #i26791#
+ // #i26791#
TYPEINFO();
virtual ~SwFlyFrm();
@@ -166,7 +162,7 @@ public:
virtual void CheckDirection( sal_Bool bVert );
virtual void Cut();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
#endif
@@ -184,7 +180,7 @@ public:
SwFlyFrm *FindChainNeighbour( SwFrmFmt &rFmt, SwFrm *pAnch = 0 );
- // OD 2004-03-24 #i26791#
+ // #i26791#
const SwVirtFlyDrawObj* GetVirtDrawObj() const;
SwVirtFlyDrawObj *GetVirtDrawObj();
void NotifyDrawObj();
@@ -223,7 +219,7 @@ public:
SwFrm *FindLastLower();
- // OD 16.04.2003 #i13147# - add parameter <_bForPaint> to avoid load of
+ // #i13147# - add parameter <_bForPaint> to avoid load of
// the graphic during paint. Default value: sal_False
sal_Bool GetContour( PolyPolygon& rContour,
const sal_Bool _bForPaint = sal_False ) const;
@@ -232,40 +228,32 @@ public:
//Auf dieser Shell painten (PreView, Print-Flag usw. rekursiv beachten)?.
static sal_Bool IsPaint( SdrObject *pObj, const ViewShell *pSh );
- /** SwFlyFrm::IsBackgroundTransparent - for feature #99657#
+ /** SwFlyFrm::IsBackgroundTransparent
- OD 12.08.2002
determines, if background of fly frame has to be drawn transparent
definition found in /core/layout/paintfrm.cxx
- @author OD
-
@return true, if background color is transparent or a existing background
graphic is transparent.
*/
sal_Bool IsBackgroundTransparent() const;
- /** SwFlyFrm::IsShadowTransparent - for feature #99657#
+ /** SwFlyFrm::IsShadowTransparent
- OD 05.08.2002
determine, if shadow color of fly frame has to be drawn transparent
definition found in /core/layout/paintfrm.cxx
- @author OD
-
@return true, if shadow color is transparent.
*/
sal_Bool IsShadowTransparent() const;
- // OD 2004-01-19 #110582#
void Chain( SwFrm* _pAnchor );
void Unchain();
void InsertCnt();
void DeleteCnt();
- // OD 2004-02-12 #110582#-2
void InsertColumns();
- // OD 2004-03-23 #i26791# - pure virtual methods of base class <SwAnchoredObject>
+ // #i26791# - pure virtual methods of base class <SwAnchoredObject>
virtual void MakeObjPos();
virtual void InvalidateObjPos();
@@ -276,12 +264,10 @@ public:
/** method to determine, if a format on the Writer fly frame is possible
- OD 2004-05-11 #i28701#
+ #i28701#
refine 'IsFormatPossible'-conditions of method
<SwAnchoredObject::IsFormatPossible()> by:
format isn't possible, if Writer fly frame is locked resp. col-locked.
-
- @author OD
*/
virtual bool IsFormatPossible() const;
@@ -292,3 +278,5 @@ public:
virtual SwFlyFrmFmt *GetFmt();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 079272eb6db1..cf46533c98e7 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,7 @@
#ifndef _FLYFRMS_HXX
#define _FLYFRMS_HXX
#include "flyfrm.hxx"
-// --> OD 2004-06-23 #i28701#
+// --> #i28701#
class SwFlyAtCntFrm;
//Basisklasse fuer diejenigen Flys, die sich relativ frei Bewegen koennen -
@@ -36,12 +37,12 @@ class SwFlyFreeFrm : public SwFlyFrm
{
SwPageFrm *pPage; //Bei dieser Seite ist der Fly angemeldet.
- // --> OD 2004-11-15 #i34753# - flag for at-page anchored Writer fly frames
+ // --> #i34753# - flag for at-page anchored Writer fly frames
// to prevent a positioning - call of method <MakeObjPos()> -, if Writer
// fly frame is already clipped during its format by the object formatter.
bool mbNoMakePos;
// <--
- // --> OD 2004-11-12 #i37068# - flag to prevent move in method
+ // --> #i37068# - flag to prevent move in method
// <CheckClip(..)>
bool mbNoMoveOnCheckClip;
// <--
@@ -49,7 +50,7 @@ class SwFlyFreeFrm : public SwFlyFrm
/** determines, if direct environment of fly frame has 'auto' size
- OD 07.08.2003 #i17297#, #111066#, #111070#
+ #i17297#
start with anchor frame and search for a header, footer, row or fly frame
stopping at page frame.
return <true>, if such a frame is found and it has 'auto' size.
@@ -62,7 +63,7 @@ class SwFlyFreeFrm : public SwFlyFrm
bool HasEnvironmentAutoSize() const;
protected:
- // OD 2004-05-12 #i28701# - new friend class <SwFlyNotify> for access to
+ // #i28701# - new friend class <SwFlyNotify> for access to
// method <NotifyBackground>
friend class SwFlyNotify;
virtual void NotifyBackground( SwPageFrm *pPage,
@@ -71,14 +72,14 @@ protected:
SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
public:
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
TYPEINFO();
virtual ~SwFlyFreeFrm();
virtual void MakeAll();
- // --> OD 2004-11-12 #i37068# - accessors for member <mbNoMoveOnCheckClip>
+ // --> #i37068# - accessors for member <mbNoMoveOnCheckClip>
inline void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
{
mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
@@ -88,7 +89,7 @@ public:
return mbNoMoveOnCheckClip;
}
// <--
- // --> OD 2004-11-15 #i34753# - accessors for member <mbNoMakePos>
+ // --> #i34753# - accessors for member <mbNoMakePos>
inline void SetNoMakePos( const bool _bNoMakePos )
{
if ( IsFlyLayFrm() )
@@ -111,7 +112,7 @@ public:
/** method to determine, if a format on the Writer fly frame is possible
- OD 2004-05-11 #i28701#
+ #i28701#
refine 'IsFormatPossible'-conditions of method
<SwFlyFrm::IsFormatPossible()> by:
format isn't possible, if Writer fly frame isn't registered at a page frame
@@ -127,7 +128,7 @@ public:
class SwFlyLayFrm : public SwFlyFreeFrm
{
public:
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
TYPEINFO();
SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
@@ -143,20 +144,20 @@ class SwFlyAtCntFrm : public SwFlyFreeFrm
protected:
virtual void MakeAll();
- // OD 2004-05-12 #i28701#
+ // #i28701#
virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
/** method to assure that anchored object is registered at the correct
page frame
- OD 2004-07-02 #i28701#
+ #i28701#
@author OD
*/
virtual void RegisterAtCorrectPage();
public:
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
TYPEINFO();
SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
@@ -165,12 +166,12 @@ public:
void SetAbsPos( const Point &rNew );
- // OD 2004-03-23 #i26791#
+ // #i26791#
virtual void MakeObjPos();
/** method to determine, if a format on the Writer fly frame is possible
- OD 2004-05-11 #i28701#
+ #i28701#
refine 'IsFormatPossible'-conditions of method
<SwFlyFreeFrm::IsFormatPossible()> by:
format isn't possible, if method <MakeAll()> is already in progress.
@@ -195,7 +196,7 @@ protected:
virtual void MakeAll();
public:
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
TYPEINFO();
SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
@@ -229,10 +230,10 @@ public:
//siehe layact.cxx
void AddRefOfst( long nOfst ) { aRef.Y() += nOfst; }
- // OD 2004-03-23 #i26791#
+ // #i26791#
virtual void MakeObjPos();
- // --> OD 2004-12-02 #115759# - invalidate anchor frame on invalidation
+ // --> #115759# - invalidate anchor frame on invalidation
// of the position, because the position is calculated during the
// format of the anchor frame
virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
@@ -257,3 +258,5 @@ inline void SwFlyInCntFrm::ValidateCntnt() const
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index c95fc3f0a8bc..39a739ab41e2 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ class SwFntCache : public SwCache
public:
inline SwFntCache() : SwCache(50,50
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, ByteString( RTL_CONSTASCII_STRINGPARAM(
"Globaler Font-Cache pFntCache" ))
#endif
@@ -158,3 +159,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 1b8762f71edd..ec1bc3870422 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,16 @@
#define SW_FRAME_HXX
#include <svl/svarray.hxx>
+#include <editeng/borderline.hxx>
#include "swtypes.hxx" // fuer SwTwips
#include "swrect.hxx"
#include "calbck.hxx" // fuer SwClient
+#if OSL_DEBUG_LEVEL > 1
+#include <libxml/encoding.h>
+#include <libxml/xmlwriter.h>
+#endif
+
class SwLayoutFrm;
class SwRootFrm;
class SwPageFrm;
@@ -556,7 +563,7 @@ public:
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;
+ const Color *pColor, const SvxBorderStyle = SOLID ) const;
//Retouche, nicht im Bereich des uebergebenen Rect!
void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
@@ -665,6 +672,7 @@ public:
SwRootFrm *FindRootFrm();
SwPageFrm *FindPageFrm();
SwFrm *FindColFrm();
+ SwRowFrm *FindRowFrm();
SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
SwTabFrm *ImplFindTabFrm();
SwFtnFrm *ImplFindFtnFrm();
@@ -952,6 +960,14 @@ public:
// FME 2007-08-30 #i81146# new loop control
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
+
+public:
+#if OSL_DEBUG_LEVEL > 1
+ virtual void dumpAsXml(xmlTextWriterPtr writer);
+ virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+ void dumpChildrenAsXml(xmlTextWriterPtr writer);
+#endif
+ bool IsCollapse() const;
};
inline sal_Bool SwFrm::IsInDocBody() const
@@ -1303,3 +1319,5 @@ inline sal_Bool SwFrm::IsAccessibleFrm() const
return GetType() & FRM_ACCESSIBLE ? sal_True : sal_False;
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/frminf.hxx b/sw/source/core/inc/frminf.hxx
index 347592a8c5f4..f05658c8ced7 100644
--- a/sw/source/core/inc/frminf.hxx
+++ b/sw/source/core/inc/frminf.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 473e30549c66..eb8e04eb196d 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,8 @@
#include "layfrm.hxx"
#include "frmatr.hxx"
#include "swcache.hxx"
-// --> OD 2008-12-04 #i96772#
+// #i96772#
#include <editeng/lrspitem.hxx>
-// <--
class SwPageFrm;
class SwFlyFrm;
@@ -57,24 +57,23 @@ struct SwFindRowSpanCacheObj;
#define WEIT_WECH LONG_MAX - 20000 //Initale Position der Flys.
#define BROWSE_HEIGHT 56700L * 10L //10 Meter
-//#define BROWSE_HEIGHT 1440L * 45L // 45 inch, maximum size for pdf files
#define GRFNUM_NO 0
#define GRFNUM_YES 1
#define GRFNUM_REPLACE 2
//Painten des Hintergrunds. Mit Brush oder Graphic.
-// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
+// - 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 sal_uInt8 nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
-// OD 24.01.2003 #106593# - method to align rectangle
+// - method to align rectangle
// Created declaration here to avoid <extern> declarations
void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
-// OD 24.01.2003 #106593# - method to align graphic rectangle
+// - method to align graphic rectangle
// Created declaration here to avoid <extern> declarations
void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
@@ -136,7 +135,7 @@ 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
+// wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
// gerufen
SwFrm* GetFrmOfModify( SwModify const&, sal_uInt16 const nFrmType, const Point* = 0,
const SwPosition *pPos = 0,
@@ -145,7 +144,7 @@ SwFrm* GetFrmOfModify( SwModify const&, sal_uInt16 const nFrmType, const Point*
//Sollen ExtraDaten (Reline-Strich, Zeilennummern) gepaintet werden?
sal_Bool IsExtraData( const SwDoc *pDoc );
-// OD 14.03.2003 #i11760# - method declaration <CalcCntnt(..)>
+// #i11760# - method declaration <CalcCntnt(..)>
void CalcCntnt( SwLayoutFrm *pLay,
bool bNoColl = false,
bool bNoCalcFollow = false );
@@ -166,9 +165,8 @@ protected:
sal_Bool bInvaKeep;
sal_Bool bValidSize;
protected:
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
bool mbFrmDeleted;
- // <--
public:
SwFrmNotify( SwFrm *pFrm );
@@ -177,12 +175,11 @@ public:
const SwRect &Frm() const { return aFrm; }
const SwRect &Prt() const { return aPrt; }
void SetInvaKeep() { bInvaKeep = sal_True; }
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
void FrmDeleted()
{
mbFrmDeleted = true;
}
- // <--
};
class SwLayNotify : public SwFrmNotify
@@ -213,11 +210,11 @@ public:
class SwCntntNotify : public SwFrmNotify
{
private:
- // OD 08.01.2004 #i11859#
+ // #i11859#
bool mbChkHeightOfLastLine;
SwTwips mnHeightOfLastLine;
- // OD 2004-02-26 #i25029#
+ // #i25029#
bool mbInvalidatePrevPrtArea;
bool mbBordersJoinedWithPrev;
@@ -227,7 +224,7 @@ public:
SwCntntNotify( SwCntntFrm *pCntFrm );
~SwCntntNotify();
- // OD 2004-02-26 #i25029#
+ // #i25029#
void SetInvalidatePrevPrtArea()
{
mbInvalidatePrevPrtArea = true;
@@ -246,15 +243,14 @@ public:
//!!!Achtung: Wenn weitere Attribute gecached werden muss unbedingt die
//Methode Modify::Modify mitgepflegt werden!!!
-// OD 23.01.2003 #106895# - delete old method <SwBorderAttrs::CalcRight()> and
+// - delete old method <SwBorderAttrs::CalcRight()> and
// the stuff that belongs to it.
class SwBorderAttrs : public SwCacheObj
{
const SwAttrSet &rAttrSet;
const SvxULSpaceItem &rUL;
- // --> OD 2008-12-04 #i96772#
+ // #i96772#
SvxLRSpaceItem rLR;
- // <--
const SvxBoxItem &rBox;
const SvxShadowItem &rShadow;
const Size aFrmSize; //Die FrmSize
@@ -277,12 +273,12 @@ class SwBorderAttrs : public SwCacheObj
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>
+ // - booleans indicating, if values <bJoinedWithPrev>
// and <bJoinedWithNext> are cached and valid.
// Caching depends on value of <bCacheGetLine>.
mutable sal_Bool bCachedJoinedWithPrev :1;
mutable sal_Bool bCachedJoinedWithNext :1;
- // OD 21.05.2003 #108789# - booleans indicating, if borders are joined
+ // - booleans indicating, if borders are joined
// with previous/next frame.
sal_Bool bJoinedWithPrev :1;
sal_Bool bJoinedWithNext :1;
@@ -309,29 +305,29 @@ class SwBorderAttrs : public SwCacheObj
void _IsLine();
- // OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
+ // #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
void _GetTopLine ( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm = 0L );
void _GetBottomLine( const SwFrm& _rFrm );
- // OD 21.05.2003 #108789# - private methods to calculate cached values
+ // - private methods to calculate cached values
// <bJoinedWithPrev> and <bJoinedWithNext>.
- // OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
+ // #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
void _CalcJoinedWithPrev( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm = 0L );
void _CalcJoinedWithNext( const SwFrm& _rFrm );
- // OD 21.05.2003 #108789# - internal helper method for methods
+ // - internal helper method for methods
// <_CalcJoinedWithPrev> and <_CalcJoinedWithNext>.
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".
+ // - change name of 1st parameter - "rAttrs" -> "rCmpAttrs".
sal_Bool CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
const SwFrm *pCaller,
const SwFrm *pCmp ) const;
@@ -364,16 +360,16 @@ public:
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>
+ // #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
inline sal_uInt16 GetTopLine ( const SwFrm& _rFrm,
const SwFrm* _pPrevFrm = 0L ) 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>
+ // - accessors for cached values <bJoinedWithPrev>
// and <bJoinedWithPrev>
- // OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
+ // #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
sal_Bool JoinedWithPrev( const SwFrm& _rFrm,
@@ -438,7 +434,7 @@ public:
//Sollen obere bzw. untere Umrandung fuer den Frm ausgewertet werden?
-// OD 2004-02-26 #i25029# - add optional 2nd parameter <_pPrevFrm>
+// #i25029# - add optional 2nd parameter <_pPrevFrm>
// If set, its value is taken for testing, if borders/shadow have to joined
// with previous frame.
inline sal_uInt16 SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
@@ -461,7 +457,7 @@ inline void SwBorderAttrs::SetGetCacheLine( sal_Bool bNew ) const
((SwBorderAttrs*)this)->bCacheGetLine = bNew;
((SwBorderAttrs*)this)->bCachedGetBottomLine =
((SwBorderAttrs*)this)->bCachedGetTopLine = sal_False;
- // OD 21.05.2003 #108789# - invalidate cache for values <bJoinedWithPrev>
+ // - invalidate cache for values <bJoinedWithPrev>
// and <bJoinedWithNext>.
bCachedJoinedWithPrev = sal_False;
bCachedJoinedWithNext = sal_False;
@@ -512,10 +508,10 @@ inline sal_Bool SwBorderAttrs::IsLine() const
/** method to determine the spacing values of a frame
- OD 2004-03-10 #i28701#
+ #i28701#
Values only provided for flow frames (table, section or text frames)
Note: line spacing value is only determined for text frames
- OD 2009-08-28 #i102458#
+ #i102458#
Add output parameter <obIsLineSpacingProportional>
@param rFrm
@@ -528,8 +524,6 @@ inline sal_Bool SwBorderAttrs::IsLine() const
output parameter - line spacing of the frame in SwTwips
@param obIsLineSpacingProportional
-
- @author OD
*/
void GetSpacingValuesOfFrm( const SwFrm& rFrm,
SwTwips& onLowerSpacing,
@@ -580,3 +574,5 @@ class SwDeletionChecker
};
#endif //_FRMTOOL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx
index 6c13fa75bff3..793bf0c8866a 100644
--- a/sw/source/core/inc/ftnboss.hxx
+++ b/sw/source/core/inc/ftnboss.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,3 +136,5 @@ inline const SwFtnContFrm *SwFtnBossFrm::FindFtnCont() const
}
#endif //_FTNBOSS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index afd97b4ce6e7..b4e7e3b7f5f4 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,7 +72,7 @@ class SwFtnFrm: public SwLayoutFrm
// --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects.
bool mbUnlockPosOfLowerObjs : 1;
// <--
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
protected:
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 );
@@ -86,14 +87,14 @@ public:
sal_Bool operator<( const SwTxtFtn* pTxtFtn ) const;
-#ifndef DBG_UTIL
- const SwCntntFrm *GetRef() const { return pRef; }
- SwCntntFrm *GetRef() { return pRef; }
-#else
- //JP 15.10.2001: in a non pro version test if the attribute has the same
- // meaning which his reference is
+#if OSL_DEBUG_LEVEL > 1
+ // in a non pro version test if the attribute has the same
+ // meaning which his reference is
const SwCntntFrm *GetRef() const;
SwCntntFrm *GetRef();
+#else
+ const SwCntntFrm *GetRef() const { return pRef; }
+ SwCntntFrm *GetRef() { return pRef; }
#endif
const SwCntntFrm *GetRefFromAttr() const;
SwCntntFrm *GetRefFromAttr();
@@ -148,3 +149,5 @@ public:
};
#endif //_FTNFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index 425719e62afa..c3705d29f1c5 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ public:
};
#endif //_HFFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ifinishedthreadlistener.hxx b/sw/source/core/inc/ifinishedthreadlistener.hxx
index fe096ba09251..fbf6099f8456 100644
--- a/sw/source/core/inc/ifinishedthreadlistener.hxx
+++ b/sw/source/core/inc/ifinishedthreadlistener.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,5 @@ class IFinishedThreadListener
};
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ithreadlistenerowner.hxx b/sw/source/core/inc/ithreadlistenerowner.hxx
index 26a5c1bb6fd3..8ba165774ee7 100644
--- a/sw/source/core/inc/ithreadlistenerowner.hxx
+++ b/sw/source/core/inc/ithreadlistenerowner.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,3 +57,5 @@ class IThreadListenerOwner
};
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 749d5d424fe3..e0ff55d151e4 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -209,13 +210,13 @@ class SwLayIdle
sal_Bool bPageValid; // Konnte die Seite alles validiert werden?
sal_Bool bAllValid; // Konnte alles validiert werden?
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool bIndicator;
#endif
#ifdef _LAYACT_CXX
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void ShowIdle( ColorData eName );
#endif
@@ -237,3 +238,5 @@ inline void SwLayAction::SetCheckPageNum( sal_uInt16 nNew )
}
#endif //_LAYACT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/laycache.hxx b/sw/source/core/inc/laycache.hxx
index 0f14067d0bda..768a1611010b 100644
--- a/sw/source/core/inc/laycache.hxx
+++ b/sw/source/core/inc/laycache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,9 +70,11 @@ public:
return pImpl; }
void UnlockImpl() { --nLockCount; }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool CompareLayout( const SwDoc& rDoc ) const;
#endif
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 3f437e083a7c..093549d057da 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,7 +67,7 @@ protected:
long CalcRel( const SwFmtFrmSize &rSz, sal_Bool bWidth ) const;
public:
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
TYPEINFO();
void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
@@ -113,7 +114,6 @@ public:
inline SwCntntFrm *ContainsCntnt();
const SwCellFrm *FirstCell() const;
inline SwCellFrm *FirstCell();
- // --> OD 2006-02-01 #130797#
// Method <ContainsAny()> doesn't investigate content of footnotes by default.
// But under certain circumstances this investigation is intended.
// Thus, introduce new optional parameter <_bInvestigateFtnForSections>.
@@ -121,7 +121,6 @@ public:
// investigated for sections.
const SwFrm *ContainsAny( const bool _bInvestigateFtnForSections = false ) const;
inline SwFrm *ContainsAny( const bool _bInvestigateFtnForSections = false );
- // <--
sal_Bool IsAnLower( const SwFrm * ) const;
virtual const SwFrmFmt *GetFmt() const;
@@ -134,8 +133,8 @@ public:
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
+ // --> #i28701# - change purpose of method and its name
+ // --> #i44016# - add parameter <_bUnlockPosOfObjs> to
// force an unlockposition call for the lower objects.
void NotifyLowerObjs( const bool _bUnlockPosOfObjs = false );
// <--
@@ -156,7 +155,7 @@ public:
/** method to check relative position of layout frame to
a given layout frame.
- OD 08.11.2002 - refactoring of pseudo-local method <lcl_Apres(..)> in
+ refactoring of pseudo-local method <lcl_Apres(..)> in
<txtftn.cxx> for #104840#.
@param _aCheckRefLayFrm
@@ -184,12 +183,10 @@ inline SwCellFrm* SwLayoutFrm::FirstCell()
return (SwCellFrm*)(((const SwLayoutFrm*)this)->FirstCell());
}
-// --> OD 2006-02-01 #130797#
inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
{
return (SwFrm*)(((const SwLayoutFrm*)this)->ContainsAny( _bInvestigateFtnForSections ));
}
-// <--
// Diese SwFrm-inlines sind hier, damit frame.hxx nicht layfrm.hxx includen muss
inline sal_Bool SwFrm::IsColBodyFrm() const
@@ -208,3 +205,5 @@ inline SwFrm* SwLayoutFrm::GetLastLower()
}
#endif // SW_LAYFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index db506d302642..7ffa885038dd 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,24 +38,24 @@ class SwPageFrm;
class SwLooping;
class IDocumentLayoutAccess;
-// --> OD 2004-06-23 #i28701#
+// --> #i28701#
class SwMovedFwdFrmsByObjPos;
class SwTxtFrm;
// <--
-// --> OD 2004-10-05 #i26945#
+// --> #i26945#
class SwRowFrm;
// <--
-// --> OD 2004-10-22 #i35911#
+// --> #i35911#
class SwObjsMarkedAsTmpConsiderWrapInfluence;
class SwAnchoredObject;
// <--
-// --> OD 2005-01-12 #i40155#
+// --> #i40155#
#include <vector>
class SwFrm;
// <--
-// --> OD 2006-05-10 #i65250#
+// --> #i65250#
#include <swtypes.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
class SwFlowFrm;
class SwLayoutFrm;
// <--
@@ -68,19 +69,19 @@ class SwLayouter
void _CollectEndnotes( SwSectionFrm* pSect );
sal_Bool StartLooping( SwPageFrm* pPage );
- // --> OD 2004-06-23 #i28701#
+ // --> #i28701#
SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
// <--
- // --> OD 2004-10-22 #i35911#
+ // --> #i35911#
SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
// <--
- // --> OD 2005-01-12 #i40155# - data structure to collect frames, which are
+ // --> #i40155# - data structure to collect frames, which are
// marked not to wrap around objects.
std::vector< const SwFrm* > maFrmsNotToWrap;
// <--
public:
- // --> OD 2006-05-10 #i65250#
+ // --> #i65250#
// - data structure to collect moving backward layout information
struct tMoveBwdLayoutInfoKey
{
@@ -117,7 +118,7 @@ private:
p_key1.mnFreeSpaceInNewUpper == p_key2.mnFreeSpaceInNewUpper;
}
};
- std::hash_map< const tMoveBwdLayoutInfoKey, sal_uInt16,
+ boost::unordered_map< const tMoveBwdLayoutInfoKey, sal_uInt16,
fMoveBwdLayoutInfoKeyHash,
fMoveBwdLayoutInfoKeyEq > maMoveBwdLayoutInfo;
// <--
@@ -136,7 +137,7 @@ public:
static sal_Bool Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn );
static sal_Bool StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage );
- // --> OD 2004-06-23 #i28701#
+ // --> #i28701#
static void ClearMovedFwdFrms( const SwDoc& _rDoc );
static void InsertMovedFwdFrm( const SwDoc& _rDoc,
const SwTxtFrm& _rMovedFwdFrmByObjPos,
@@ -145,29 +146,29 @@ public:
const SwTxtFrm& _rTxtFrm,
sal_uInt32& _ornToPageNum );
// <--
- // --> OD 2005-01-12 #i40155# - ummark given frame as to be moved forward.
+ // --> #i40155# - ummark given frame as to be moved forward.
static void RemoveMovedFwdFrm( const SwDoc& _rDoc,
const SwTxtFrm& _rTxtFrm );
// <--
- // --> OD 2004-10-05 #i26945#
+ // --> #i26945#
static bool DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
const SwRowFrm& _rRowFrm );
// <--
- // --> OD 2004-10-22 #i35911#
+ // --> #i35911#
static void ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc );
static void InsertObjForTmpConsiderWrapInfluence(
const SwDoc& _rDoc,
SwAnchoredObject& _rAnchoredObj );
// <--
- // --> OD 2005-01-12 #i40155#
+ // --> #i40155#
static void ClearFrmsNotToWrap( const SwDoc& _rDoc );
static void InsertFrmNotToWrap( const SwDoc& _rDoc,
const SwFrm& _rFrm );
static bool FrmNotToWrap( const IDocumentLayoutAccess& _rIDLA,
const SwFrm& _rFrm );
// <--
- // --> OD 2006-05-10 #i65250#
+ // --> #i65250#
static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
const SwFlowFrm& p_rFlowFrm,
const SwLayoutFrm& p_rNewUpperFrm );
@@ -181,3 +182,4 @@ extern void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm );
#endif //_LAYOUTER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx b/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
index c9cd053802d6..21120f6e5e7a 100644
--- a/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
+++ b/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
class SwTxtNode;
class SwTxtFrm;
-// --> OD 2004-10-05 #i26945#
+// --> #i26945#
class SwRowFrm;
// <--
@@ -53,14 +54,14 @@ class SwMovedFwdFrmsByObjPos
void Insert( const SwTxtFrm& _rMovedFwdFrmByObjPos,
const sal_uInt32 _nToPageNum );
- // --> OD 2005-01-12 #i40155#
+ // --> #i40155#
void Remove( const SwTxtFrm& _rTxtFrm );
// <--
bool FrmMovedFwdByObjPos( const SwTxtFrm& _rTxtFrm,
sal_uInt32& _ornToPageNum ) const;
- // --> OD 2004-10-05 #i26945#
+ // --> #i26945#
bool DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm ) const;
// <--
@@ -68,3 +69,5 @@ class SwMovedFwdFrmsByObjPos
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index 9269606f2031..ed4a856de65a 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -211,3 +212,4 @@ public:
#endif // SW_MVSAVE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/node2lay.hxx b/sw/source/core/inc/node2lay.hxx
index c70a084c1b85..ac83381f8c16 100644
--- a/sw/source/core/inc/node2lay.hxx
+++ b/sw/source/core/inc/node2lay.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include <tools/solar.h>
-/* -----------------23.02.99 11:33-------------------
+/* --------------------------------------------------
* Die Klasse SwNode2Layout stellt die Verbindung von Nodes zum Layout her.
* Sie liefert einen intelligenten Iterator ueber die zum Node oder Nodebereich
* gehoerenden Frames. Je nach Zweck der Iteration, z.B. um vor oder hinter
@@ -79,3 +80,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index 647e46511991..42db71134c45 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,4 @@ extern SwNoteURL *pNoteURL;
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 97ebb7d72400..584a23d8acbe 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ class SwNoTxtFrm: public SwCntntFrm
{
friend void _FrmFinit();
- short nWeight; // "Wichtigkeit" der Grafik
+ short nWeight; // importance of the graphic
const Size& GetSize() const;
@@ -47,7 +48,6 @@ class SwNoTxtFrm: public SwCntntFrm
void Format ( const SwBorderAttrs *pAttrs = 0 );
void PaintCntnt ( OutputDevice*, const SwRect&, const SwRect& ) const;
- /// OD 25.09.2002 #99739# - delete unused 3rd parameter
void PaintPicture( OutputDevice*, const SwRect& ) const;
protected:
virtual void MakeAll();
@@ -71,9 +71,10 @@ public:
void StopAnimation( OutputDevice* = 0 ) const;
sal_Bool HasAnimation() const;
- // Routinen fuer den Grafik-Cache
+ // Routine for the graphics cache
sal_uInt16 GetWeight() { return nWeight; }
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/objectformatter.hxx b/sw/source/core/inc/objectformatter.hxx
index 7a47a4012b30..c78c6f7775c5 100644
--- a/sw/source/core/inc/objectformatter.hxx
+++ b/sw/source/core/inc/objectformatter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,19 +31,17 @@
#include <sal/types.h>
class SwFrm;
-// --> OD 2004-10-08 #i26945#
+// #i26945#
class SwTxtFrm;
-// <--
class SwLayoutFrm;
class SwPageFrm;
class SwAnchoredObject;
class SwLayAction;
-// --> OD 2004-10-04 #i26945#
+// OD 2004-10-04 #i26945#
class SwPageNumAndTypeOfAnchors;
-// <--
// -----------------------------------------------------------------------------
-// OD 2004-06-25 #i28701#
+// #i28701#
// Format floating screen objects, which are anchored at the given anchor frame
// and registered at the given page frame.
// -----------------------------------------------------------------------------
@@ -64,30 +63,25 @@ class SwObjectFormatter
SwLayAction* mpLayAction;
// data structure to collect page number of object's 'anchor'
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
SwPageNumAndTypeOfAnchors* mpPgNumAndTypeOfAnchors;
- // <--
/** helper method for method <_FormatObj(..)> - performs the intrinsic
format of the layout of the given layout frame and all its lower
layout frames.
- OD 2004-06-28 #i28701#
+ #i28701#
IMPORTANT NOTE:
Method corresponds to methods <SwLayAction::FormatLayoutFly(..)> and
<SwLayAction::FormatLayout(..)>. Thus, its code for the formatting have
to be synchronised.
-
- @author OD
*/
void _FormatLayout( SwLayoutFrm& _rLayoutFrm );
/** helper method for method <_FormatObj(..)> - performs the intrinsic
format of the content of the given floating screen object.
- OD 2004-06-28 #i28701#
-
- @author OD
+ #i28701#
*/
void _FormatObjCntnt( SwAnchoredObject& _rAnchoredObj );
@@ -119,8 +113,6 @@ class SwObjectFormatter
/** method to restrict the format of floating screen objects to
as-character anchored ones
-
- @author OD
*/
inline void SetFormatOnlyAsCharAnchored()
{
@@ -134,23 +126,19 @@ class SwObjectFormatter
/** performs the intrinsic format of a given floating screen object and its content.
- OD 2004-06-28 #i28701#
-
- @author OD
+ #i28701#
*/
void _FormatObj( SwAnchoredObject& _rAnchoredObj );
/** invokes the intrinsic format method for all floating screen objects,
anchored at anchor frame on the given page frame
- OD 2004-06-28 #i28701#
- OD 2004-10-08 #i26945# - for format of floating screen objects for
+ #i28701#
+ #i26945# - for format of floating screen objects for
follow text frames, the 'master' text frame is passed to the method.
Thus, the objects, whose anchor character is inside the follow text
frame can be formatted.
- @author OD
-
@param _pMasterTxtFrm
input parameter - pointer to 'master' text frame. default value: NULL
*/
@@ -158,33 +146,25 @@ class SwObjectFormatter
/** accessor to collected anchored object
- OD 2004-07-05 #i28701#
-
- @author OD
+ #i28701#
*/
SwAnchoredObject* GetCollectedObj( const sal_uInt32 _nIndex );
/** accessor to 'anchor' page number of collected anchored object
- OD 2004-07-05 #i28701#
-
- @author OD
+ #i28701#
*/
sal_uInt32 GetPgNumOfCollected( const sal_uInt32 _nIndex );
/** accessor to 'anchor' type of collected anchored object
- OD 2004-10-04 #i26945#
-
- @author OD
+ #i26945#
*/
bool IsCollectedAnchoredAtMaster( const sal_uInt32 _nIndex );
/** accessor to total number of collected anchored objects
- OD 2004-07-05 #i28701#
-
- @author OD
+ #i28701#
*/
sal_uInt32 CountOfCollected();
@@ -193,9 +173,7 @@ class SwObjectFormatter
/** intrinsic method to format a certain floating screen object
- OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>
-
- @author OD
+ #i40147# - add parameter <_bCheckForMovedFwd>
@param _rAnchoredObj
input parameter - anchored object, which have to be formatted.
@@ -212,22 +190,16 @@ class SwObjectFormatter
const bool _bCheckForMovedFwd = false ) = 0;
/** intrinsic method to format all floating screen objects
-
- @author OD
*/
virtual bool DoFormatObjs() = 0;
/** method to format all floating screen objects at the given anchor frame
-
- @author OD
*/
static bool FormatObjsAtFrm( SwFrm& _rAnchorFrm,
const SwPageFrm& _rPageFrm,
SwLayAction* _pLayAction = 0L );
/** method to format a given floating screen object
-
- @author OD
*/
static bool FormatObj( SwAnchoredObject& _rAnchoredObj,
SwFrm* _pAnchorFrm = 0L,
@@ -236,3 +208,5 @@ class SwObjectFormatter
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/observablethread.hxx b/sw/source/core/inc/observablethread.hxx
index 45ee0e3a5918..e51a06e76420 100644
--- a/sw/source/core/inc/observablethread.hxx
+++ b/sw/source/core/inc/observablethread.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef _OBSERVABLETHREAD_HXX
#define _OBSERVABLETHREAD_HXX
-#ifndef _OSL_THREAD_HXX_
#include <osl/thread.hxx>
-#endif
#include <rtl/ref.hxx>
#include <osl/interlck.h>
@@ -103,3 +102,5 @@ class ObservableThread : public osl::Thread,
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/pagefrm.hrc b/sw/source/core/inc/pagefrm.hrc
new file mode 100644
index 000000000000..302ba9a76b16
--- /dev/null
+++ b/sw/source/core/inc/pagefrm.hrc
@@ -0,0 +1,47 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Sébastien Le Ray <sebastien-libreoffice@orniz.org>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _PAGEFRM_HRC
+#define _PAGEFRM_HRC
+
+#include "rcid.hrc"
+
+// Bitmaps for page shadow
+#define BMP_PAGE_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 0
+#define BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK RC_PAGEFRM_BEGIN + 1
+#define BMP_PAGE_BOTTOM_SHADOW_MASK RC_PAGEFRM_BEGIN + 2
+
+
+// If you add resources, don't forget to update this
+#define PAGEFRM_ACT_END BMP_PAGE_BOTTOMLEFT_SHADOW
+
+// Sanity check
+#if PAGEFRM_ACT_END > RC_PAGEFRM_END
+#error Not enough room for pagefrm resource in #file:#line
+#endif
+
+#endif
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 994701980a3f..392790a7cd78 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,12 +46,10 @@ class SdrObject;
class SwAttrSetChg;
class Font;
-// OD 2004-05-07 #i28701# - replaced by class <SwSortedObjs>
-//SV_DECL_PTRARR_SORT(SwSortDrawObjs,SdrObjectPtr,1,2);
+// #i28701# - replaced by class <SwSortedObjs>
class SwSortedObjs;
-// --> OD 2004-07-02 #i28701#
+// #i28701#
class SwAnchoredObject;
-// <--
enum SwPageChg
{
@@ -63,7 +62,7 @@ class SwPageFrm: public SwFtnBossFrm
{
friend class SwFrm;
- // OD 2004-05-07 #i28701# - use <SwSortedObjs>
+ // #i28701# - use <SwSortedObjs>
SwSortedObjs *pSortedObjs;
SwPageDesc *pDesc; //PageDesc der die Seite beschreibt.
@@ -84,12 +83,10 @@ class SwPageFrm: public SwFtnBossFrm
sal_Bool bInvalidWordCount :1;
sal_Bool bHasGrid :1; // Grid for Asian layout
- // OD 2004-05-17 #i28701# - boolean, indicating that layout of page frame
+ // #i28701# - boolean, indicating that layout of page frame
// is in progress.
bool mbLayoutInProgress;
- // OD 12.02.2003 #i9719#, #105645#
- static const sal_Int8 mnBorderPxWidth;
static const sal_Int8 mnShadowPxWidth;
void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
@@ -98,35 +95,9 @@ class SwPageFrm: public SwFtnBossFrm
// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
void SetColMaxFtnHeight();
- /** determine rectangle for page border
-
- OD 12.02.2003 for #i9719# and #105645#
-
- @author OD
-
- @param _rPageRect
- input parameter - constant instance reference of the page rectangle.
- Generally, it's the frame area of the page, but for empty pages in print
- preview, this parameter is useful.
-
- @param _pViewShell
- input parameter - instance of the view shell, for which the rectangle
- has to be generated.
-
- @param _orBorderRect
- output parameter - instance reference of the border rectangle for
- the given page rectangle
- */
- static void GetBorderRect( const SwRect& _rPageRect,
- ViewShell* _pViewShell,
- SwRect& _orBorderRect,
- bool bRightSidebar );
-
/** determine rectangle for right page shadow
- OD 12.02.2003 for #i9719# and #105645#
-
- @author OD
+ #i9719#
@param _rPageRect
input parameter - constant instance reference of the page rectangle.
@@ -148,9 +119,7 @@ class SwPageFrm: public SwFtnBossFrm
/** determine rectangle for bottom page shadow
- OD 12.02.2003 for #i9719# and #105645#
-
- @author OD
+ #i9719#
@param _rPageRect
input parameter - constant instance reference of the page rectangle.
@@ -169,12 +138,11 @@ class SwPageFrm: public SwFtnBossFrm
static void GetBottomShadowRect( const SwRect& _rPageRect,
ViewShell* _pViewShell,
SwRect& _orBottomShadowRect,
+ bool bFullBottomShadow,
bool bRightSidebar );
/** adds the sidebar used for notes to right and left border
- mod 20.10.2007 for #i6193#
-
- @author mod
+ #i6193#
@param aRect
input parameter - current rect, we change borders if we want a sidebar
@@ -206,10 +174,9 @@ public:
const SwSortedObjs *GetSortedObjs() const { return pSortedObjs; }
SwSortedObjs *GetSortedObjs() { return pSortedObjs; }
- // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
+ // #i28701# - new methods to append/remove drawing objects
void AppendDrawObjToPage( SwAnchoredObject& _rNewObj );
void RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj );
- // <--
void AppendFlyToPage( SwFlyFrm *pNew );
void RemoveFlyFromPage( SwFlyFrm *pToRemove );
@@ -239,7 +206,7 @@ public:
//Schickt an alle ContentFrames ein Prepare wg. geaenderter Registervorlage
void PrepareRegisterChg();
- // --> OD 2005-06-09 #i50432# - adjust method description and synopsis.
+ // #i50432# - adjust method description and synopsis.
// Appends a fly frame - the given one or a new one - at the page frame.
// Needed for <Modify> and <MakeFrms>
// - return value not needed any more
@@ -247,7 +214,6 @@ public:
// - third parameter only needed for assertion, but calling method assures
// this assertion. Thus, delete it.
void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
- // <--
virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
@@ -311,26 +277,20 @@ public:
sal_Bool IsInvalidAutoCompleteWords() const { return bInvalidAutoCmplWrds; }
sal_Bool IsInvalidWordCount() const { return bInvalidWordCount; }
- /** SwPageFrm::GetDrawBackgrdColor - for #102450#
+ /** SwPageFrm::GetDrawBackgrdColor
- 29.08.2002:
determine the color, that is respectively will be drawn as background
for the page frame.
- @author OD
-
@return reference to an instance of class Color
*/
const Color& GetDrawBackgrdColor() const;
/** paint margin area of a page
- OD 20.11.2002 for #104598#:
implement paint of margin area; margin area will be painted for a
view shell with a window and if the document is not in online layout.
- @author OD
-
@param _rOutputRect
input parameter - constant instance reference of the rectangle, for
which an output has to be generated.
@@ -344,11 +304,9 @@ public:
/** paint page border and shadow
- OD 12.02.2003 for #i9719# and #105645#
+ #i9719#
implement paint of page border and shadow
- @author OD
-
@param _rPageRect
input parameter - constant instance reference of the page rectangle.
Generally, it's the frame area of the page, but for empty pages in print
@@ -357,17 +315,27 @@ public:
@param _pViewShell
input parameter - instance of the view shell, on which the output
has to be generated.
+
+ @param bPaintRightShadow
+ Should we paint shadow on the right or not (used in book mode)
+
+ @param bFullBottomShadow
+ Should we have a bottom shadow of the same size as the pages or
+ not (for right pages in book mode in a LTR environment).
+
+ @param bRightSidebar
+ Is the note sidebar on the right or not (used to adjust the
+ shadow with & position).
*/
static void PaintBorderAndShadow( const SwRect& _rPageRect,
ViewShell* _pViewShell,
bool bPaintRightShadow,
+ bool bFullBottomShadow,
bool bRightSidebar );
/** get bound rectangle of border and shadow for repaints
- OD 12.02.2003 for #i9719# and #105645#
-
- author OD
+ #i9719#
@param _rPageRect
input parameter - constant instance reference of the page rectangle.
@@ -390,8 +358,6 @@ public:
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#
-
asks the page on which side a margin should be shown, e.g for notes
returns true for left side, false for right side
*/
@@ -399,20 +365,14 @@ public:
virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
- // OD 12.02.2003 #i9719#, #105645#
- inline sal_Int8 BorderPxWidth() const
- {
- return mnBorderPxWidth;
- }
inline sal_Int8 ShadowPxWidth() const
{
return mnShadowPxWidth;
}
- // OD 22.09.2003 #110978#
const SwRect PrtWithoutHeaderAndFooter() const;
- // OD 2004-05-17 #i28701#
+ // #i28701#
inline bool IsLayoutInProgress() const
{
return mbLayoutInProgress;
@@ -540,3 +500,5 @@ inline sal_Bool SwPageFrm::IsInvalidFly() const
#endif //_PAGEFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index 9ca795584eb1..f124abaccf27 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -100,3 +101,5 @@ SwCntntNode* GetNode( SwPaM&, sal_Bool&, SwMoveFn, sal_Bool bInReadOnly = sal_Fa
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/prevwpage.hxx b/sw/source/core/inc/prevwpage.hxx
index 517f4494b44f..ab42c6295742 100644
--- a/sw/source/core/inc/prevwpage.hxx
+++ b/sw/source/core/inc/prevwpage.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef _PREVIEWPAGES_HXX
#define _PREVIEWPAGES_HXX
@@ -7,10 +8,6 @@
class SwPageFrm;
/** data structure for a preview page in the current preview layout
-
- OD 12.12.2002 #103492# - struct <PrevwPage>
-
- @author OD
*/
struct PrevwPage
{
@@ -34,3 +31,5 @@ inline PrevwPage::PrevwPage()
{};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/ptqueue.hxx b/sw/source/core/inc/ptqueue.hxx
index 57717405998f..9ef7c2017822 100644
--- a/sw/source/core/inc/ptqueue.hxx
+++ b/sw/source/core/inc/ptqueue.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/retrievedinputstreamdata.hxx b/sw/source/core/inc/retrievedinputstreamdata.hxx
index fd09e1dbaca7..652e14633061 100644
--- a/sw/source/core/inc/retrievedinputstreamdata.hxx
+++ b/sw/source/core/inc/retrievedinputstreamdata.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,17 +32,13 @@
#include <sal/types.h>
#include <osl/mutex.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_
#include <com/sun/star/io/XInputStream.hpp>
-#endif
#include <map>
#include <boost/weak_ptr.hpp>
+
class SwAsyncRetrieveInputStreamThreadConsumer;
-//#ifndef _RETRIEVEINPUTSTREAMCONSUMER_HXX
-//#include <retrieveinputstreamconsumer.hxx>
-//#endif
/** Singleton class to manage retrieved input stream data in Writer
@@ -109,3 +106,5 @@ class SwRetrievedInputStreamDataManager
};
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/retrieveinputstream.hxx b/sw/source/core/inc/retrieveinputstream.hxx
index e16ba350246d..29e0fb532bca 100644
--- a/sw/source/core/inc/retrieveinputstream.hxx
+++ b/sw/source/core/inc/retrieveinputstream.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,12 +30,7 @@
#include <observablethread.hxx>
#include <tools/string.hxx>
-//#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
-//#include <com/sun/star/uno/Reference.hxx>
-//#endif
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_
#include <com/sun/star/io/XInputStream.hpp>
-#endif
#include <retrievedinputstreamdata.hxx>
/** class for a thread to retrieve an input stream given by an URL
@@ -66,3 +62,5 @@ class SwAsyncRetrieveInputStreamThread : public ObservableThread
const String mrLinkedURL;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/retrieveinputstreamconsumer.hxx b/sw/source/core/inc/retrieveinputstreamconsumer.hxx
index 2417f819bed3..26284034d425 100644
--- a/sw/source/core/inc/retrieveinputstreamconsumer.hxx
+++ b/sw/source/core/inc/retrieveinputstreamconsumer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#define _RETRIEVEINPUTSTREAMCONSUMER_HXX
#include <com/sun/star/uno/Reference.hxx>
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HXX_
#include <com/sun/star/io/XInputStream.hpp>
-#endif
#include <osl/interlck.h>
#include <retrievedinputstreamdata.hxx>
@@ -41,9 +40,7 @@ class SwAsyncRetrieveInputStreamThread;
/** class to provide creation of a thread to retrieve an input stream given by
an URL and to consume the retrieved input stream.
- OD 2007-01-29 #i73788#
-
- @author OD
+ #i73788#
*/
class SwAsyncRetrieveInputStreamThreadConsumer
{
@@ -53,14 +50,10 @@ class SwAsyncRetrieveInputStreamThreadConsumer
~SwAsyncRetrieveInputStreamThreadConsumer();
/** method to create thread
-
- @author OD
*/
void CreateThread( const String& rURL );
/** method called to provide the retrieved input stream to the thread Consumer
-
- @author OD
*/
void ApplyInputStream(
com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream,
@@ -72,3 +65,5 @@ class SwAsyncRetrieveInputStreamThreadConsumer
oslInterlockedCount mnThreadID;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 9a39200f0b21..84f64e309d70 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,13 +70,10 @@ class SwCharFmt;
#include <tox.hxx>
#include <SwNumberTreeTypes.hxx>
-// --> OD 2007-10-17 #i81002#
#include <IDocumentMarkAccess.hxx>
-// <--
#include <memory>
-
enum HISTORY_HINT {
HSTRY_SETFMTHNT,
HSTRY_RESETFMTHNT,
@@ -92,7 +90,7 @@ enum HISTORY_HINT {
HSTRY_RESETATTRSET,
HSTRY_CHGFLYANCHOR,
HSTRY_CHGFLYCHAIN,
- HSTRY_CHGCHARFMT, // #i27615#
+ HSTRY_CHGCHARFMT,
HSTRY_END
};
@@ -127,9 +125,7 @@ class SwHistoryResetFmt : public SwHistoryHint
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 );
};
@@ -267,7 +263,6 @@ class SwHistoryBookmark : public SwHistoryHint
bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk);
const ::rtl::OUString& GetName() const;
-
private:
const ::rtl::OUString m_aName;
::rtl::OUString m_aShortName;
@@ -296,7 +291,6 @@ public:
};
-
class SwHistoryResetAttrSet : public SwHistoryHint
{
const sal_uLong m_nNodeIndex;
@@ -338,7 +332,6 @@ public:
virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
};
-// #i27615#
class SwHistoryChangeCharFmt : public SwHistoryHint
{
const SfxItemSet m_OldSet;
@@ -350,7 +343,6 @@ public:
};
-
#endif
typedef SwHistoryHint* SwHistoryHintPtr;
@@ -376,17 +368,15 @@ public:
// 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#
+ void Add( const SfxItemSet & rSet, const SwCharFmt & rCharFmt);
sal_uInt16 Count() const { return m_SwpHstry.Count(); }
sal_uInt16 GetTmpEnd() const { return m_SwpHstry.Count() - m_nEndDiff; }
@@ -409,9 +399,7 @@ public:
// 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
@@ -426,15 +414,14 @@ private:
void _MakeSetWhichIds();
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 );
virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
- /// @return true iff at least 1 item was inserted
+ /// @return true if at least 1 item was inserted
bool InsertItems( const SfxItemSet& rSet,
xub_StrLen const nStart, xub_StrLen const nEnd,
SetAttrMode const nFlags );
@@ -447,6 +434,6 @@ public:
#endif
-
#endif // _ROLBCK_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index ea976a77765f..ac404df62b35 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,7 +203,7 @@ public:
SwPrintData const*const pPrintData = NULL ) const;
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
+#if OSL_DEBUG_LEVEL > 1
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
#endif
@@ -300,10 +301,6 @@ public:
void SetBrowseWidth( long n ) { bBrowseWidthValid = sal_True; nBrowseWidth = n;}
inline void InvalidateBrowseWidth();
-#ifdef LONG_TABLE_HACK
- void HackPrepareLongTblPaint( int nMode );
-#endif
-
sal_Bool IsNewLayout() const { return bIsNewLayout; }
void ResetNewLayout() { bIsNewLayout = sal_False;}
@@ -312,8 +309,8 @@ public:
void InsertEmptySct( SwSectionFrm* pDel );
void DeleteEmptySct() { if( pDestroy ) _DeleteEmptySct(); }
void RemoveFromList( SwSectionFrm* pSct ) { if( pDestroy ) _RemoveFromList( pSct ); }
-#ifdef DBG_UTIL
- // Wird zur Zeit nur fuer ASSERTs benutzt:
+#if OSL_DEBUG_LEVEL > 1
+ // Wird zur Zeit nur fuer OSL_ENSURE( benutzt:
sal_Bool IsInDelList( SwSectionFrm* pSct ) const; // Ist der SectionFrm in der Liste enthalten?
#endif
@@ -369,3 +366,4 @@ inline void SwRootFrm::SetVirtPageNum( const sal_Bool bOf) const
#endif // SW_ROOTFRM_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 2869e45bf540..8055ce869a10 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -109,3 +110,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index 60c6877d4fb3..01c0e40e88a9 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,6 @@
#ifndef _SCRIPTINFO_HXX
#define _SCRIPTINFO_HXX
#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_SHORTS
-#define _SVSTDARR_BYTES
#define _SVSTDARR_USHORTS
#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
@@ -37,7 +36,6 @@
#include <list>
#include <modeltoviewhelper.hxx>
-#include <errhdl.hxx>
class SwTxtNode;
class Point;
@@ -98,18 +96,38 @@ public:
class SwScriptInfo
{
private:
- SvXub_StrLens aScriptChg;
- SvBytes aScriptType;
- SvXub_StrLens aDirChg;
- SvBytes aDirType;
+ //! Records a single change in script type.
+ struct ScriptChangeInfo
+ {
+ xub_StrLen position; //!< Character position at which we change script
+ sal_uInt8 type; //!< Script type (Latin/Asian/Complex) that we change to.
+ inline ScriptChangeInfo(xub_StrLen pos, sal_uInt8 typ) : position(pos), type(typ) {};
+ };
+ //TODO - This is sorted, so should probably be a std::set rather than vector.
+ // But we also use random access (probably unnecessarily).
+ std::vector<ScriptChangeInfo> aScriptChanges;
+ //! Records a single change in direction.
+ struct DirectionChangeInfo
+ {
+ xub_StrLen position; //!< Character position at which we change direction.
+ sal_uInt8 type; //!< Direction that we change to.
+ inline DirectionChangeInfo(xub_StrLen pos, sal_uInt8 typ) : position(pos), type(typ) {};
+ };
+ std::vector<DirectionChangeInfo> aDirectionChanges;
SvXub_StrLens aKashida;
SvXub_StrLens aKashidaInvalid;
SvXub_StrLens aNoKashidaLine;
SvXub_StrLens aNoKashidaLineEnd;
- SvXub_StrLens aCompChg;
- SvXub_StrLens aCompLen;
SvXub_StrLens aHiddenChg;
- SvBytes aCompType;
+ //! Records a single change in compression.
+ struct CompressionChangeInfo
+ {
+ xub_StrLen position; //!< Character position where the change occurs.
+ xub_StrLen length; //!< Length of the segment.
+ sal_uInt8 type; //!< Type of compression that we change to.
+ inline CompressionChangeInfo(xub_StrLen pos, xub_StrLen len, sal_uInt8 typ) : position(pos), length(len), type(typ) {};
+ };
+ std::vector<CompressionChangeInfo> aCompressionChanges;
xub_StrLen nInvalidityPos;
sal_uInt8 nDefaultDir;
@@ -356,61 +374,63 @@ inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
if ( nPos < nInvalidityPos )
nInvalidityPos = nPos;
};
-inline size_t SwScriptInfo::CountScriptChg() const { return aScriptChg.size(); }
+inline size_t SwScriptInfo::CountScriptChg() const { return aScriptChanges.size(); }
inline xub_StrLen SwScriptInfo::GetScriptChg( const size_t nCnt ) const
{
- ASSERT( nCnt < aScriptChg.size(),"No ScriptChange today!");
- return aScriptChg[ nCnt ];
+ OSL_ENSURE( nCnt < aScriptChanges.size(),"No ScriptChange today!");
+ return aScriptChanges[nCnt].position;
}
inline sal_uInt8 SwScriptInfo::GetScriptType( const xub_StrLen nCnt ) const
{
- ASSERT( nCnt < aScriptType.size(),"No ScriptType today!");
- return aScriptType[ nCnt ];
+ OSL_ENSURE( nCnt < aScriptChanges.size(),"No ScriptType today!");
+ return aScriptChanges[nCnt].type;
}
-inline size_t SwScriptInfo::CountDirChg() const { return aDirChg.size(); }
+inline size_t SwScriptInfo::CountDirChg() const { return aDirectionChanges.size(); }
inline xub_StrLen SwScriptInfo::GetDirChg( const size_t nCnt ) const
{
- ASSERT( nCnt < aDirChg.size(),"No DirChange today!");
- return aDirChg[ nCnt ];
+ OSL_ENSURE( nCnt < aDirectionChanges.size(),"No DirChange today!");
+ return aDirectionChanges[ nCnt ].position;
}
inline sal_uInt8 SwScriptInfo::GetDirType( const size_t nCnt ) const
{
- ASSERT( nCnt < aDirType.size(),"No DirType today!");
- return aDirType[ nCnt ];
+ OSL_ENSURE( nCnt < aDirectionChanges.size(),"No DirType today!");
+ return aDirectionChanges[ nCnt ].type;
}
inline size_t SwScriptInfo::CountKashida() const { return aKashida.size(); }
inline xub_StrLen SwScriptInfo::GetKashida( const size_t nCnt ) const
{
- ASSERT( nCnt < aKashida.size(),"No Kashidas today!");
+ OSL_ENSURE( nCnt < aKashida.Count(),"No Kashidas today!");
return aKashida[ nCnt ];
}
-inline size_t SwScriptInfo::CountCompChg() const { return aCompChg.size(); };
+inline size_t SwScriptInfo::CountCompChg() const { return aCompressionChanges.size(); };
inline xub_StrLen SwScriptInfo::GetCompStart( const size_t nCnt ) const
{
- ASSERT( nCnt < aCompChg.size(),"No CompressionStart today!");
- return aCompChg[ nCnt ];
+ OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionStart today!");
+ return aCompressionChanges[ nCnt ].position;
}
inline xub_StrLen SwScriptInfo::GetCompLen( const size_t nCnt ) const
{
- ASSERT( nCnt < aCompLen.size(),"No CompressionLen today!");
- return aCompLen[ nCnt ];
+ OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionLen today!");
+ return aCompressionChanges[ nCnt ].length;
}
inline sal_uInt8 SwScriptInfo::GetCompType( const size_t nCnt ) const
{
- ASSERT( nCnt < aCompType.size(),"No CompressionType today!");
- return aCompType[ nCnt ];
+ OSL_ENSURE( nCnt < aCompressionChanges.size(),"No CompressionType today!");
+ return aCompressionChanges[ nCnt ].type;
}
inline size_t SwScriptInfo::CountHiddenChg() const { return aHiddenChg.size(); };
inline xub_StrLen SwScriptInfo::GetHiddenChg( const size_t nCnt ) const
{
- ASSERT( nCnt < aHiddenChg.size(),"No HiddenChg today!");
+ OSL_ENSURE( nCnt < aHiddenChg.Count(),"No HiddenChg today!");
return aHiddenChg[ nCnt ];
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 27169fe0e97f..f06ff2a4a5d1 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,3 +147,5 @@ inline const SwCntntFrm *SwSectionFrm::FindLastCntnt( sal_uInt8 nMode ) const
#endif //_SECTFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/setmapvirtdev.hxx b/sw/source/core/inc/setmapvirtdev.hxx
index e438899c2287..c3b6cdf7fea7 100644
--- a/sw/source/core/inc/setmapvirtdev.hxx
+++ b/sw/source/core/inc/setmapvirtdev.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,4 @@ void SetMappingForVirtDev( const Point& _rNewOrigin,
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/sortedobjs.hxx b/sw/source/core/inc/sortedobjs.hxx
index b983e2c81271..720ff087c936 100644
--- a/sw/source/core/inc/sortedobjs.hxx
+++ b/sw/source/core/inc/sortedobjs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,8 +52,6 @@ class SwAnchoredObject;
- internal anchor order number
If one of the sort criteria attributes of an anchored object changes,
the sorting has to be updated - use method <Update(..)>
-
- @author OD
*/
class SwSortedObjs
{
@@ -69,8 +68,6 @@ class SwSortedObjs
@param _nIndex
input parameter - index of entry, valid value range [0..Count()-1]
-
- @author OD
*/
SwAnchoredObject* operator[]( sal_uInt32 _nIndex ) const;
@@ -83,22 +80,15 @@ class SwSortedObjs
/** method to update the position of the given anchored object in the
sorted list
- OD 2004-07-01
-
- @author OD
-
@return boolean, indicating success of the update.
*/
bool Update( SwAnchoredObject& _rAnchoredObj );
/** Position of object <_rAnchoredObj> in sorted list
- OD 2004-05-07
Returns the number of the list position of object <_rAnchoredObj>.
Returns <Count()>, if object isn't contained in list.
- @author OD
-
@return sal_uInt32
Number of the list position of object <_rAnchoredObj>
*/
@@ -106,3 +96,5 @@ class SwSortedObjs
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/sortedobjsimpl.hxx b/sw/source/core/inc/sortedobjsimpl.hxx
index c15ed5e0e5dd..1b23cd194ac9 100644
--- a/sw/source/core/inc/sortedobjsimpl.hxx
+++ b/sw/source/core/inc/sortedobjsimpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ class SwSortedObjsImpl
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx
index c5d2b9240b22..1ac9455abff7 100644
--- a/sw/source/core/inc/swblocks.hxx
+++ b/sw/source/core/inc/swblocks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <tools/string.hxx>
-#ifndef _DATE_HXX //autogen
#include <tools/datetime.hxx>
-#endif
#include <svl/svarray.hxx>
@@ -144,99 +143,6 @@ public:
virtual sal_Bool PutMuchEntries( sal_Bool bOn );
};
-/*
-class Sw3Persist : public SvPersist
-{
- virtual void FillClass( SvGlobalName * pClassName,
- sal_uLong * pClipFormat,
- String * pAppName,
- String * pLongUserName,
- String * pUserName,
- sal_Int32 nFileFormat=SOFFICE_FILEFORMAT_CURRENT ) const;
- virtual sal_Bool Save();
- virtual sal_Bool SaveCompleted( SvStorage * );
-public:
- Sw3Persist();
-};
-
-class SwSwgReader;
-
-class Sw2TextBlocks : public SwImpBlocks
-{
- SvPersistRef refPersist; // Fuer OLE-Objekte
- SwSwgReader* pRdr; // Lese-Routinen
- SfxMedium* pMed; // der logische Input-Stream
- String* pText; // String fuer GetText()
- long nDocStart; // Beginn des Doc-Records
- long nDocSize; // Laenge des Doc-Records
- long nStart; // Beginn des CONTENTS-Records
- long nSize; // Laenge des CONTENTS-Records
- 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 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;
- sal_uLong LoadDoc();
-
- virtual sal_uLong OpenFile( sal_Bool bReadOnly = sal_True );
- virtual void CloseFile();
-
- void StatLineStartPercent(); // zum Anzeigen des Prozessbars
-};
-
-class Sw3Io;
-class Sw3IoImp;
-
-class Sw3TextBlocks : public SwImpBlocks
-{
- Sw3Io* pIo3;
- Sw3IoImp* pImp;
- sal_Bool bAutocorrBlock;
-
-public:
- Sw3TextBlocks( const String& );
- Sw3TextBlocks( SvStorage& );
- virtual ~Sw3TextBlocks();
- 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 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 sal_uLong OpenFile( sal_Bool bReadOnly = sal_True );
- virtual void CloseFile();
-
- // Methoden fuer die neue Autokorrektur
- sal_uLong GetText( const String& rShort, String& );
- SwDoc* GetDoc() const { return pDoc; }
-
- virtual sal_Bool IsOnlyTextBlock( const String& rShort ) const;
-
- virtual sal_uLong GetMacroTable( sal_uInt16, SvxMacroTableDtor& rMacroTbl,
- sal_Bool bFileAlreadyOpen = sal_False );
- virtual sal_uLong SetMacroTable( sal_uInt16 nIdx,
- const SvxMacroTableDtor& rMacroTbl,
- sal_Bool bFileAlreadyOpen = sal_False );
-
- void ReadInfo();
-};
-*/
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx
index b23ccb0f834a..cfb585345566 100644
--- a/sw/source/core/inc/swcache.hxx
+++ b/sw/source/core/inc/swcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,11 +58,9 @@
*
*/
-#ifdef DBG_UTIL
-#ifndef _STRING_HXX //autogen
+#if OSL_DEBUG_LEVEL > 1
#include <tools/string.hxx>
#endif
-#endif
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
@@ -91,7 +90,7 @@ class SwCache : public SwCacheObjArr
void DeleteObj( SwCacheObj *pObj );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aName;
long nAppend; //Anzahl der Eintragungen durch Erweiterung.
long nInsertFree; //Anzahl der Eintragungen auf freie Plaetze.
@@ -113,7 +112,7 @@ class SwCache : public SwCacheObjArr
public:
//nur sal_uInt8 hineinstecken!!!
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize,
const ByteString &rNm );
~SwCache();
@@ -194,12 +193,12 @@ public:
inline sal_Bool IsLocked() const { return 0 != nLock; }
-#ifndef DBG_UTIL
- inline void Lock() { ++nLock; }
- inline void Unlock() { --nLock; }
-#else
+#if OSL_DEBUG_LEVEL > 1
void Lock();
void Unlock();
+#else
+ inline void Lock() { ++nLock; }
+ inline void Unlock() { --nLock; }
#endif
SwCacheObj *Next() { return pNext; }
@@ -246,7 +245,7 @@ public:
inline void SwCache::IncreaseMax( const sal_uInt16 nAdd )
{
nCurMax = nCurMax + sal::static_int_cast< sal_uInt16 >(nAdd);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nIncreaseMax;
#endif
}
@@ -254,7 +253,7 @@ inline void SwCache::DecreaseMax( const sal_uInt16 nSub )
{
if ( nCurMax > nSub )
nCurMax = nCurMax - sal::static_int_cast< sal_uInt16 >(nSub);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
++nDecreaseMax;
#endif
}
@@ -300,3 +299,5 @@ inline SwCacheObj *SwCacheAccess::Get()
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx
index 375139c260d7..e57b6f7b1a41 100644
--- a/sw/source/core/inc/swfntcch.hxx
+++ b/sw/source/core/inc/swfntcch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ class SwFontCache : public SwCache
public:
inline SwFontCache() : SwCache(50,50
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, "Globaler AttributSet/Font-Cache pSwFontCache"
#endif
) {}
@@ -97,3 +98,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 631abab76b38..f0cf7bab6a32 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <i18npool/lang.h>
#include <tools/color.hxx>
-#ifndef _TOOLS_STREAM_HXX //autogen
#include <tools/stream.hxx>
-#endif
#include <editeng/svxfont.hxx>
#include <swtypes.hxx>
#include <drawfont.hxx> // SwDrawTextInfo
@@ -832,7 +831,7 @@ public:
SwFont& GetFont()
{
- ASSERT( pFnt, "No underline font" )
+ OSL_ENSURE( pFnt, "No underline font" );
return *pFnt;
}
const Point& GetPos() const { return aPos; }
@@ -845,9 +844,7 @@ public:
* class SvStatistics
*************************************************************************/
-#ifndef DBG_UTIL
-#define SV_STAT(nWhich)
-#else
+#if OSL_DEBUG_LEVEL > 1
class SvStatistics
{
@@ -893,7 +890,10 @@ inline void SvStatistics::PrintOn( SvStream &rOS ) const //$ ostream
rOS << "\tnDrawStretchText: " << nDrawStretchText << '\n'; if( nChangeFont )
rOS << "\tnChangeFont: " << nChangeFont << '\n'; if( nGetFontMetric )
rOS << "\tnGetFontMetric: " << nGetFontMetric << '\n'; rOS << "}" << '\n'; }
-#endif /* PRODUCT */
+#else
+#define SV_STAT(nWhich)
+#endif /* DEBUG */
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swselectionlist.hxx b/sw/source/core/inc/swselectionlist.hxx
index 1431a49c5bc3..a3deb52ce66f 100644
--- a/sw/source/core/inc/swselectionlist.hxx
+++ b/sw/source/core/inc/swselectionlist.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -95,3 +96,5 @@ public:
};
#endif //_SWSELECTIONLIST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swthreadjoiner.hxx b/sw/source/core/inc/swthreadjoiner.hxx
index d3d7ab8bd97b..e997e6dadc26 100644
--- a/sw/source/core/inc/swthreadjoiner.hxx
+++ b/sw/source/core/inc/swthreadjoiner.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ class SwThreadJoiner
SwThreadJoiner();
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/swthreadmanager.hxx b/sw/source/core/inc/swthreadmanager.hxx
index 4ab94ef4cfc2..c44fe5109b62 100644
--- a/sw/source/core/inc/swthreadmanager.hxx
+++ b/sw/source/core/inc/swthreadmanager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,10 +41,8 @@ class ThreadManager;
/** class to manage threads in Writer using a <ThreadManager> instance
- OD 2007-04-13 #i73788#
+ #i73788#
Conforms the singleton pattern
-
- @author OD
*/
class SwThreadManager
: private ::boost::noncopyable
@@ -67,14 +66,10 @@ class SwThreadManager
Suspending the starting of further threads is sensible during the
destruction of a Writer document.
-
- @author OD
*/
void SuspendStartingOfThreads();
/** continues the starting of threads after it has been suspended
-
- @author OD
*/
void ResumeStartingOfThreads();
@@ -87,3 +82,5 @@ class SwThreadManager
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index a93ddf24ebf3..184e649b27ac 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -232,3 +233,5 @@ inline SwTabFrm *SwTabFrm::GetFollow()
}
#endif // SW_TABFRM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 866e82274de9..659ae318cc92 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,7 +67,7 @@ sal_Bool lcl_BoxSetHeadCondColl( const SwTableBox*& rpBox, void* pPara );
sal_Bool lcl_LineSetHeadCondColl( const SwTableLine*& rpLine, void* pPara );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
#endif
@@ -226,3 +227,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/textapi.hxx b/sw/source/core/inc/textapi.hxx
index 609e0a0ecc4d..5692c7ae3c7f 100755..100644
--- a/sw/source/core/inc/textapi.hxx
+++ b/sw/source/core/inc/textapi.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ public:
void SetText( OutlinerParaObject& rText ) { pSource->SetText( rText ); }
String GetText() { return pSource->GetText(); }
};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/threadlistener.hxx b/sw/source/core/inc/threadlistener.hxx
index 9ff03cf37cc4..f6bc5edf8895 100644
--- a/sw/source/core/inc/threadlistener.hxx
+++ b/sw/source/core/inc/threadlistener.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,5 @@ class ThreadListener : public IFinishedThreadListener
IThreadListenerOwner& mrThreadListenerOwner;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/threadmanager.hxx b/sw/source/core/inc/threadmanager.hxx
index a167548da7b4..53ea5f7c689f 100644
--- a/sw/source/core/inc/threadmanager.hxx
+++ b/sw/source/core/inc/threadmanager.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -170,3 +171,5 @@ class ThreadManager : public IThreadListenerOwner
bool StartThread( const tThreadData& aThreadData );
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/tocntntanchoredobjectposition.hxx b/sw/source/core/inc/tocntntanchoredobjectposition.hxx
index 80c788098fde..ac5c8ac5424c 100644
--- a/sw/source/core/inc/tocntntanchoredobjectposition.hxx
+++ b/sw/source/core/inc/tocntntanchoredobjectposition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@ namespace objectpositioning
private:
// calculated data for object position
const SwLayoutFrm* mpVertPosOrientFrm;
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
// determine offset to frame anchor position according to the
// positioning alignments
Point maOffsetToFrmAnchorPos;
@@ -54,7 +55,7 @@ namespace objectpositioning
virtual bool IsAnchoredToChar() const;
virtual const SwFrm* ToCharOrientFrm() const;
virtual const SwRect* ToCharRect() const;
- // OD 12.11.2003 #i22341#
+ // #i22341#
virtual SwTwips ToCharTopOfLine() const;
// method to cast <SwAnchoredObjectPosition::GetAnchorFrm()> to
@@ -64,7 +65,6 @@ namespace objectpositioning
// *********************************************************************
/** determine frame for horizontal position
- OD 04.08.2003
if the given proposed frame is a content frame, the proposed
frame is returned.
otherwise (given proposed frame is a layout frame),
@@ -72,8 +72,6 @@ namespace objectpositioning
for the first, that the anchor or a follow of the anchor.
If none is found, the proposed frame is returned.
- @author OD
-
@param _pProposedFrm
input parameter - proposed frame for horizontal position
@@ -87,17 +85,15 @@ namespace objectpositioning
virtual ~SwToCntntAnchoredObjectPosition();
/** calculate position of object
-
- @author OD
*/
virtual void CalcPosition();
/** frame, at which the vertical position is oriented at
-
- @author OD
*/
const SwLayoutFrm& GetVertPosOrientFrm() const;
};
} // namespace objectpositioning
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/tolayoutanchoredobjectposition.hxx b/sw/source/core/inc/tolayoutanchoredobjectposition.hxx
index e5e77e640057..6387b8e7ced4 100644
--- a/sw/source/core/inc/tolayoutanchoredobjectposition.hxx
+++ b/sw/source/core/inc/tolayoutanchoredobjectposition.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@ namespace objectpositioning
// calculated data for object position type TO_LAYOUT
Point maRelPos;
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
// determine offset to frame anchor position according to the
// positioning alignments
Point maOffsetToFrmAnchorPos;
@@ -48,19 +49,15 @@ namespace objectpositioning
virtual ~SwToLayoutAnchoredObjectPosition();
/** calculate position for object
-
- OD 30.07.2003 #110978#
-
- @author OD
*/
virtual void CalcPosition();
/** calculated relative position for object
-
- @author OD
*/
Point GetRelPos() const;
};
} // namespace objectpositioning
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/toxhlp.hxx b/sw/source/core/inc/toxhlp.hxx
index 01188e1d8c7e..b254874009bf 100644
--- a/sw/source/core/inc/toxhlp.hxx
+++ b/sw/source/core/inc/toxhlp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index 4d5e41fe8b71..75ad22213c79 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -292,3 +293,5 @@ public:
#endif // SW_TXMSRT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 3cc1cbfc03b9..fcb88f8b038c 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,13 +85,11 @@ class SwTxtFrm: public SwCntntFrm
// OD 2004-03-17 #i11860# - re-factoring of #i11859#
// member for height of last line (value needed for proportional line spacing)
SwTwips mnHeightOfLastLine;
- // --> OD 2008-01-31 #newlistlevelattrs#
// member for the additional first line offset, which is caused by the list
// label alignment for list level position and space mode LABEL_ALIGNMENT.
// This additional first line offset is used for the text formatting.
// It is NOT used for the determination of printing area.
SwTwips mnAdditionalFirstLineOffset;
- // <--
xub_StrLen nOfst; //nOfst gibt den Offset im Cntnt (Anzahl Zeichen) an.
@@ -403,10 +402,10 @@ public:
inline sal_Bool IsSwapped() const { return bIsSwapped; }
// Hat der Frm eine lokale Fussnote (in diesem Frm bzw. Follow)?
-#ifndef DBG_UTIL
- void CalcFtnFlag();
+#if OSL_DEBUG_LEVEL > 1
+ void CalcFtnFlag( xub_StrLen nStop = STRING_LEN );//For testing SplitFrm
#else
- void CalcFtnFlag( xub_StrLen nStop = STRING_LEN );//Fuer den Test von SplitFrm
+ void CalcFtnFlag();
#endif
// Hidden
@@ -503,18 +502,14 @@ public:
line offset for the real text formatting due to the value of label
adjustment attribute of the list level.
- OD 2008-01-31 #newlistlevelattrs#
-
@author OD
*/
void CalcAdditionalFirstLineOffset();
- // --> OD 2008-01-31 #newlistlevelattrs#
inline SwTwips GetAdditionalFirstLineOffset() const
{
return mnAdditionalFirstLineOffset;
}
- // <--
// liefert den zusaetzlichen Zeilenabstand fuer den naechsten Absatz
// OD 07.01.2004 #i11859# - change return data type;
@@ -611,6 +606,10 @@ public:
{
return mnHeightOfLastLine;
}
+
+#if OSL_DEBUG_LEVEL > 1
+ virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+#endif
};
/*************************************************************************
@@ -737,47 +736,6 @@ inline void SwTxtFrm::ResetBlinkPor() const
((SwTxtFrm*)this)->bBlinkPor = sal_False;
}
-#ifdef LINGU_STATISTIK
-
-class SwLinguStatistik
-{
-public:
- long nWords; // gepruefte Worte
- long nFlushCnt; // zaehlt die Messungen
-
- long nWrong; // als falsch erkannt
- long nAlter; // Alternativvorschlaege
- long nSpellTime; // Zeitmessung
- long nSynonym; // Thesaurus
- long nNoSynonym; // Thesaurus ratlos
- long nMeaning; // Thesaurus-Bedeutung
- long nNoMeaning; // Thesaurus meinungslos
- long nTheTime; // Zeitmessung
- long nHyphens; // Trennstellen
- long nNoHyph; // Worte ohne Trennstellen
- long nHyphErr; // Fehler beim Trennen
- long nHyphTime; // Zeitmessung
- SpellCheck *pSpell;
- LanguageType eLang;
-
- void Flush();
-
- inline SwLinguStatistik()
- { nWords = nWrong = nAlter = nSynonym = nNoSynonym =
- nHyphens = nNoHyph = nHyphErr = nSpellTime = nTheTime =
- nHyphTime = nFlushCnt = 0;
- pSpell = NULL;
- eLang = LANGUAGE_DONTKNOW; }
- inline ~SwLinguStatistik(){ Flush(); }
-};
-
-// globale Variable, implementiert in txtfrm.cxx
-extern SwLinguStatistik aSwLinguStat;
-
-#define SW_LING(nWhich,nInc) (aSwLinguStat.nWhich) += nInc;
-
-#endif
-
#define SWAP_IF_SWAPPED( pFrm )\
sal_Bool bUndoSwap = sal_False; \
if ( pFrm->IsVertical() && pFrm->IsSwapped() )\
@@ -830,3 +788,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/txttypes.hxx b/sw/source/core/inc/txttypes.hxx
index f9026574245e..86d9e5cd07a6 100644
--- a/sw/source/core/inc/txttypes.hxx
+++ b/sw/source/core/inc/txttypes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,3 +102,5 @@
#define POR_TABLEFT 0x0740
#endif //_TXTTYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/undoflystrattr.hxx b/sw/source/core/inc/undoflystrattr.hxx
index 5115f1a37c07..9a44ae2310c3 100644
--- a/sw/source/core/inc/undoflystrattr.hxx
+++ b/sw/source/core/inc/undoflystrattr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,3 +55,5 @@ class SwUndoFlyStrAttr : public SwUndo
};
#endif // SW_UNDO_FLY_STR_ATTR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/unofldmid.h b/sw/source/core/inc/unofldmid.h
index 6ad9ea28d399..09c91e4021b4 100644
--- a/sw/source/core/inc/unofldmid.h
+++ b/sw/source/core/inc/unofldmid.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,5 @@ namespace com { namespace sun { namespace star { namespace uno {
String& GetString( const com::sun::star::uno::Any&, String& rStr );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx
index 52ac418b3861..92333a46ca8a 100755..100644
--- a/sw/source/core/inc/unometa.hxx
+++ b/sw/source/core/inc/unometa.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -366,3 +367,4 @@ void getPrefixAndSuffix(
#endif // SW_UNOMETA_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 3959a815eaa2..84a840f43bc3 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include <vcl/timer.hxx>
#include <tools/color.hxx>
-// OD 25.06.2003 #108784#
#include <svx/svdtypes.hxx>
#include <tools/string.hxx>
@@ -67,7 +67,7 @@ class SwViewImp
friend class SwLayAction; //Lay- und IdleAction tragen sich ein und aus.
friend class SwLayIdle;
- // OD 12.12.2002 #103492# - for paint of page preview
+ // for paint of page preview
friend class SwPagePreviewLayout;
ViewShell *pSh; //Falls jemand einen Imp durchreicht und doch
@@ -92,8 +92,6 @@ class SwViewImp
sal_Bool bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
- //sal_Bool bResetXorVisibility:1; //StartAction/EndAction
- //HMHBOOL bShowHdlPaint :1; //LockPaint/UnlockPaint
sal_Bool bResetHdlHiddenPaint:1;// -- "" --
sal_Bool bSmoothUpdate :1; //Meber fuer SmoothScroll
@@ -103,7 +101,6 @@ class SwViewImp
sal_uInt16 nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO)
SwRect aSmoothRect;
- // OD 12.12.2002 #103492#
SwPagePreviewLayout* mpPgPrevwLayout;
/**
@@ -140,12 +137,10 @@ private:
/** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
- OD 2005-12-01 #i27138#
+ #i27138#
implementation for wrapper method
<ViewShell::InvalidateAccessibleParaFlowRelation(..)>
- @author OD
-
@param _pFromTxtFrm
input parameter - paragraph frame, for which the relation CONTENT_FLOWS_FROM
has to be invalidated.
@@ -161,21 +156,17 @@ private:
/** invalidate text selection for paragraphs
- OD 2005-12-12 #i27301#
+ #i27301#
implementation for wrapper method
<ViewShell::InvalidateAccessibleParaTextSelection(..)>
-
- @author OD
*/
void _InvalidateAccessibleParaTextSelection();
/** invalidate attributes for paragraphs and paragraph's characters
- OD 2009-01-06 #i88069#
+ #i88069#
implementation for wrapper method
<ViewShell::InvalidateAccessibleParaAttrs(..)>
-
- @author OD
*/
void _InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm );
@@ -206,15 +197,16 @@ public:
const SdrPageView*GetPageView() const { return pSdrPageView; }
void MakeDrawView();
- // OD 29.08.2002 #102450#
// add 3rd parameter <const Color* pPageBackgrdColor> for setting this
// color as the background color at the outliner of the draw view
// for painting layers <hell> and <heaven>
- // OD 09.12.2002 #103045# - add 4th parameter for the horizontal text
+
+ // add 4th parameter for the horizontal text
// direction of the page in order to set the default horizontal text
// direction at the outliner of the draw view for painting layers <hell>
// and <heaven>.
- // OD 25.06.2003 #108784# - correct type of 1st parameter
+
+ // correct type of 1st parameter
void PaintLayer( const SdrLayerID _nLayerID,
SwPrintData const*const pPrintData,
const SwRect& _rRect,
@@ -223,8 +215,6 @@ public:
//wird als Link an die DrawEngine uebergeben, entscheidet was wie
//gepaintet wird oder nicht.
- //#110094#-3
- //DECL_LINK( PaintDispatcher, SdrPaintProcRec * );
// Interface Drawing
sal_Bool IsDragPossible( const Point &rPoint );
@@ -249,10 +239,8 @@ public:
void SetRestoreActions(sal_uInt16 nSet){nRestoreActions = nSet;}
sal_uInt16 GetRestoreActions() const{return nRestoreActions;}
- // OD 12.12.2002 #103492#
void InitPagePreviewLayout();
- // OD 12.12.2002 #103492#
inline SwPagePreviewLayout* PagePreviewLayout()
{
return mpPgPrevwLayout;
@@ -298,8 +286,7 @@ public:
const SwFlyFrm *pFollow );
// update data for accessible preview
- // OD 15.01.2003 #103492# - change method signature due to new page preview
- // functionality
+ // change method signature due to new page preview functionality
void UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
const SwPageFrm* _pSelectedPageFrm,
@@ -363,3 +350,4 @@ inline void SwViewImp::AddAccessibleObj( const SdrObject *pObj )
}
#endif // SW_VIEWIMP_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/visiturl.hxx b/sw/source/core/inc/visiturl.hxx
index a00921f76c82..b0d63c2baa9c 100644
--- a/sw/source/core/inc/visiturl.hxx
+++ b/sw/source/core/inc/visiturl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,13 +25,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+
#ifndef _VISITURL_HXX
#define _VISITURL_HXX
-
-
-
#include <svl/lstner.hxx>
+
class SwDoc;
class SwURLStateChanged : public SfxListener
@@ -43,7 +43,6 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
};
-
-
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index 7067d63a7adf..71e00c1c9e46 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef _WRONG_HXX
#define _WRONG_HXX
-#ifndef _COM_SUN_STAR_SMARTTAGS_XSMARTTAGPROPERTIES_HPP_
#include <com/sun/star/container/XStringKeyMap.hpp>
-#endif
#include <vector>
@@ -70,8 +69,8 @@ class SwWrongList
std::vector<SwWrongArea> maList;
WrongListType meType;
- xub_StrLen nBeginInvalid; // Start des ungueltigen Bereichs
- xub_StrLen nEndInvalid; // Ende des ungueltigen Bereichs
+ xub_StrLen nBeginInvalid; // Start of the invalid range
+ xub_StrLen nEndInvalid; // End of the invalid range
void ShiftLeft( xub_StrLen &rPos, xub_StrLen nStart, xub_StrLen nEnd )
{ if( rPos > nStart ) rPos = rPos > nEnd ? rPos - nEnd + nStart : nStart; }
@@ -164,3 +163,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 301c4a8372ec..880ae057dfb3 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,18 +39,18 @@
#include <tolayoutanchoredobjectposition.hxx>
#include <frmtool.hxx>
#include <fmtornt.hxx>
-// --> OD 2004-08-12 #i32795#
+// --> #i32795#
#include <txtfrm.hxx>
// <--
-// --> OD 2004-08-12 #i32795#
+// --> #i32795#
// template class <std::vector>
#include <vector>
// <--
-// --> OD 2004-08-10 #i28749#
+// --> #i28749#
#include <com/sun/star/text/PositionLayoutDir.hpp>
// <--
-// --> OD 2005-03-09 #i44559#
+// --> #i44559#
#include <ndtxt.hxx>
// <--
@@ -78,7 +79,7 @@ SwPosNotify::SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj ) :
mpAnchoredDrawObj( _pAnchoredDrawObj )
{
maOldObjRect = mpAnchoredDrawObj->GetObjRect();
- // --> OD 2004-10-20 #i35640# - determine correct page frame
+ // --> #i35640# - determine correct page frame
mpOldPageFrm = mpAnchoredDrawObj->GetPageFrm();
// <--
}
@@ -95,7 +96,7 @@ SwPosNotify::~SwPosNotify()
SwRect aNewObjRect( mpAnchoredDrawObj->GetObjRect() );
if( aNewObjRect.HasArea() )
{
- // --> OD 2004-10-20 #i35640# - determine correct page frame
+ // --> #i35640# - determine correct page frame
SwPageFrm* pNewPageFrm = mpAnchoredDrawObj->GetPageFrm();
// <--
if( pNewPageFrm )
@@ -105,9 +106,9 @@ SwPosNotify::~SwPosNotify()
::ClrContourCache( mpAnchoredDrawObj->GetDrawObj() );
- // --> OD 2004-10-20 #i35640# - additional notify anchor text frame
+ // --> #i35640# - additional notify anchor text frame
// Needed for negative positioned drawing objects
- // --> OD 2005-03-01 #i43255# - refine condition to avoid unneeded
+ // --> #i43255# - refine condition to avoid unneeded
// invalidations: anchored object had to be on the page of its anchor
// text frame.
if ( mpAnchoredDrawObj->GetAnchorFrm()->IsTxtFrm() &&
@@ -142,7 +143,7 @@ SwPosNotify::~SwPosNotify()
}
}
-// --> OD 2004-08-12 #i32795#
+// --> #i32795#
Point SwPosNotify::LastObjPos() const
{
return maOldObjRect.Pos();
@@ -150,7 +151,7 @@ Point SwPosNotify::LastObjPos() const
//<--
// ============================================================================
-// OD 2004-08-12 #i32795#
+// #i32795#
// helper class for oscillation control on object positioning
// ============================================================================
class SwObjPosOscillationControl
@@ -205,7 +206,7 @@ bool SwObjPosOscillationControl::OscillationDetected()
{
if ( *(pNewObjPos) == *(*aObjPosIter) )
{
- // position already occured -> oscillation
+ // position already occurred -> oscillation
bOscillationDetected = true;
delete pNewObjPos;
break;
@@ -228,14 +229,14 @@ TYPEINIT1(SwAnchoredDrawObject,SwAnchoredObject);
SwAnchoredDrawObject::SwAnchoredDrawObject() :
SwAnchoredObject(),
mbValidPos( false ),
- // --> OD 2004-09-29 #i34748#
+ // --> #i34748#
mpLastObjRect( 0L ),
// <--
mbNotYetAttachedToAnchorFrame( true ),
- // --> OD 2004-08-09 #i28749#
+ // --> #i28749#
mbNotYetPositioned( true ),
// <--
- // --> OD 2006-03-17 #i62875#
+ // --> #i62875#
mbCaptureAfterLayoutDirChange( false )
// <--
{
@@ -243,12 +244,12 @@ SwAnchoredDrawObject::SwAnchoredDrawObject() :
SwAnchoredDrawObject::~SwAnchoredDrawObject()
{
- // --> OD 2004-11-03 - follow-up of #i34748#
+ // --> follow-up of #i34748#
delete mpLastObjRect;
// <--
}
-// --> OD 2006-03-17 #i62875#
+// --> #i62875#
void SwAnchoredDrawObject::UpdateLayoutDir()
{
SwFrmFmt::tLayoutDir nOldLayoutDir( GetFrmFmt().GetLayoutDir() );
@@ -265,7 +266,7 @@ void SwAnchoredDrawObject::UpdateLayoutDir()
}
// <--
-// --> OD 2006-03-17 #i62875#
+// --> #i62875#
bool SwAnchoredDrawObject::IsOutsidePage() const
{
bool bOutsidePage( false );
@@ -282,7 +283,7 @@ bool SwAnchoredDrawObject::IsOutsidePage() const
// <--
// =============================================================================
-// OD 2004-03-25 #i26791# - implementation of pure virtual method declared in
+// #i26791# - implementation of pure virtual method declared in
// base class <SwAnchoredObject>
// =============================================================================
void SwAnchoredDrawObject::MakeObjPos()
@@ -299,11 +300,11 @@ void SwAnchoredDrawObject::MakeObjPos()
return;
}
- // --> OD 2004-08-09 #i28749# - anchored drawing object has to be attached
+ // --> #i28749# - anchored drawing object has to be attached
// to anchor frame
if ( mbNotYetAttachedToAnchorFrame )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredDrawObject::MakeObjPos() - drawing object not yet attached to anchor frame -> no positioning" );
return;
}
@@ -311,23 +312,22 @@ void SwAnchoredDrawObject::MakeObjPos()
SwDrawContact* pDrawContact =
static_cast<SwDrawContact*>(::GetUserCall( GetDrawObj() ));
- // --> OD 2004-08-09 #i28749# - if anchored drawing object hasn't been yet
+ // --> #i28749# - if anchored drawing object hasn't been yet
// positioned, convert its positioning attributes, if its positioning
// attributes are given in horizontal left-to-right layout.
- // --> OD 2004-10-25 #i36010# - Note: horizontal left-to-right layout is made
+ // --> #i36010# - Note: horizontal left-to-right layout is made
// the default layout direction for <SwDrawFrmFmt> instances. Thus, it has
// to be adjusted manually, if no adjustment of the positioning attributes
// have to be performed here.
- // --> OD 2004-11-17 #i35635# - additionally move drawing object to the
- // visible layer.
+ // --> #i35635# - additionally move drawing object to the visible layer.
if ( mbNotYetPositioned )
{
- // --> OD 2004-11-17 #i35635#
+ // --> #i35635#
pDrawContact->MoveObjToVisibleLayer( DrawObj() );
// <--
- // --> OD 2004-09-29 #117975# - perform conversion of positioning
+ // --> perform conversion of positioning
// attributes only for 'master' drawing objects
- // --> OD 2005-03-11 #i44334#, #i44681# - check, if positioning
+ // --> #i44334#, #i44681# - check, if positioning
// attributes already have been set.
if ( !GetDrawObj()->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawFrmFmt&>(GetFrmFmt()).IsPosAttrSet() )
@@ -335,7 +335,7 @@ void SwAnchoredDrawObject::MakeObjPos()
_SetPositioningAttr();
}
// <--
- // --> OD 2006-05-24 #b6418964#
+ // -->
// - reset internal flag after all needed actions are performed to
// avoid callbacks from drawing layer
mbNotYetPositioned = false;
@@ -361,7 +361,7 @@ void SwAnchoredDrawObject::MakeObjPos()
case FLY_AT_PARA:
case FLY_AT_CHAR:
{
- // --> OD 2004-08-12 #i32795# - move intrinsic positioning to
+ // --> #i32795# - move intrinsic positioning to
// helper method <_MakeObjPosAnchoredAtPara()>
_MakeObjPosAnchoredAtPara();
}
@@ -369,19 +369,19 @@ void SwAnchoredDrawObject::MakeObjPos()
case FLY_AT_PAGE:
case FLY_AT_FLY:
{
- // --> OD 2004-08-12 #i32795# - move intrinsic positioning to
+ // --> #i32795# - move intrinsic positioning to
// helper method <_MakeObjPosAnchoredAtLayout()>
_MakeObjPosAnchoredAtLayout();
}
break;
default:
{
- ASSERT( false, "<SwAnchoredDrawObject::MakeObjPos()> - unknown anchor type - please inform OD." );
+ OSL_ENSURE( false, "<SwAnchoredDrawObject::MakeObjPos()> - unknown anchor type - please inform OD." );
}
}
// keep, current object rectangle
- // --> OD 2004-09-29 #i34748# - use new method <SetLastObjRect(..)>
+ // --> #i34748# - use new method <SetLastObjRect(..)>
SetLastObjRect( GetObjRect().SVRect() );
// <--
@@ -396,7 +396,7 @@ void SwAnchoredDrawObject::MakeObjPos()
}
}
- // --> OD 2006-03-17 #i62875#
+ // --> #i62875#
if ( mbCaptureAfterLayoutDirChange &&
GetPageFrm() )
{
@@ -423,22 +423,22 @@ void SwAnchoredDrawObject::MakeObjPos()
/** method for the intrinsic positioning of a at-paragraph|at-character
anchored drawing object
- OD 2004-08-12 #i32795# - helper method for method <MakeObjPos>
+ #i32795# - helper method for method <MakeObjPos>
@author OD
*/
void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
{
- // --> OD 2004-08-12 #i32795# - adopt positioning algorithm from Writer
+ // --> #i32795# - adopt positioning algorithm from Writer
// fly frames, which are anchored at paragraph|at character
// Determine, if anchor frame can/has to be formatted.
// If yes, after each object positioning the anchor frame is formatted.
// If after the anchor frame format the object position isn't valid, the
// object is positioned again.
- // --> OD 2005-02-22 #i43255# - refine condition: anchor frame format not
+ // --> #i43255# - refine condition: anchor frame format not
// allowed, if another anchored object, has to be consider its wrap influence
- // --> OD 2005-06-07 #i50356# - format anchor frame containing the anchor
+ // --> #i50356# - format anchor frame containing the anchor
// position. E.g., for at-character anchored object this can be the follow
// frame of the anchor frame, which contains the anchor character.
const bool bFormatAnchor =
@@ -449,14 +449,14 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
if ( bFormatAnchor )
{
- // --> OD 2005-06-07 #i50356#
+ // --> #i50356#
GetAnchorFrmContainingAnchPos()->Calc();
// <--
}
bool bOscillationDetected = false;
SwObjPosOscillationControl aObjPosOscCtrl( *this );
- // --> OD 2004-08-25 #i3317# - boolean, to apply temporarly the
+ // --> #i3317# - boolean, to apply temporarly the
// 'straightforward positioning process' for the frame due to its
// overlapping with a previous column.
bool bConsiderWrapInfluenceDueToOverlapPrevCol( false );
@@ -465,7 +465,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
// indicate that position will be valid after positioning is performed
mbValidPos = true;
- // --> OD 2004-10-20 #i35640# - correct scope for <SwPosNotify> instance
+ // --> #i35640# - correct scope for <SwPosNotify> instance
{
// create instance of <SwPosNotify> for correct notification
SwPosNotify aPosNotify( this );
@@ -491,12 +491,12 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
// to be invalid.
if ( bFormatAnchor )
{
- // --> OD 2005-06-07 #i50356#
+ // --> #i50356#
GetAnchorFrmContainingAnchPos()->Calc();
// <--
}
- // --> OD 2004-08-25 #i3317#
+ // --> #i3317#
if ( !ConsiderObjWrapInfluenceOnObjPos() &&
OverlapsPrevColumn() )
{
@@ -506,7 +506,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
} while ( !mbValidPos && !bOscillationDetected &&
!bConsiderWrapInfluenceDueToOverlapPrevCol );
- // --> OD 2004-08-25 #i3317# - consider a detected oscillation and overlapping
+ // --> #i3317# - consider a detected oscillation and overlapping
// with previous column.
// temporarly consider the anchored objects wrapping style influence
if ( bOscillationDetected || bConsiderWrapInfluenceDueToOverlapPrevCol )
@@ -520,7 +520,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
/** method for the intrinsic positioning of a at-page|at-frame anchored
drawing object
- OD 2004-08-12 #i32795# - helper method for method <MakeObjPos>
+ #i32795# - helper method for method <MakeObjPos>
@author OD
*/
@@ -539,14 +539,14 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtLayout()
// set position
- // --> OD 2004-07-29 #i31698#
- // --> OD 2004-10-18 #i34995# - setting anchor position needed for filters,
+ // --> #i31698#
+ // --> #i34995# - setting anchor position needed for filters,
// especially for the xml-filter to the OpenOffice.org file format
{
const Point aNewAnchorPos =
GetAnchorFrm()->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
DrawObj()->SetAnchorPos( aNewAnchorPos );
- // --> OD 2006-10-05 #i70122# - missing invalidation
+ // --> #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
// <--
}
@@ -563,7 +563,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtLayout()
void SwAnchoredDrawObject::_SetDrawObjAnchor()
{
// new anchor position
- // --> OD 2004-07-29 #i31698# -
+ // --> #i31698# -
Point aNewAnchorPos =
GetAnchorFrm()->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
Point aCurrAnchorPos = GetDrawObj()->GetAnchorPos();
@@ -576,7 +576,7 @@ void SwAnchoredDrawObject::_SetDrawObjAnchor()
DrawObj()->SetAnchorPos( aNewAnchorPos );
// correct object position, caused by setting new anchor position
DrawObj()->Move( aMove );
- // --> OD 2006-10-05 #i70122# - missing invalidation
+ // --> #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
// <--
}
@@ -584,7 +584,7 @@ void SwAnchoredDrawObject::_SetDrawObjAnchor()
/** method to invalidate the given page frame
- OD 2004-07-02 #i28701#
+ #i28701#
@author OD
*/
@@ -594,7 +594,7 @@ void SwAnchoredDrawObject::_InvalidatePage( SwPageFrm* _pPageFrm )
{
if ( _pPageFrm->GetUpper() )
{
- // --> OD 2004-11-11 #i35007# - correct invalidation for as-character
+ // --> #i35007# - correct invalidation for as-character
// anchored objects.
if ( GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR )
{
@@ -621,21 +621,21 @@ void SwAnchoredDrawObject::_InvalidatePage( SwPageFrm* _pPageFrm )
void SwAnchoredDrawObject::InvalidateObjPos()
{
- // --> OD 2004-07-01 #i28701# - check, if invalidation is allowed
+ // --> #i28701# - check, if invalidation is allowed
if ( mbValidPos &&
InvalidationOfPosAllowed() )
{
mbValidPos = false;
- // --> OD 2006-08-10 #i68520#
+ // --> #i68520#
InvalidateObjRectWithSpaces();
// <--
- // --> OD 2005-03-08 #i44339# - check, if anchor frame exists.
+ // --> #i44339# - check, if anchor frame exists.
if ( GetAnchorFrm() )
{
- // --> OD 2004-11-22 #118547# - notify anchor frame of as-character
+ // --> #118547# - notify anchor frame of as-character
// anchored object, because its positioned by the format of its anchor frame.
- // --> OD 2005-03-09 #i44559# - assure, that text hint is already
+ // --> #i44559# - assure, that text hint is already
// existing in the text frame
if ( GetAnchorFrm()->ISA(SwTxtFrm) &&
(GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR) )
@@ -652,7 +652,7 @@ void SwAnchoredDrawObject::InvalidateObjPos()
SwPageFrm* pPageFrm = AnchorFrm()->FindPageFrm();
_InvalidatePage( pPageFrm );
- // --> OD 2004-08-12 #i32270# - also invalidate page frame, at which the
+ // --> #i32270# - also invalidate page frame, at which the
// drawing object is registered at.
SwPageFrm* pPageFrmRegisteredAt = GetPageFrm();
if ( pPageFrmRegisteredAt &&
@@ -661,7 +661,7 @@ void SwAnchoredDrawObject::InvalidateObjPos()
_InvalidatePage( pPageFrmRegisteredAt );
}
// <--
- // --> OD 2004-09-23 #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = FindPageFrmOfAnchor();
@@ -679,13 +679,13 @@ void SwAnchoredDrawObject::InvalidateObjPos()
SwFrmFmt& SwAnchoredDrawObject::GetFrmFmt()
{
- ASSERT( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
+ OSL_ENSURE( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
"<SwAnchoredDrawObject::GetFrmFmt()> - missing frame format -> crash." );
return *(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt());
}
const SwFrmFmt& SwAnchoredDrawObject::GetFrmFmt() const
{
- ASSERT( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
+ OSL_ENSURE( static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt(),
"<SwAnchoredDrawObject::GetFrmFmt()> - missing frame format -> crash." );
return *(static_cast<SwDrawContact*>(GetUserCall(GetDrawObj()))->GetFmt());
}
@@ -697,14 +697,14 @@ const SwRect SwAnchoredDrawObject::GetObjRect() const
return GetDrawObj()->GetSnapRect();
}
-// --> OD 2006-10-05 #i70122#
+// --> #i70122#
const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
{
return GetDrawObj()->GetCurrentBoundRect();
}
// <--
-// --> OD 2006-08-10 #i68520#
+// --> #i68520#
bool SwAnchoredDrawObject::_SetObjTop( const SwTwips _nTop )
{
SwTwips nDiff = _nTop - GetObjRect().Top();
@@ -723,7 +723,7 @@ bool SwAnchoredDrawObject::_SetObjLeft( const SwTwips _nLeft )
/** adjust positioning and alignment attributes for new anchor frame
- OD 2004-08-24 #i33313# - add second optional parameter <_pNewObjRect>
+ #i33313# - add second optional parameter <_pNewObjRect>
@author OD
*/
@@ -733,7 +733,7 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrm* _pNewAnchorFrm,
SwTwips nHoriRelPos = 0;
SwTwips nVertRelPos = 0;
const Point aAnchorPos = _pNewAnchorFrm->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
- // --> OD 2004-08-24 #i33313#
+ // --> #i33313#
const SwRect aObjRect( _pNewObjRect ? *_pNewObjRect : GetObjRect() );
// <--
const bool bVert = _pNewAnchorFrm->IsVertical();
@@ -758,14 +758,14 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrm* _pNewAnchorFrm,
GetFrmFmt().SetFmtAttr( SwFmtVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
}
-// --> OD 2004-09-29 #i34748# - change return type
+// --> #i34748# - change return type
const Rectangle* SwAnchoredDrawObject::GetLastObjRect() const
{
return mpLastObjRect;
}
// <--
-// --> OD 2004-09-29 #i34748# - change return type.
+// --> #i34748# - change return type.
// If member <mpLastObjRect> is NULL, create one.
void SwAnchoredDrawObject::SetLastObjRect( const Rectangle& _rNewLastRect )
{
@@ -779,7 +779,7 @@ void SwAnchoredDrawObject::SetLastObjRect( const Rectangle& _rNewLastRect )
void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame()
{
- // --> OD 2004-07-27 #i31698#
+ // --> #i31698#
SwAnchoredObject::ObjectAttachedToAnchorFrame();
// <--
@@ -791,7 +791,7 @@ void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame()
/** method to set positioning attributes
- OD 2004-10-20 #i35798#
+ #i35798#
During load the positioning attributes aren't set.
Thus, the positioning attributes are set by the current object geometry.
This method is also used for the conversion for drawing objects
@@ -811,7 +811,7 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
SwTwips nHoriPos = aObjRect.Left();
SwTwips nVertPos = aObjRect.Top();
- // --> OD 2005-03-10 #i44334#, #i44681#
+ // --> #i44334#, #i44681#
// perform conversion only if position is in horizontal-left-to-right-layout.
if ( GetFrmFmt().GetPositionLayoutDir() ==
text::PositionLayoutDir::PositionInHoriL2R )
@@ -837,38 +837,32 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredDrawObject::_SetPositioningAttr()> - unsupported layout direction" );
}
}
}
// <--
- // --> OD 2006-11-10 #i71182#
+ // --> #i71182#
// only change position - do not lose other attributes
SwFmtHoriOrient aHori( GetFrmFmt().GetHoriOrient() );
aHori.SetPos( nHoriPos );
GetFrmFmt().SetFmtAttr( aHori );
SwFmtVertOrient aVert( GetFrmFmt().GetVertOrient() );
- // --> OD 2007-01-03 #i73079# - vertical position already correct
-// if ( aVert.GetRelationOrient() == text::RelOrientation::CHAR ||
-// aVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
-// {
-// nVertPos = -nVertPos;
-// }
- // <--
+
aVert.SetPos( nVertPos );
GetFrmFmt().SetFmtAttr( aVert );
// <--
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // --> #i36010# - set layout direction of the position
GetFrmFmt().SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
// <--
}
- // --> OD 2007-11-29 #i65798# - also for as-character anchored objects
- // --> OD 2005-05-10 #i45952# - indicate that position
+ // --> #i65798# - also for as-character anchored objects
+ // --> #i45952# - indicate that position
// attributes are set now.
static_cast<SwDrawFrmFmt&>(GetFrmFmt()).PosAttrSet();
// <--
@@ -884,7 +878,7 @@ void SwAnchoredDrawObject::NotifyBackground( SwPageFrm* _pPageFrm,
/** method to assure that anchored object is registered at the correct
page frame
- OD 2004-07-02 #i28701#
+ #i28701#
@author OD
*/
@@ -904,3 +898,5 @@ void SwAnchoredDrawObject::RegisterAtCorrectPage()
}
// =============================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index d6443027e3ad..c7a035c2de9a 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
-// --> OD 2004-06-29 #i28701#
+// --> #i28701#
#include <doc.hxx>
#include <fmtsrnd.hxx>
#include <svx/svdobj.hxx>
@@ -45,10 +46,10 @@
#include <pagefrm.hxx>
// <--
#include <frmatr.hxx>
-// --> OD 2004-08-25 #i3317#
+// --> #i3317#
#include <colfrm.hxx>
// <--
-// --> OD 2004-10-22 #i35911#
+// --> #i35911#
#include <layouter.hxx>
@@ -57,28 +58,28 @@ using namespace ::com::sun::star;
// <--
// ============================================================================
-// --> OD 2004-06-30 #i28701# -
+// --> #i28701# -
// implementation of helper class <SwObjPositioningInProgress>
// ============================================================================
SwObjPositioningInProgress::SwObjPositioningInProgress( SdrObject& _rSdrObj ) :
mpAnchoredObj( 0L ),
- // --> OD 2005-08-09 #i52904#
+ // --> #i52904#
mbOldObjPositioningInProgress( false )
// <--
{
mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
- // --> OD 2005-08-09 #i52904#
+ // --> #i52904#
mbOldObjPositioningInProgress = mpAnchoredObj->IsPositioningInProgress();
// <--
mpAnchoredObj->SetPositioningInProgress( true );
}
SwObjPositioningInProgress::SwObjPositioningInProgress( SwAnchoredObject& _rAnchoredObj ) :
mpAnchoredObj( &_rAnchoredObj ),
- // --> OD 2005-08-09 #i52904#
+ // --> #i52904#
mbOldObjPositioningInProgress( false )
// <--
{
- // --> OD 2005-08-09 #i52904#
+ // --> #i52904#
mbOldObjPositioningInProgress = mpAnchoredObj->IsPositioningInProgress();
// <--
mpAnchoredObj->SetPositioningInProgress( true );
@@ -88,7 +89,7 @@ SwObjPositioningInProgress::~SwObjPositioningInProgress()
{
if ( mpAnchoredObj )
{
- // --> OD 2005-08-09 #i52904#
+ // --> #i52904#
mpAnchoredObj->SetPositioningInProgress( mbOldObjPositioningInProgress );
// <--
}
@@ -101,29 +102,29 @@ TYPEINIT0(SwAnchoredObject);
SwAnchoredObject::SwAnchoredObject() :
mpDrawObj( 0L ),
mpAnchorFrm( 0L ),
- // --> OD 2004-06-30 #i28701#
+ // --> #i28701#
mpPageFrm( 0L ),
// <--
maRelPos(),
maLastCharRect(),
mnLastTopOfLine( 0L ),
mpVertPosOrientFrm( 0L ),
- // --> OD 2004-06-29 #i28701#
+ // --> #i28701#
mbPositioningInProgress( false ),
mbConsiderForTextWrap( false ),
mbPositionLocked( false ),
- // --> OD 2005-01-10 #i40147#
+ // --> #i40147#
mbKeepPositionLockedForSection( false ),
// <--
mbRestartLayoutProcess( false ),
// <--
- // --> OD 2004-10-22 #i35911#
+ // --> #i35911#
mbClearedEnvironment( false ),
// <--
- // --> OD 2004-08-25 #i3317#
+ // --> #i3317#
mbTmpConsiderWrapInfluence( false ),
// <--
- // --> OD 2006-08-10 #i68520#
+ // --> #i68520#
maObjRectWithSpaces(),
mbObjRectWithSpacesValid( false ),
maLastObjRect()
@@ -178,7 +179,7 @@ void SwAnchoredObject::ChgAnchorFrm( SwFrm* _pNewAnchorFrm )
/** determine anchor frame containing the anchor position
- OD 2004-10-08 #i26945#
+ #i26945#
the anchor frame, which is determined, is <mpAnchorFrm>
for an at-page, at-frame or at-paragraph anchored object
and the anchor character frame for an at-character and as-character
@@ -198,7 +199,7 @@ SwFrm* SwAnchoredObject::GetAnchorFrmContainingAnchPos()
}
// =============================================================================
-// OD 2004-06-30 #i28701# accessors for member <mpPageFrm>
+// #i28701# accessors for member <mpPageFrm>
// =============================================================================
SwPageFrm* SwAnchoredObject::GetPageFrm()
{
@@ -212,7 +213,6 @@ const SwPageFrm* SwAnchoredObject::GetPageFrm() const
void SwAnchoredObject::SetPageFrm( SwPageFrm* _pNewPageFrm )
{
- // --> OD 2006-01-02 #125977#
if ( mpPageFrm != _pNewPageFrm )
{
// clear member, which denotes the layout frame at which the vertical
@@ -227,7 +227,6 @@ void SwAnchoredObject::SetPageFrm( SwPageFrm* _pNewPageFrm )
// assign new page frame
mpPageFrm = _pNewPageFrm;
}
- // <--
}
// =============================================================================
@@ -278,7 +277,7 @@ SwTwips SwAnchoredObject::GetLastTopOfLine() const
return mnLastTopOfLine;
}
-// OD 2004-05-18 #i28701# - follow-up of #i22341#
+// #i28701# - follow-up of #i22341#
void SwAnchoredObject::AddLastTopOfLineY( SwTwips _nDiff )
{
mnLastTopOfLine += _nDiff;
@@ -286,12 +285,12 @@ void SwAnchoredObject::AddLastTopOfLineY( SwTwips _nDiff )
/** check anchor character rectangle and top of line
- OD 2004-03-24 #i26791
+ #i26791
For to-character anchored Writer fly frames the members <maLastCharRect>
and <maLastTopOfLine> are updated. These are checked for change and
depending on the applied positioning, it's decided, if the Writer fly
frame has to be invalidated.
- OD 2004-07-15 #117380#
+
add parameter <_bCheckForParaPorInf>, default value <true>
@author OD
@@ -306,13 +305,13 @@ void SwAnchoredObject::CheckCharRectAndTopOfLine(
if ( (rAnch.GetAnchorId() == FLY_AT_CHAR) &&
rAnch.GetCntntAnchor() )
{
- // --> OD 2004-07-14 #117380# - if requested, assure that anchor frame,
+ // --> if requested, assure that anchor frame,
// which contains the anchor character, has a paragraph portion information.
// The paragraph portion information is needed to determine the
// anchor character rectangle respectively the top of the line.
// Thus, a format of this frame is avoided to determine the
// paragraph portion information.
- // --> OD 2004-10-04 #i26945# - use new method <FindAnchorCharFrm()>
+ // --> #i26945# - use new method <FindAnchorCharFrm()>
const SwTxtFrm& aAnchorCharFrm = *(FindAnchorCharFrm());
// <--
if ( !_bCheckForParaPorInf || aAnchorCharFrm.HasPara() )
@@ -327,12 +326,12 @@ void SwAnchoredObject::CheckCharRectAndTopOfLine(
/** check anchor character rectangle
- OD 11.11.2003 #i22341#
+ #i22341#
helper method for method <CheckCharRectAndTopOfLine()>
For to-character anchored Writer fly frames the member <maLastCharRect>
is updated. This is checked for change and depending on the applied
positioning, it's decided, if the Writer fly frame has to be invalidated.
- OD 2004-07-14 #117380#
+
improvement - add second parameter <_rAnchorCharFrm>
@author OD
@@ -357,7 +356,7 @@ void SwAnchoredObject::_CheckCharRect( const SwFmtAnchor& _rAnch,
SwFmtHoriOrient aHori( GetFrmFmt().GetHoriOrient() );
// check for anchor character rectangle changes for certain
// positionings and alignments
- // OD 07.10.2003 #110978# - add condition to invalidate position,
+ // add condition to invalidate position,
// if vertical aligned at frame/page area and vertical position
// of anchor character has changed.
const sal_Int16 eVertRelOrient = aVert.GetRelationOrient();
@@ -376,7 +375,7 @@ void SwAnchoredObject::_CheckCharRect( const SwFmtAnchor& _rAnch,
( (aCharRect.*fnRect->fnGetTop)() !=
(maLastCharRect.*fnRect->fnGetTop)() ) ) )
{
- // --> OD 2004-10-08 #i26945#, #i35911# - unlock position of
+ // --> #i26945#, #i35911# - unlock position of
// anchored object, if it isn't registered at the page,
// where its anchor character frame is on.
if ( GetPageFrm() != _rAnchorCharFrm.FindPageFrm() )
@@ -394,12 +393,12 @@ void SwAnchoredObject::_CheckCharRect( const SwFmtAnchor& _rAnch,
/** check top of line
- OD 11.11.2003 #i22341#
+ #i22341#
helper method for method <CheckCharRectAndTopOfLine()>
For to-character anchored Writer fly frames the member <mnLastTopOfLine>
is updated. This is checked for change and depending on the applied
positioning, it's decided, if the Writer fly frame has to be invalidated.
- OD 2004-07-14 #117380#
+
improvement - add second parameter <_rAnchorCharFrm>
@author OD
@@ -415,7 +414,7 @@ void SwAnchoredObject::_CheckTopOfLine( const SwFmtAnchor& _rAnch,
// check alignment for invalidation of position
if ( GetFrmFmt().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
{
- // --> OD 2004-10-08 #i26945#, #i35911# - unlock position of
+ // --> #i26945#, #i35911# - unlock position of
// anchored object, if it isn't registered at the page,
// where its anchor character frame is on.
if ( GetPageFrm() != _rAnchorCharFrm.FindPageFrm() )
@@ -456,7 +455,7 @@ void SwAnchoredObject::ObjectAttachedToAnchorFrame()
/** method update layout direction the layout direction, the anchored
object is in
- OD 2004-07-27 #i31698#
+ #i31698#
method has typically to be called, if the anchored object gets its
anchor frame assigned.
@@ -486,7 +485,7 @@ void SwAnchoredObject::UpdateLayoutDir()
objects, for whose the wrapping style influence has to be considered
on the object positioning.
- OD 2004-06-30 #i28701#
+ #i28701#
@author OD
*/
@@ -512,7 +511,7 @@ void SwAnchoredObject::InvalidateObjPosForConsiderWrapInfluence(
/** method to determine, if wrapping style influence of the anchored
object has to be considered on the object positioning
- OD 2004-06-30 #i28701#
+ #i28701#
Note: result of this method also decides, if the booleans for the
layout process are of relevance.
@@ -524,8 +523,8 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const
const SwFrmFmt& rObjFmt = GetFrmFmt();
- // --> OD 2004-08-25 #i3317# - add condition <IsTmpConsiderWrapInfluence()>
- // --> OD 2005-09-29 #i55204#
+ // --> #i3317# - add condition <IsTmpConsiderWrapInfluence()>
+ // --> #i55204#
// - correction: wrapping style influence has been considered, if condition
// <IsTmpConsiderWrapInfluence()> is hold, regardless of its anchor type
// or its wrapping style.
@@ -541,7 +540,7 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const
(rAnchor.GetAnchorId() == FLY_AT_PARA)) &&
rObjFmt.GetSurround().GetSurround() != SURROUND_THROUGHT )
{
- // --> OD 2004-09-23 #i34520# - text also wraps around anchored
+ // --> #i34520# - text also wraps around anchored
// objects in the layer Hell - see the text formatting.
// Thus, it hasn't to be checked here.
bRet = true;
@@ -555,7 +554,7 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const
/** method to determine, if other anchored objects, also attached at
to the anchor frame, have to consider its wrap influence.
- // --> OD 2005-02-22 #i43255#
+ // --> #i43255#
@author OD
*/
@@ -583,7 +582,7 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOfOtherObjs() const
}
// =============================================================================
-// --> OD 2004-06-29 #i28701# - accessors to booleans for layout process
+// --> #i28701# - accessors to booleans for layout process
// =============================================================================
bool SwAnchoredObject::ConsiderForTextWrap() const
{
@@ -619,7 +618,7 @@ void SwAnchoredObject::SetRestartLayoutProcess( const bool _bRestartLayoutProces
mbRestartLayoutProcess = _bRestartLayoutProcess;
}
-// --> OD 2004-10-22 #i35911#
+// --> #i35911#
bool SwAnchoredObject::ClearedEnvironment() const
{
if ( ConsiderObjWrapInfluenceOnObjPos() )
@@ -636,7 +635,7 @@ void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
/** method to determine, if due to anchored object size and wrapping
style, its layout environment is cleared.
- OD 2004-10-22 #i35911#
+ #i35911#
@author OD
*/
@@ -644,8 +643,8 @@ bool SwAnchoredObject::HasClearedEnvironment() const
{
bool bHasClearedEnvironment( false );
- // --> OD 2005-03-03 #i43913# - layout frame, vertical position is orient at, has to be set.
- ASSERT( GetVertPosOrientFrm(),
+ // --> #i43913# - layout frame, vertical position is orient at, has to be set.
+ OSL_ENSURE( GetVertPosOrientFrm(),
"<SwAnchoredObject::HasClearedEnvironment()> - layout frame missing, at which the vertical position is oriented at." );
if ( GetVertPosOrientFrm() &&
GetAnchorFrm()->IsTxtFrm() &&
@@ -680,8 +679,8 @@ bool SwAnchoredObject::HasClearedEnvironment() const
/** method to add spacing to object area
- OD 2004-06-30 #i28701#
- OD 2006-08-10 #i68520# - return constant reference and use cache
+ #i28701#
+ #i68520# - return constant reference and use cache
@author OD
*/
@@ -690,13 +689,13 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const
if ( mbObjRectWithSpacesValid &&
maLastObjRect != GetObjRect() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObject::GetObjRectWithSpaces> - cache for object rectangle inclusive spaces marked as valid, but it couldn't be. Missing invalidation of cache. Please inform OD." );
InvalidateObjRectWithSpaces();
}
if ( !mbObjRectWithSpacesValid )
{
- // --> OD 2006-10-05 #i70122# - correction:
+ // --> #i70122# - correction:
// use bounding rectangle of anchored objects.
// maObjRectWithSpaces = GetObjRect();
maObjRectWithSpaces = GetObjBoundRect();
@@ -718,7 +717,7 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const
return maObjRectWithSpaces;
}
-// --> OD 2006-08-10 #i68520#
+// --> #i68520#
void SwAnchoredObject::SetObjTop( const SwTwips _nTop)
{
const bool bTopChanged( _SetObjTop( _nTop ) );
@@ -740,7 +739,7 @@ void SwAnchoredObject::SetObjLeft( const SwTwips _nLeft)
/** method to update anchored object in the <SwSortedObjs> lists
- OD 2004-07-01 #i28701#
+ #i28701#
If document compatibility option 'Consider wrapping style influence
on object positioning' is ON, additionally all anchored objects
at the anchor frame and all following anchored objects on the page
@@ -798,13 +797,13 @@ void SwAnchoredObject::UpdateObjInSortedList()
/** method to determine, if invalidation of position is allowed
- OD 2004-07-01 #i28701#
+ #i28701#
@author OD
*/
bool SwAnchoredObject::InvalidationOfPosAllowed() const
{
- // --> OD 2004-11-03 #114798# - Check, if page frame layout is in progress,
+ // --> Check, if page frame layout is in progress,
// isn't needed, because of anchored object, whose are moved forward.
return !PositionLocked();
// <--
@@ -813,8 +812,8 @@ bool SwAnchoredObject::InvalidationOfPosAllowed() const
/** method to determine the page frame, on which the 'anchor' of
the given anchored object is.
- OD 2004-07-02 #i28701#
- OD 2004-09-23 #i33751#, #i34060#
+ #i28701#
+ #i33751#, #i34060#
Adjust meaning of method and thus its name: If the anchored object
or its anchor isn't correctly inserted in the layout, no page frame
can be found. Thus, the return type changed to be a pointer and can
@@ -826,10 +825,10 @@ SwPageFrm* SwAnchoredObject::FindPageFrmOfAnchor()
{
SwPageFrm* pRetPageFrm = 0L;
- // --> OD 2005-03-08 #i44339# - check, if anchor frame exists.
+ // --> #i44339# - check, if anchor frame exists.
if ( mpAnchorFrm )
{
- // --> OD 2004-10-08 #i26945# - use new method <GetAnchorFrmContainingAnchPos()>
+ // --> #i26945# - use new method <GetAnchorFrmContainingAnchPos()>
pRetPageFrm = GetAnchorFrmContainingAnchPos()->FindPageFrm();
// <--
}
@@ -840,7 +839,7 @@ SwPageFrm* SwAnchoredObject::FindPageFrmOfAnchor()
/** get frame, which contains the anchor character, if the object
is anchored at-character or as-character.
- OD 2004-10-04 #i26945#
+ #i26945#
@author OD
@@ -852,7 +851,7 @@ SwTxtFrm* SwAnchoredObject::FindAnchorCharFrm()
{
SwTxtFrm* pAnchorCharFrm( 0L );
- // --> OD 2005-03-08 #i44339# - check, if anchor frame exists.
+ // --> #i44339# - check, if anchor frame exists.
if ( mpAnchorFrm )
{
const SwFmtAnchor& rAnch = GetFrmFmt().GetAnchor();
@@ -870,7 +869,7 @@ SwTxtFrm* SwAnchoredObject::FindAnchorCharFrm()
/** method to determine, if a format on the anchored object is possible
- OD 2004-07-23 #i28701#
+ #i28701#
A format is possible, if anchored object is in an invisible layer.
Note: method is virtual to refine the conditions for the sub-classes.
@@ -881,11 +880,11 @@ bool SwAnchoredObject::IsFormatPossible() const
return GetFrmFmt().GetDoc()->IsVisibleLayerId( GetDrawObj()->GetLayer() );
}
-// --> OD 2004-08-25 #i3317#
+// --> #i3317#
void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence )
{
mbTmpConsiderWrapInfluence = _bTmpConsiderWrapInfluence;
- // --> OD 2004-10-22 #i35911#
+ // --> #i35911#
if ( mbTmpConsiderWrapInfluence )
{
SwLayouter::InsertObjForTmpConsiderWrapInfluence( *(GetFrmFmt().GetDoc()),
@@ -900,7 +899,6 @@ bool SwAnchoredObject::IsTmpConsiderWrapInfluence() const
}
// <--
-// --> OD 2006-07-24 #b6449874#
void SwAnchoredObject::SetTmpConsiderWrapInfluenceOfOtherObjs( const bool bTmpConsiderWrapInfluence )
{
const SwSortedObjs* pObjs = GetAnchorFrm()->GetDrawObjs();
@@ -917,12 +915,11 @@ void SwAnchoredObject::SetTmpConsiderWrapInfluenceOfOtherObjs( const bool bTmpCo
}
}
}
-// <--
/** method to determine, if the anchored object is overlapping with a
previous column
- OD 2004-08-25 #i3317#
+ #i3317#
overlapping with a previous column means, that the object overlaps
with a column, which is a previous one of the column its anchor
frame is in.
@@ -956,7 +953,7 @@ bool SwAnchoredObject::OverlapsPrevColumn() const
/** method to determine position of anchored object relative to
anchor frame
- OD 2005-01-06 #i30669#
+ #i30669#
Usage: Needed layout information for WW8 export
@author OD
@@ -965,7 +962,7 @@ Point SwAnchoredObject::GetRelPosToAnchorFrm() const
{
Point aRelPos;
- ASSERT( GetAnchorFrm(),
+ OSL_ENSURE( GetAnchorFrm(),
"<SwAnchoredObject::GetRelPosToAnchorFrm()> - missing anchor frame." );
aRelPos = GetObjRect().Pos();
aRelPos -= GetAnchorFrm()->Frm().Pos();
@@ -976,9 +973,9 @@ Point SwAnchoredObject::GetRelPosToAnchorFrm() const
/** method to determine position of anchored object relative to
page frame
- OD 2005-01-06 #i30669#
+ #i30669#
Usage: Needed layout information for WW8 export
- OD 2005-01-27 #i33818# - add parameters <_bFollowTextFlow> and
+ #i33818# - add parameters <_bFollowTextFlow> and
<_obRelToTableCell>
If <_bFollowTextFlow> is set and object is anchored inside table,
the position relative to the table cell is determined. Output
@@ -992,13 +989,13 @@ Point SwAnchoredObject::GetRelPosToPageFrm( const bool _bFollowTextFlow,
Point aRelPos;
_obRelToTableCell = false;
- ASSERT( GetAnchorFrm(),
+ OSL_ENSURE( GetAnchorFrm(),
"<SwAnchoredObject::GetRelPosToPageFrm()> - missing anchor frame." );
- ASSERT( GetAnchorFrm()->FindPageFrm(),
+ OSL_ENSURE( GetAnchorFrm()->FindPageFrm(),
"<SwAnchoredObject::GetRelPosToPageFrm()> - missing page frame." );
aRelPos = GetObjRect().Pos();
- // --> OD 2005-01-27 #i33818# - search for cell frame, if object has to
+ // --> #i33818# - search for cell frame, if object has to
// follow the text flow.
const SwFrm* pFrm( 0L );
if ( _bFollowTextFlow && !GetAnchorFrm()->IsPageFrm() )
@@ -1030,7 +1027,7 @@ Point SwAnchoredObject::GetRelPosToPageFrm( const bool _bFollowTextFlow,
/** method to determine position of anchored object relative to
anchor character
- OD 2005-01-06 #i30669#
+ #i30669#
Usage: Needed layout information for WW8 export
@author OD
@@ -1048,7 +1045,7 @@ Point SwAnchoredObject::GetRelPosToChar() const
/** method to determine position of anchored object relative to
top of line
- OD 2005-01-06 #i30669#
+ #i30669#
Usage: Needed layout information for WW8 export
@author OD
@@ -1062,3 +1059,5 @@ Point SwAnchoredObject::GetRelPosToLine() const
return aRelPos;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index e56c34c4bff1..765137f8a26f 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,7 +129,7 @@ TYPEINIT2(SwFmtFooter, SfxPoolItem, SwClient );
TYPEINIT2(SwFmtPageDesc, SfxPoolItem, SwClient );
TYPEINIT1_AUTOFACTORY(SwFmtLineNumber, SfxPoolItem);
-/* -----------------19.05.98 09:26-------------------
+/* --------------------------------------------------
* Umwandlung fuer QueryValue
* --------------------------------------------------*/
sal_Int16 lcl_RelToINT(sal_Int16 eRelation)
@@ -245,7 +246,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
// abschalten! (Bug 31069)
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
- ASSERT( pNode, "Ein grosses Problem." );
+ OSL_ENSURE( pNode, "Ein grosses Problem." );
pDoc->DeleteSection( pNode );
}
delete pFmt;
@@ -276,7 +277,7 @@ SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
int SwFmtFrmSize::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return( eFrmHeightType == ((SwFmtFrmSize&)rAttr).eFrmHeightType &&
eFrmWidthType == ((SwFmtFrmSize&)rAttr).eFrmWidthType &&
aSize == ((SwFmtFrmSize&)rAttr).GetSize()&&
@@ -289,11 +290,7 @@ SfxPoolItem* SwFmtFrmSize::Clone( SfxItemPool* ) const
return new SwFmtFrmSize( *this );
}
-
-/* -----------------24.04.98 11:36-------------------
- *
- * --------------------------------------------------*/
-sal_Bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -348,24 +345,21 @@ sal_Bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= (sal_Int16)GetWidthSizeType();
break;
}
- return sal_True;
+ return true;
}
-/* -----------------24.04.98 11:36-------------------
- *
- * --------------------------------------------------*/
-sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_FRMSIZE_SIZE:
{
awt::Size aVal;
if(!(rVal >>= aVal))
- bRet = sal_False;
+ bRet = false;
else
{
Size aTmp(aVal.Width, aVal.Height);
@@ -377,7 +371,7 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(aTmp.Height() && aTmp.Width())
aSize = aTmp;
else
- bRet = sal_False;
+ bRet = false;
}
}
break;
@@ -388,7 +382,7 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(nSet >= 0 && nSet <= 0xfe)
SetHeightPercent((sal_uInt8)nSet);
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_FRMSIZE_REL_WIDTH:
@@ -398,7 +392,7 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(nSet >= 0 && nSet <= 0xfe)
SetWidthPercent((sal_uInt8)nSet);
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH:
@@ -446,7 +440,7 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
aSize.Height() = nHg;
}
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_FRMSIZE_SIZE_TYPE:
@@ -457,7 +451,7 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SetHeightSizeType((SwFrmSize)nType);
}
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_FRMSIZE_IS_AUTO_HEIGHT:
@@ -474,11 +468,11 @@ sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SetWidthSizeType((SwFrmSize)nType);
}
else
- bRet = sal_False;
+ bRet = false;
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -532,7 +526,7 @@ SwFmtHeader::SwFmtHeader( sal_Bool bOn )
int SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( pRegisteredIn == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtHeader&)rAttr).IsActive() );
}
@@ -574,7 +568,7 @@ SwFmtFooter::SwFmtFooter( sal_Bool bOn )
int SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( pRegisteredIn == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtFooter&)rAttr).IsActive() );
}
@@ -613,7 +607,7 @@ void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
int SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
if( (long)pStartNode ^ (long)((SwFmtCntnt&)rAttr).pStartNode )
return 0;
if( pStartNode )
@@ -651,7 +645,7 @@ SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc )
int SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( pDefinedIn == ((SwFmtPageDesc&)rAttr).pDefinedIn ) &&
( nNumOffset == ((SwFmtPageDesc&)rAttr).nNumOffset ) &&
( GetPageDesc() == ((SwFmtPageDesc&)rAttr).GetPageDesc() );
@@ -675,19 +669,19 @@ void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
//mich also bei meinem Format aus.
//Dabei werden ich Deletet!!!
if( IS_TYPE( SwFmt, pDefinedIn ))
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
sal_Bool bDel = ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
- ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." );
+ OSL_ENSURE( bDel, ";-) FmtPageDesc nicht zerstoert." );
}
#else
((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
#endif
else if( IS_TYPE( SwCntntNode, pDefinedIn ))
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
sal_Bool bDel = ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC );
- ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." );
+ OSL_ENSURE( bDel, ";-) FmtPageDesc nicht zerstoert." );
}
#else
((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC );
@@ -699,11 +693,11 @@ void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
-sal_Bool SwFmtPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_PAGEDESC_PAGENUMOFFSET:
@@ -724,13 +718,13 @@ sal_Bool SwFmtPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
@@ -743,7 +737,7 @@ sal_Bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(rVal >>= nOffset)
SetNumOffset( nOffset );
else
- bRet = sal_False;
+ bRet = false;
}
break;
@@ -753,8 +747,8 @@ sal_Bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
* Der Pointer waere aber ueber den Namen nur vom Dokument zu erfragen.
*/
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -831,7 +825,7 @@ SwFmtCol::SwFmtCol()
int SwFmtCol::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
const SwFmtCol &rCmp = (const SwFmtCol&)rAttr;
if( !(nLineWidth == rCmp.nLineWidth &&
aLineColor == rCmp.aLineColor &&
@@ -929,7 +923,7 @@ void SwFmtCol::SetOrtho( sal_Bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct
sal_uInt16 SwFmtCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
{
- ASSERT( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
+ OSL_ENSURE( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
if ( nWidth != nAct )
{
long nW = aColumns[nCol]->GetWishWidth();
@@ -943,7 +937,7 @@ sal_uInt16 SwFmtCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
sal_uInt16 SwFmtCol::CalcPrtColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
{
- ASSERT( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
+ OSL_ENSURE( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
sal_uInt16 nRet = CalcColWidth( nCol, nAct );
SwColumn *pCol = aColumns[nCol];
nRet = nRet - pCol->GetLeft();
@@ -1005,30 +999,30 @@ void SwFmtCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
}
}
-sal_Bool SwFmtCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
else
{
uno::Reference< text::XTextColumns > xCols = new SwXTextColumns(*this);
rVal.setValue(&xCols, ::getCppuType((uno::Reference< text::XTextColumns>*)0));
}
- return sal_True;
+ return true;
}
-sal_Bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
}
else
{
@@ -1055,7 +1049,7 @@ sal_Bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
pCol->SetRight( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].RightMargin)) );
aColumns.Insert(pCol, i);
}
- bRet = sal_True;
+ bRet = true;
nWidth = nWidthSum;
bOrtho = sal_False;
@@ -1080,7 +1074,7 @@ sal_Bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case 0: eAdj = COLADJ_TOP; break; //VerticalAlignment_TOP
case 1: eAdj = COLADJ_CENTER;break; //VerticalAlignment_MIDDLE
case 2: eAdj = COLADJ_BOTTOM;break; //VerticalAlignment_BOTTOM
- default: ASSERT( !this, "unknown alignment" ); break;
+ default: OSL_ENSURE( !this, "unknown alignment" ); break;
}
}
}
@@ -1108,7 +1102,7 @@ SwFmtSurround::SwFmtSurround( const SwFmtSurround &rCpy ) :
int SwFmtSurround::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( GetValue() == ((SwFmtSurround&)rAttr).GetValue() &&
bAnchorOnly== ((SwFmtSurround&)rAttr).bAnchorOnly &&
bContour== ((SwFmtSurround&)rAttr).bContour &&
@@ -1126,11 +1120,11 @@ sal_uInt16 SwFmtSurround::GetValueCount() const
}
-sal_Bool SwFmtSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_SURROUND_SURROUNDTYPE:
@@ -1155,17 +1149,17 @@ sal_Bool SwFmtSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_SURROUND_SURROUNDTYPE:
@@ -1190,8 +1184,8 @@ sal_Bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SetOutside( *(sal_Bool*)rVal.getValue() );
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -1209,7 +1203,7 @@ SwFmtVertOrient::SwFmtVertOrient( SwTwips nY, sal_Int16 eVert,
int SwFmtVertOrient::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( nYPos == ((SwFmtVertOrient&)rAttr).nYPos &&
eOrient == ((SwFmtVertOrient&)rAttr).eOrient &&
eRelation == ((SwFmtVertOrient&)rAttr).eRelation );
@@ -1220,11 +1214,11 @@ SfxPoolItem* SwFmtVertOrient::Clone( SfxItemPool* ) const
return new SwFmtVertOrient( nYPos, eOrient, eRelation );
}
-sal_Bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_VERTORIENT_ORIENT:
@@ -1253,17 +1247,17 @@ sal_Bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) cons
rVal <<= (sal_Int32)TWIP_TO_MM100(GetPos());
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_VERTORIENT_ORIENT:
@@ -1300,8 +1294,8 @@ sal_Bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -1322,7 +1316,7 @@ SwFmtHoriOrient::SwFmtHoriOrient( SwTwips nX, sal_Int16 eHori,
int SwFmtHoriOrient::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( nXPos == ((SwFmtHoriOrient&)rAttr).nXPos &&
eOrient == ((SwFmtHoriOrient&)rAttr).eOrient &&
eRelation == ((SwFmtHoriOrient&)rAttr).eRelation &&
@@ -1334,11 +1328,11 @@ SfxPoolItem* SwFmtHoriOrient::Clone( SfxItemPool* ) const
return new SwFmtHoriOrient( nXPos, eOrient, eRelation, bPosToggle );
}
-sal_Bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_HORIORIENT_ORIENT:
@@ -1375,17 +1369,17 @@ sal_Bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) cons
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_HORIORIENT_ORIENT:
@@ -1416,7 +1410,7 @@ sal_Bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
sal_Int32 nVal = 0;
if(!(rVal >>= nVal))
- bRet = sal_False;
+ bRet = false;
if(bConvert)
nVal = MM100_TO_TWIP(nVal);
SetPos( nVal );
@@ -1426,8 +1420,8 @@ sal_Bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SetPosToggle( *(sal_Bool*)rVal.getValue());
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -1490,7 +1484,7 @@ SwFmtAnchor& SwFmtAnchor::operator=(const SwFmtAnchor& rAnchor)
int SwFmtAnchor::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
// OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
return ( nAnchorId == ((SwFmtAnchor&)rAttr).GetAnchorId() &&
nPageNum == ((SwFmtAnchor&)rAttr).GetPageNum() &&
@@ -1516,14 +1510,11 @@ sal_uInt32 SwFmtAnchor::GetOrder() const
return mnOrder;
}
-/*-----------------16.02.98 15:21-------------------
-
---------------------------------------------------*/
-sal_Bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_ANCHOR_ANCHORTYPE:
@@ -1567,17 +1558,17 @@ sal_Bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_ANCHOR_ANCHORTYPE:
@@ -1631,14 +1622,14 @@ sal_Bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
}
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_ANCHOR_ANCHORFRAME:
//no break here!;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -1671,7 +1662,7 @@ SwFmtURL::~SwFmtURL()
int SwFmtURL::operator==( const SfxPoolItem &rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
const SwFmtURL &rCmp = (SwFmtURL&)rAttr;
sal_Bool bRet = bIsServerMap == rCmp.IsServerMap() &&
sURL == rCmp.GetURL() &&
@@ -1706,11 +1697,11 @@ void SwFmtURL::SetMap( const ImageMap *pM )
}
extern const SvEventDescription* lcl_GetSupportedMacroItems();
-sal_Bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_URL_URL:
@@ -1751,17 +1742,17 @@ sal_Bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_URL_URL:
@@ -1797,15 +1788,15 @@ sal_Bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
bRet = SvUnoImageMap_fillImageMap( xCont, *pMap );
}
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_URL_SERVERMAP:
bIsServerMap = *(sal_Bool*)rVal.getValue();
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -1868,7 +1859,7 @@ int SwFmtFtnEndAtTxtEnd::operator==( const SfxPoolItem& rItem ) const
sSuffix == rAttr.sSuffix;
}
-sal_Bool SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
@@ -1897,12 +1888,12 @@ sal_Bool SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId )
case MID_SUFFIX : rVal <<= OUString(sSuffix); break;
default: return sal_False;
}
- return sal_True;
+ return true;
}
-sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
{
@@ -1931,7 +1922,7 @@ sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberI
if(nVal >= 0)
nOffset = nVal;
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_OWN_NUM :
@@ -1953,7 +1944,7 @@ sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberI
SVX_NUM_CHARS_LOWER_LETTER_N == nVal ))
aFmt.SetNumberingType(nVal);
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_PREFIX :
@@ -1968,7 +1959,7 @@ sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberI
sSuffix = sVal;
}
break;
- default: bRet = sal_False;
+ default: bRet = false;
}
return bRet;
}
@@ -1997,7 +1988,7 @@ SfxPoolItem* SwFmtEndAtTxtEnd::Clone( SfxItemPool* ) const
int SwFmtChain::operator==( const SfxPoolItem &rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return GetPrev() == ((SwFmtChain&)rAttr).GetPrev() &&
GetNext() == ((SwFmtChain&)rAttr).GetNext();
@@ -2034,11 +2025,11 @@ void SwFmtChain::SetNext( SwFlyFrmFmt *pFmt )
((SwModify*)aNext.GetRegisteredIn())->Remove( &aNext );
}
-sal_Bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
XubString aRet;
switch ( nMemberId )
{
@@ -2051,8 +2042,8 @@ sal_Bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
aRet = GetNext()->GetName();
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
rVal <<= OUString(aRet);
return bRet;
@@ -2076,7 +2067,7 @@ SwFmtLineNumber::~SwFmtLineNumber()
int SwFmtLineNumber::operator==( const SfxPoolItem &rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return nStartValue == ((SwFmtLineNumber&)rAttr).GetStartValue() &&
bCountLines == ((SwFmtLineNumber&)rAttr).IsCount();
@@ -2087,11 +2078,11 @@ SfxPoolItem* SwFmtLineNumber::Clone( SfxItemPool* ) const
return new SwFmtLineNumber( *this );
}
-sal_Bool SwFmtLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_LINENUMBER_COUNT:
@@ -2104,17 +2095,17 @@ sal_Bool SwFmtLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) cons
rVal <<= (sal_Int32)GetStartValue();
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
// hier wird immer konvertiert!
nMemberId &= ~CONVERT_TWIPS;
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch ( nMemberId )
{
case MID_LINENUMBER_COUNT:
@@ -2126,12 +2117,12 @@ sal_Bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(rVal >>= nVal)
SetStartValue( nVal );
else
- bRet = sal_False;
+ bRet = false;
}
break;
default:
- ASSERT( !this, "unknown MemberId" );
- bRet = sal_False;
+ OSL_ENSURE( !this, "unknown MemberId" );
+ bRet = false;
}
return bRet;
}
@@ -2154,7 +2145,7 @@ SwTextGridItem::~SwTextGridItem()
int SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return eGridType == ((SwTextGridItem&)rAttr).GetGridType() &&
nLines == ((SwTextGridItem&)rAttr).GetLines() &&
nBaseHeight == ((SwTextGridItem&)rAttr).GetBaseHeight() &&
@@ -2190,9 +2181,9 @@ SwTextGridItem& SwTextGridItem::operator=( const SwTextGridItem& rCpy )
return *this;
}
-sal_Bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nMemberId & ~CONVERT_TWIPS )
{
@@ -2239,8 +2230,8 @@ sal_Bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= text::TextGridMode::LINES_AND_CHARS;
break;
default:
- DBG_ERROR("unknown SwTextGrid value");
- bRet = sal_False;
+ OSL_FAIL("unknown SwTextGrid value");
+ bRet = false;
break;
}
break;
@@ -2254,17 +2245,17 @@ sal_Bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
default:
- DBG_ERROR("Unknown SwTextGridItem member");
- bRet = sal_False;
+ OSL_FAIL("Unknown SwTextGridItem member");
+ bRet = false;
break;
}
return bRet;
}
-sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
switch( nMemberId & ~CONVERT_TWIPS )
{
case MID_GRID_COLOR:
@@ -2282,7 +2273,7 @@ sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if( bRet && (nTmp >= 0) )
SetLines( (sal_uInt16)nTmp );
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_GRID_RUBY_BELOW:
@@ -2311,7 +2302,7 @@ sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
else
SetRubyHeight( (sal_uInt16)nTmp );
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_GRID_TYPE:
@@ -2332,7 +2323,7 @@ sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SetGridType( GRID_LINES_CHARS );
break;
default:
- bRet = sal_False;
+ bRet = false;
break;
}
}
@@ -2348,8 +2339,8 @@ sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
}
default:
- DBG_ERROR("Unknown SwTextGridItem member");
- bRet = sal_False;
+ OSL_FAIL("Unknown SwTextGridItem member");
+ bRet = false;
}
return bRet;
@@ -2498,7 +2489,7 @@ void SwFrmFmt::DelFrms()
void SwFrmFmt::MakeFrms()
{
- ASSERT( !this, "Sorry not implemented." );
+ OSL_ENSURE( !this, "Sorry not implemented." );
}
@@ -2629,7 +2620,7 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const
}
if( n >= rFmts.Count() )
{
- ASSERT( !this, "Fly-Section aber kein Format gefunden" );
+ OSL_ENSURE( !this, "Fly-Section aber kein Format gefunden" );
return sal_False;
}
}
@@ -2865,7 +2856,7 @@ void SwFlyFrmFmt::MakeFrms()
pFly = new SwFlyInCntFrm( this, pFrm );
break;
default:
- ASSERT( !this, "Neuer Ankertyp" )
+ OSL_ENSURE( !this, "Neuer Ankertyp" );
break;
}
pFrm->AppendFly( pFly );
@@ -2918,7 +2909,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
{
SdrObject* pMasterObject = FindSdrObject();
- ASSERT( pMasterObject,
+ OSL_ENSURE( pMasterObject,
"<SwNoTxtNode::SetObjTitle(..)> - missing <SdrObject> instance" );
if ( !pMasterObject )
{
@@ -2941,7 +2932,7 @@ void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
const String SwFlyFrmFmt::GetObjTitle() const
{
const SdrObject* pMasterObject = FindSdrObject();
- ASSERT( pMasterObject,
+ OSL_ENSURE( pMasterObject,
"<SwFlyFrmFmt::GetObjTitle(..)> - missing <SdrObject> instance" );
if ( !pMasterObject )
{
@@ -2954,7 +2945,7 @@ const String SwFlyFrmFmt::GetObjTitle() const
void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast )
{
SdrObject* pMasterObject = FindSdrObject();
- ASSERT( pMasterObject,
+ OSL_ENSURE( pMasterObject,
"<SwFlyFrmFmt::SetDescription(..)> - missing <SdrObject> instance" );
if ( !pMasterObject )
{
@@ -2977,7 +2968,7 @@ void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast
const String SwFlyFrmFmt::GetObjDescription() const
{
const SdrObject* pMasterObject = FindSdrObject();
- ASSERT( pMasterObject,
+ OSL_ENSURE( pMasterObject,
"<SwNoTxtNode::GetDescription(..)> - missing <SdrObject> instance" );
if ( !pMasterObject )
{
@@ -3172,7 +3163,7 @@ void SwDrawFrmFmt::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwDrawFrmFmt::SetPositionLayoutDir(..)> - invalid attribute value." );
}
}
@@ -3267,3 +3258,4 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint,
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 08c9f9d11e36..4b7c711d50de 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,6 +64,8 @@
#include <flyfrms.hxx>
// <--
+#include <ndtxt.hxx>
+
//------------------------------------------------------------------------
// Move-Methoden
//------------------------------------------------------------------------
@@ -72,8 +75,6 @@
|* SwCntntFrm::ShouldBwdMoved()
|*
|* Beschreibung Returnwert sagt, ob der Frm verschoben werden sollte.
-|* Ersterstellung MA 05. Dec. 96
-|* Letzte Aenderung MA 05. Dec. 96
|*
|*************************************************************************/
@@ -119,7 +120,7 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool
SwSectionFrm *pSect = pNewUpper->FindSctFrm();
while( pSect && pSect->IsInFtn() )
pSect = pSect->GetUpper()->FindSctFrm();
- ASSERT( pSect, "Escaping footnote" );
+ OSL_ENSURE( pSect, "Escaping footnote" );
if( pSect != pMySect )
return sal_False;
}
@@ -256,8 +257,6 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool
|* Ein weiterer Vorteil ist, das eines schoenen Tages das _Prepare und
|* damit die Formatierung von Vorgaengern umgangen werden kann.
|* So kann evtl. mal 'schnell' an's Dokumentende gesprungen werden.
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 13. Dec. 93
|*
|*************************************************************************/
//Zwei kleine Freundschaften werden hier zu einem Geheimbund.
@@ -290,7 +289,7 @@ void SwFrm::PrepareMake()
{
if ( lcl_IsCalcUpperAllowed( *this ) )
GetUpper()->Calc();
- ASSERT( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
+ OSL_ENSURE( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
if ( !GetUpper() )
return;
@@ -335,7 +334,7 @@ void SwFrm::PrepareMake()
SwFrm *pFrm = GetUpper()->Lower();
while ( pFrm != this )
{
- ASSERT( pFrm, ":-( Layoutgeruest wackelig (this not found)." );
+ OSL_ENSURE( pFrm, ":-( Layoutgeruest wackelig (this not found)." );
if ( !pFrm )
return; //Oioioioi ...
@@ -375,14 +374,14 @@ void SwFrm::PrepareMake()
pFrm = pCnt;
}
}
- ASSERT( GetUpper(), "Layoutgeruest wackelig (Upper wech II)." );
+ OSL_ENSURE( GetUpper(), "Layoutgeruest wackelig (Upper wech II)." );
if ( !GetUpper() )
return;
if ( lcl_IsCalcUpperAllowed( *this ) )
GetUpper()->Calc();
- ASSERT( GetUpper(), "Layoutgeruest wackelig (Upper wech III)." );
+ OSL_ENSURE( GetUpper(), "Layoutgeruest wackelig (Upper wech III)." );
}
if ( bTab && !bOldTabLock )
@@ -399,7 +398,7 @@ void SwFrm::OptPrepareMake()
// <--
{
GetUpper()->Calc();
- ASSERT( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
+ OSL_ENSURE( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
if ( !GetUpper() )
return;
}
@@ -422,7 +421,7 @@ void SwFrm::PrepareCrsr()
GetUpper()->PrepareCrsr();
GetUpper()->Calc();
- ASSERT( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
+ OSL_ENSURE( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
if ( !GetUpper() )
return;
@@ -449,7 +448,7 @@ void SwFrm::PrepareCrsr()
SwFrm *pFrm = GetUpper()->Lower();
while ( pFrm != this )
{
- ASSERT( pFrm, ":-( Layoutgeruest wackelig (this not found)." );
+ OSL_ENSURE( pFrm, ":-( Layoutgeruest wackelig (this not found)." );
if ( !pFrm )
return; //Oioioioi ...
@@ -479,13 +478,13 @@ void SwFrm::PrepareCrsr()
pFrm = pCnt;
}
}
- ASSERT( GetUpper(), "Layoutgeruest wackelig (Upper wech II)." );
+ OSL_ENSURE( GetUpper(), "Layoutgeruest wackelig (Upper wech II)." );
if ( !GetUpper() )
return;
GetUpper()->Calc();
- ASSERT( GetUpper(), "Layoutgeruest wackelig (Upper wech III)." );
+ OSL_ENSURE( GetUpper(), "Layoutgeruest wackelig (Upper wech III)." );
if ( bTab && !bOldTabLock )
::PrepareUnlock( (SwTabFrm*)this );
@@ -497,9 +496,6 @@ void SwFrm::PrepareCrsr()
|*
|* SwFrm::MakePos()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 24. May. 93
-|*
|*************************************************************************/
// Hier wird GetPrev() zurueckgegeben, allerdings werden
@@ -669,9 +665,6 @@ void SwFrm::MakePos()
|*
|* SwPageFrm::MakeAll()
|*
-|* Ersterstellung MA 23. Feb. 93
-|* Letzte Aenderung MA 20. Jul. 98
-|*
|*************************************************************************/
// --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
@@ -800,7 +793,7 @@ void SwPageFrm::MakeAll()
else
{
// OD 30.10.2002 #97265# - assert invalid lower property
- ASSERT( !(pFrm->Frm().Height() < pFrm->Prt().Height()),
+ OSL_ENSURE( !(pFrm->Frm().Height() < pFrm->Prt().Height()),
"SwPageFrm::MakeAll(): Lower with frame height < printing height" );
nTmp += pFrm->Frm().Height() - pFrm->Prt().Height();
}
@@ -854,12 +847,12 @@ void SwPageFrm::MakeAll()
if ( Frm() != aOldRect && GetUpper() )
static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//Der Upper (Root) muss mindestens so breit
//sein, dass er die breiteste Seite aufnehmen kann.
if ( GetUpper() )
{
- ASSERT( GetUpper()->Prt().Width() >= aFrm.Width(), "Rootsize" );
+ OSL_ENSURE( GetUpper()->Prt().Width() >= aFrm.Width(), "Rootsize" );
}
#endif
}
@@ -868,9 +861,6 @@ void SwPageFrm::MakeAll()
|*
|* SwLayoutFrm::MakeAll()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 28. Nov. 95
-|*
|*************************************************************************/
@@ -957,10 +947,43 @@ void SwLayoutFrm::MakeAll()
|*
|* SwCntntFrm::MakePrtArea()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 03. Mar. 96
-|*
|*************************************************************************/
+bool SwTxtNode::IsCollapse() const
+{
+ if ( GetDoc()->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA ) && GetTxt().Len()==0 ) {
+ sal_uLong nIdx=GetIndex();
+ const SwEndNode *pNdBefore=GetNodes()[nIdx-1]->GetEndNode();
+ const SwEndNode *pNdAfter=GetNodes()[nIdx+1]->GetEndNode();
+
+ // The paragraph is collapsed only if the NdAfter is the end of a cell
+ bool bInTable = this->FindTableNode( ) != NULL;
+
+ SwSortedObjs* pObjs = this->GetFrm()->GetDrawObjs( );
+ sal_uInt32 nObjs = ( pObjs != NULL ) ? pObjs->Count( ) : 0;
+
+ if ( pNdBefore!=NULL && pNdAfter!=NULL && nObjs == 0 && bInTable ) {
+ return true;
+ } else {
+ return false;
+ }
+ } else
+ return false;
+}
+
+bool SwFrm::IsCollapse() const
+{
+ if (IsTxtFrm()) {
+ const SwTxtFrm *pTxtFrm=(SwTxtFrm*)this;
+ const SwTxtNode *pTxtNode=pTxtFrm->GetTxtNode();
+ if (pTxtNode && pTxtNode->IsCollapse()) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
{
@@ -1062,8 +1085,11 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
nUpper = CalcUpperSpace( &rAttrs, NULL );
- // OD 2004-03-02 #106629# - use new method <CalcLowerSpace(..)>
SwTwips nLower = CalcLowerSpace( &rAttrs );
+ if (IsCollapse()) {
+ nUpper=0;
+ nLower=0;
+ }
// // in balanced columned section frames we do not want the
// // common border
// sal_Bool bCommonBorder = sal_True;
@@ -1099,9 +1125,6 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
|*
|* SwCntntFrm::MakeAll()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 16. Dec. 96
-|*
|*************************************************************************/
#define STOP_FLY_FORMAT 10
@@ -1120,8 +1143,8 @@ inline void ValidateSz( SwFrm *pFrm )
void SwCntntFrm::MakeAll()
{
- ASSERT( GetUpper(), "keinen Upper?" );
- ASSERT( IsTxtFrm(), "MakeAll(), NoTxt" );
+ OSL_ENSURE( GetUpper(), "keinen Upper?" );
+ OSL_ENSURE( IsTxtFrm(), "MakeAll(), NoTxt" );
if ( !IsFollow() && StackHack::IsLocked() )
return;
@@ -1129,13 +1152,13 @@ void SwCntntFrm::MakeAll()
if ( IsJoinLocked() )
return;
- ASSERT( !((SwTxtFrm*)this)->IsSwapped(), "Calculation of a swapped frame" );
+ OSL_ENSURE( !((SwTxtFrm*)this)->IsSwapped(), "Calculation of a swapped frame" );
StackHack aHack;
if ( ((SwTxtFrm*)this)->IsLocked() )
{
- ASSERT( sal_False, "Format fuer gelockten TxtFrm." );
+ OSL_ENSURE( sal_False, "Format fuer gelockten TxtFrm." );
return;
}
@@ -1146,14 +1169,14 @@ void SwCntntFrm::MakeAll()
// <--
PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 )
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const SwDoc *pDoc = GetAttrSet()->GetDoc();
if( pDoc )
{
static sal_Bool bWarn = sal_False;
if( pDoc->InXMLExport() )
{
- ASSERT( bWarn, "Formatting during XML-export!" );
+ OSL_ENSURE( bWarn, "Formatting during XML-export!" );
bWarn = sal_True;
}
else
@@ -1313,7 +1336,7 @@ void SwCntntFrm::MakeAll()
//nach dem hin und her fliessen sparen.
GetUpper()->ResetCompletePaint();
//Der Vorgaenger wurde Invalidiert, das ist jetzt auch obsolete.
- ASSERT( pPre, "missing old Prev" );
+ OSL_ENSURE( pPre, "missing old Prev" );
if( !pPre->IsSctFrm() )
::ValidateSz( pPre );
}
@@ -1433,33 +1456,12 @@ void SwCntntFrm::MakeAll()
#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT( false, "debug assertion: <SwCntntFrm::MakeAll()> - format of text frame suppressed by fix b6448963" );
+ OSL_ENSURE( false, "debug assertion: <SwCntntFrm::MakeAll()> - format of text frame suppressed by fix b6448963" );
}
#endif
// <--
}
- // FME 16.07.2003 #i16930# - removed this code because it did not work
-
- // OD 04.04.2003 #108446# - react on the situation detected in the text
- // formatting - see <SwTxtFrm::FormatAdjust(..)>:
- // text frame has to move forward, because its text formatting stopped,
- // created a follow and detected, that it contains no content.
-/* if ( IsTxtFrm() && bValidPos && bValidSize && bValidPrtArea &&
- (Frm().*fnRect->fnGetHeight)() == 0 &&
- HasFollow()
- )
- {
- SwFrm* pOldUpper = GetUpper();
- MoveFwd( sal_True, sal_False );
- if ( GetUpper() != pOldUpper )
- {
- bMovedFwd = sal_True;
- SWREFRESHFN( this )
- continue;
- }
- } */
-
//Wenn ich der erste einer Kette bin koennte ich mal sehen ob
//ich zurueckfliessen kann (wenn ich mich ueberhaupt bewegen soll).
//Damit es keine Oszillation gibt, darf ich nicht gerade vorwaerts
@@ -1702,10 +1704,10 @@ void SwCntntFrm::MakeAll()
( !bSct || !FindSctFrm()->IsColLocked() ) )
bMoveOrFit = sal_True;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT( sal_False, "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." );
+ OSL_ENSURE( sal_False, "+TxtFrm hat WouldFit-Versprechen nicht eingehalten." );
}
#endif
}
@@ -1758,7 +1760,7 @@ void SwCntntFrm::MakeAll()
}
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in SwCntntFrm::MakeAll" )
+ OSL_ENSURE( false, "LoopControl in SwCntntFrm::MakeAll" );
#endif
}
if ( bMovedBwd && GetUpper() )
@@ -1809,9 +1811,6 @@ void SwCntntFrm::MakeAll()
|*
|* SwCntntFrm::_WouldFit()
|*
-|* Ersterstellung MA 28. Feb. 95
-|* Letzte Aenderung AMA 15. Feb. 99
-|*
|*************************************************************************/
@@ -1870,7 +1869,7 @@ void MakeNxt( SwFrm *pFrm, SwFrm *pNxt )
sal_Bool lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
{
- ASSERT( pFrm && pNxt, "lcl_IsNextFtnBoss: No Frames?" );
+ OSL_ENSURE( pFrm && pNxt, "lcl_IsNextFtnBoss: No Frames?" );
pFrm = pFrm->FindFtnBossFrm();
pNxt = pNxt->FindFtnBossFrm();
// Falls pFrm eine letzte Spalte ist, wird stattdessen die Seite genommen
@@ -2065,7 +2064,7 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
// 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!" );
+ OSL_ENSURE( false, "Only a warning for task 108824:/n<SwCntntFrm::_WouldFit(..) - follow not valid!" );
return sal_True;
}
}
@@ -2112,3 +2111,5 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index df076ca751de..d4085359819f 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,9 +55,6 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes
|*
|* SwColumnFrm::SwColumnFrm()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung AMA 30. Oct 98
-|*
|*************************************************************************/
SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt ):
SwFtnBossFrm( pFmt )
@@ -84,21 +82,18 @@ SwColumnFrm::~SwColumnFrm()
|*
|* SwLayoutFrm::ChgColumns()
|*
-|* Ersterstellung MA 11. Feb. 93
-|* Letzte Aenderung MA 12. Oct. 98
-|*
|*************************************************************************/
void MA_FASTCALL lcl_RemoveColumns( SwLayoutFrm *pCont, sal_uInt16 nCnt )
{
- ASSERT( pCont && pCont->Lower() && pCont->Lower()->IsColumnFrm(),
+ OSL_ENSURE( pCont && pCont->Lower() && pCont->Lower()->IsColumnFrm(),
"Keine Spalten zu entfernen." );
SwColumnFrm *pColumn = (SwColumnFrm*)pCont->Lower();
::lcl_RemoveFtns( pColumn, sal_True, sal_True );
while ( pColumn->GetNext() )
{
- ASSERT( pColumn->GetNext()->IsColumnFrm(),
+ OSL_ENSURE( pColumn->GetNext()->IsColumnFrm(),
"Nachbar von ColFrm kein ColFrm." );
pColumn = (SwColumnFrm*)pColumn->GetNext();
}
@@ -197,7 +192,7 @@ static sal_Bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount )
return bRet;
}
-/*-----------------21.09.99 15:42-------------------
+/*--------------------------------------------------
* ChgColumns() adds or removes columns from a layoutframe.
* Normally, a layoutframe with a column attribut of 1 or 0 columns contains
* no columnframe. However, a sectionframe with "footnotes at the end" needs
@@ -244,7 +239,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
if( nOldNum != nNewNum || bChgFtn )
{
SwDoc *pDoc = GetFmt()->GetDoc();
- ASSERT( pDoc, "FrmFmt gibt kein Dokument her." );
+ OSL_ENSURE( pDoc, "FrmFmt gibt kein Dokument her." );
// SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen
// und im normalen Textfluss unterbringen.
if( IsPageBodyFrm() )
@@ -310,7 +305,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
//unnuetzte Aktionen beim Einstellen zur Folge haben.
if ( pSave )
{
- ASSERT( Lower() && Lower()->IsLayoutFrm() &&
+ OSL_ENSURE( Lower() && Lower()->IsLayoutFrm() &&
((SwLayoutFrm*)Lower())->Lower() &&
((SwLayoutFrm*)Lower())->Lower()->IsLayoutFrm(),
"Gesucht: Spaltenbody (Tod oder Lebend)." ); // ColumnFrms jetzt mit BodyFrm
@@ -322,9 +317,6 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
|*
|* SwLayoutFrm::AdjustColumns()
|*
-|* Ersterstellung MA 19. Jan. 99
-|* Letzte Aenderung MA 19. Jan. 99
-|*
|*************************************************************************/
void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttributes )
@@ -482,3 +474,4 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 82bce24fc8ee..f84f2bc88e7b 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#ifdef DBG_UTIL
-/* -----------------08.01.99 14:55-------------------
* Und hier die Beschreibung:
*
* Durch die PROTOCOL-Makros wird es ermoeglicht, Ereignisse im Frame-Methoden zu protokollieren.
@@ -105,8 +105,8 @@
*
* --------------------------------------------------*/
-#ifndef DBG_UTIL
-#error Wer fummelt denn an den makefiles rum?
+#if !defined(OSL_DEBUG_LEVEL) || OSL_DEBUG_LEVEL <= 1
+#error Who broken the makefiles?
#endif
@@ -138,7 +138,7 @@ SwImplProtocol* SwProtocol::pImpl = NULL;
sal_uLong lcl_GetFrameId( const SwFrm* pFrm )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static sal_Bool bFrameId = sal_False;
if( bFrameId )
return pFrm->GetFrmId();
@@ -152,7 +152,7 @@ class SwImplProtocol
{
SvFileStream *pStream; // Ausgabestream
SvUShortsSort *pFrmIds; // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
- SvLongs *pVar; // Variables
+ std::vector<long> aVars; // Variables
ByteString aLayer; // Einrueckung der Ausgabe (" " pro Start/End)
sal_uInt16 nTypes; // welche Typen sollen aufgezeichnet werden
sal_uInt16 nLineCount; // Ausgegebene Zeilen
@@ -176,10 +176,10 @@ public:
void ChkStream() { if( !pStream ) NewStream(); }
void SnapShot( const SwFrm* pFrm, sal_uLong nFlags );
void GetVar( const sal_uInt16 nNo, long& rVar )
- { if( pVar && nNo < pVar->Count() ) rVar = (*pVar)[ nNo ]; }
+ { if( nNo < aVars.size() ) rVar = aVars[ nNo ]; }
};
-/* -----------------11.01.99 10:43-------------------
+/* --------------------------------------------------
* Durch das PROTOCOL_ENTER-Makro wird ein SwEnterLeave-Objekt erzeugt,
* wenn die aktuelle Funktion aufgezeichnet werden soll, wird ein
* SwImplEnterLeave-Objekt angelegt. Der Witz dabei ist, das der Ctor
@@ -302,7 +302,7 @@ void SwProtocol::GetVar( const sal_uInt16 nNo, long& rVar )
}
SwImplProtocol::SwImplProtocol()
- : pStream( NULL ), pFrmIds( NULL ), pVar( NULL ), nTypes( 0xffff ),
+ : pStream( NULL ), pFrmIds( NULL ), nTypes( 0xffff ),
nLineCount( 0 ), nMaxLines( USHRT_MAX ), nTestMode( 0 )
{
NewStream();
@@ -329,10 +329,10 @@ SwImplProtocol::~SwImplProtocol()
delete pStream;
}
delete pFrmIds;
- delete pVar;
+ aVars.clear();
}
-/* -----------------11.01.99 11:03-------------------
+/* --------------------------------------------------
* SwImplProtocol::CheckLine analysiert eine Zeile der INI-Datei
* --------------------------------------------------*/
@@ -375,8 +375,6 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
else if( "[var" == aTmp )// variables
{
nInitFile = 6;
- if( !pVar )
- pVar = new SvLongs( 5, 5 );
}
else
nInitFile = 0; // Nanu: Unbekannter Bereich?
@@ -427,14 +425,14 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
break;
case 5: nMaxLines = (sal_uInt16)nVal;
break;
- case 6: pVar->Insert( (long)nVal, pVar->Count() );
+ case 6: aVars.push_back( (long)nVal );
break;
}
}
}
}
-/* -----------------11.01.99 11:17-------------------
+/* --------------------------------------------------
* SwImplProtocol::FileInit() liest die Datei "dbg_lay.ini"
* im aktuellen Verzeichnis und wertet sie aus.
* --------------------------------------------------*/
@@ -467,7 +465,7 @@ void SwImplProtocol::FileInit()
aStream.Close();
}
-/* -----------------11.01.99 11:20-------------------
+/* --------------------------------------------------
* lcl_Start sorgt fuer Einrueckung um zwei Blanks bei ACT_START
* und nimmt diese bei ACT_END wieder zurueck.
* --------------------------------------------------*/
@@ -489,7 +487,7 @@ void lcl_Start( ByteString& rOut, ByteString& rLay, sal_uLong nAction )
}
}
-/* -----------------11.01.99 11:21-------------------
+/* --------------------------------------------------
* lcl_Flags gibt das ValidSize-, ValidPos- und ValidPrtArea-Flag ("Sz","Ps","PA")
* des Frames aus, "+" fuer valid, "-" fuer invalid.
* --------------------------------------------------*/
@@ -504,7 +502,7 @@ void lcl_Flags( ByteString& rOut, const SwFrm* pFrm )
rOut += pFrm->GetValidPrtAreaFlag() ? '+' : '-';
}
-/* -----------------11.01.99 11:23-------------------
+/* --------------------------------------------------
* lcl_FrameType gibt den Typ des Frames in Klartext aus.
* --------------------------------------------------*/
@@ -553,7 +551,7 @@ void lcl_FrameType( ByteString& rOut, const SwFrm* pFrm )
rOut += "Not impl. ";
}
-/* -----------------11.01.99 11:25-------------------
+/* --------------------------------------------------
* SwImplProtocol::Record(..) wird nur gerufen, wenn das PROTOCOL-Makro
* feststellt, dass die Funktion aufgezeichnet werden soll ( SwProtocol::nRecord ).
* In dieser Methode werden noch die beiden weiteren Einschraenkungen ueberprueft,
@@ -702,7 +700,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
SwProtocol::SetRecord( 0 ); // => Ende der Aufzeichnung
}
-/* -----------------13.01.99 11:39-------------------
+/* --------------------------------------------------
* SwImplProtocol::SectFunc(...) wird von SwImplProtocol::_Record(..) gerufen,
* hier werden die Ausgaben rund um SectionFrms abgehandelt.
* --------------------------------------------------*/
@@ -728,7 +726,7 @@ void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , sal_uLong nAct,
}
}
-/* -----------------11.01.99 11:31-------------------
+/* --------------------------------------------------
* SwImplProtocol::InsertFrm(..) nimmt eine neue FrmId zum Aufzeichnen auf,
* wenn pFrmIds==NULL, werden alle aufgezeichnet, sobald durch InsertFrm(..)
* pFrmIds angelegt wird, werden nur noch die enthaltenen FrmIds aufgezeichnet.
@@ -744,7 +742,7 @@ sal_Bool SwImplProtocol::InsertFrm( sal_uInt16 nId )
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.
* --------------------------------------------------*/
@@ -757,7 +755,7 @@ sal_Bool SwImplProtocol::DeleteFrm( sal_uInt16 nId )
return sal_True;
}
-/*-----------------20.9.2001 10:29------------------
+/*--------------------------------------------------
* SwProtocol::SnapShot(..)
* creates a snapshot of the given frame and its content.
* --------------------------------------------------*/
@@ -791,7 +789,7 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
}
}
-/* -----------------11.01.99 11:53-------------------
+/* --------------------------------------------------
* SwEnterLeave::Ctor(..) wird vom eigentlichen (inline-)Kontruktor gerufen,
* wenn die Funktion aufgezeichnet werden soll.
* Die Aufgabe ist es abhaengig von der Funktion das richtige SwImplEnterLeave-Objekt
@@ -812,7 +810,7 @@ void SwEnterLeave::Ctor( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, voi
pImpl->Enter();
}
-/* -----------------11.01.99 11:56-------------------
+/* --------------------------------------------------
* SwEnterLeave::Dtor() ruft lediglich den Destruktor des SwImplEnterLeave-Objekts,
* ist nur deshalb nicht inline, damit die SwImplEnterLeave-Definition nicht
* im dbg_lay.hxx zu stehen braucht.
@@ -867,3 +865,4 @@ void SwFrmChangesLeave::Leave()
#endif // DBG_UTIL
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index c6e8f4d823d8..62f361402055 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -56,8 +57,6 @@
|*
|* Beschreibung Sucht den ersten/letzten CntntFrm im BodyText unterhalb
|* der Seite.
-|* Ersterstellung MA 15. Feb. 93
-|* Letzte Aenderung MA 18. Apr. 94
|*
|*************************************************************************/
SwLayoutFrm *SwFtnBossFrm::FindBodyCont()
@@ -87,9 +86,6 @@ SwCntntFrm *SwPageFrm::FindLastBodyCntnt()
|* untergeordneten Struktur einen oder mehrere CntntFrm's enthaelt;
|* Falls ja wird der erste gefundene CntntFrm zurueckgegeben.
|*
-|* Ersterstellung MA 13. May. 92
-|* Letzte Aenderung MA 20. Apr. 94
-|*
|*************************************************************************/
const SwCntntFrm *SwLayoutFrm::ContainsCntnt() const
@@ -142,8 +138,6 @@ const SwCntntFrm *SwLayoutFrm::ContainsCntnt() const
|* hineinzukommen. Dort hangelt es sich wieder hoch zum
|* ersten SwCellFrm, seit es SectionFrms gibt, reicht kein
|* ContainsCntnt()->GetUpper() mehr...
-|* Ersterstellung AMA 17. Mar. 99
-|* Letzte Aenderung AMA 17. Mar. 99
|*
|*************************************************************************/
@@ -161,8 +155,6 @@ const SwCellFrm *SwLayoutFrm::FirstCell() const
|*
|* Beschreibung wie ContainsCntnt, nur dass nicht nur CntntFrms, sondern auch
|* Bereiche und Tabellen zurueckgegeben werden.
-|* Ersterstellung AMA 10. Mar. 99
-|* Letzte Aenderung AMA 10. Mar. 99
|*
|*************************************************************************/
@@ -216,9 +208,6 @@ const SwFrm *SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
|*
|* SwFrm::GetLower()
|*
-|* Ersterstellung MA 27. Jul. 92
-|* Letzte Aenderung MA 09. Oct. 97
-|*
|*************************************************************************/
const SwFrm* SwFrm::GetLower() const
{
@@ -234,9 +223,6 @@ SwFrm* SwFrm::GetLower()
|*
|* SwLayoutFrm::IsAnLower()
|*
-|* Ersterstellung MA 18. Mar. 93
-|* Letzte Aenderung MA 18. Mar. 93
-|*
|*************************************************************************/
sal_Bool SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const
{
@@ -269,8 +255,8 @@ sal_Bool SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const
*/
bool SwLayoutFrm::IsBefore( const SwLayoutFrm* _pCheckRefLayFrm ) const
{
- ASSERT( !IsRootFrm() , "<IsBefore> called at a <SwRootFrm>.");
- ASSERT( !_pCheckRefLayFrm->IsRootFrm() , "<IsBefore> called with a <SwRootFrm>.");
+ OSL_ENSURE( !IsRootFrm() , "<IsBefore> called at a <SwRootFrm>.");
+ OSL_ENSURE( !_pCheckRefLayFrm->IsRootFrm() , "<IsBefore> called with a <SwRootFrm>.");
bool bReturn;
@@ -410,9 +396,6 @@ const SwLayoutFrm *SwFrm::ImplGetNextLayoutLeaf( bool bFwd ) const
|* Frms rueckwaerts gegangen wird.
|* Vorwaetzwander funktioniert analog.
|*
-|* Ersterstellung ??
-|* Letzte Aenderung MA 30. Oct. 97
-|*
|*************************************************************************/
// Achtung: Fixes in ImplGetNextCntntFrm() muessen moeglicherweise auch in
@@ -464,9 +447,6 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const
|* SwFrm::FindRootFrm(), FindTabFrm(), FindFtnFrm(), FindFlyFrm(),
|* FindPageFrm(), FindColFrm()
|*
-|* Ersterstellung ??
-|* Letzte Aenderung MA 05. Sep. 93
-|*
|*************************************************************************/
SwRootFrm* SwFrm::FindRootFrm()
{
@@ -476,8 +456,8 @@ SwRootFrm* SwFrm::FindRootFrm()
// Casting the GetDep() result instead of the frame itself (that has
// been done before) makes it save to use that method in constructors
// and destructors.
- ASSERT( GetDep(), "frame is not registered any longer" );
- ASSERT( IsLayoutFrm() || IsCntntFrm(), "invalid frame type" );
+ OSL_ENSURE( GetDep(), "frame is not registered any longer" );
+ OSL_ENSURE( IsLayoutFrm() || IsCntntFrm(), "invalid frame type" );
SwDoc *pDoc = IsLayoutFrm()
? static_cast < SwFrmFmt * >( GetDep() )->GetDoc()
: static_cast < SwCntntNode * >( GetDep() )->GetDoc();
@@ -531,7 +511,7 @@ SwFtnBossFrm* SwFrm::FindFtnBossFrm( sal_Bool bFootnotes )
!pRet->GetNext() && !pRet->GetPrev() )
{
SwSectionFrm* pSct = pRet->FindSctFrm();
- ASSERT( pSct, "FindFtnBossFrm: Single column outside section?" );
+ OSL_ENSURE( pSct, "FindFtnBossFrm: Single column outside section?" );
if( !pSct->IsFtnAtEnd() )
return pSct->FindFtnBossFrm( sal_True );
}
@@ -596,6 +576,15 @@ SwFrm *SwFrm::FindColFrm()
return pFrm;
}
+SwRowFrm *SwFrm::FindRowFrm()
+{
+ SwFrm *pFrm = this;
+ do
+ { pFrm = pFrm->GetUpper();
+ } while ( pFrm && !pFrm->IsRowFrm() );
+ return dynamic_cast< SwRowFrm* >( pFrm );
+}
+
SwFrm* SwFrm::FindFooterOrHeader()
{
SwFrm* pRet = this;
@@ -643,7 +632,7 @@ const SwPageFrm* SwRootFrm::GetPageAtPos( const Point& rPt, const Size* pSize, b
pPage = pPage->GetNext();
}
- ASSERT( GetPageNum() <= maPageRects.size(), "number of pages differes from page rect array size" )
+ OSL_ENSURE( GetPageNum() <= maPageRects.size(), "number of pages differes from page rect array size" );
sal_uInt16 nPageIdx = 0;
while ( pPage && !pRet )
@@ -666,9 +655,6 @@ const SwPageFrm* SwRootFrm::GetPageAtPos( const Point& rPt, const Size* pSize, b
|*
|* SwFrmFrm::GetAttrSet()
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung MA 02. Aug. 93
-|*
|*************************************************************************/
const SwAttrSet* SwFrm::GetAttrSet() const
{
@@ -696,8 +682,6 @@ const SwAttrSet* SwFrm::GetAttrSet() const
|* auf.
|* - Tabellen verhalten sich prinzipiell analog zu den Cntnts
|* - Bereiche ebenfalls
-|* Ersterstellung AK 14-Feb-1991
-|* Letzte Aenderung AMA 10. Mar. 99
|*
|*************************************************************************/
@@ -783,7 +767,7 @@ SwFrm *SwFrm::_FindNext()
SwLayoutFrm *pUp = pThis->GetUpper();
while ( !pUp->IsCellFrm() )
pUp = pUp->GetUpper();
- ASSERT( pUp, "Cntnt in Tabelle aber nicht in Zelle." );
+ OSL_ENSURE( pUp, "Cntnt in Tabelle aber nicht in Zelle." );
SwFrm* pNxt = ((SwCellFrm*)pUp)->GetFollowCell();
if ( pNxt )
pNxt = ((SwCellFrm*)pNxt)->ContainsCntnt();
@@ -922,7 +906,7 @@ SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
// Assure that found next content frame belongs to the same footnotes
const SwFtnFrm* pFtnFrmOfNext( pNxtCnt->FindFtnFrm() );
const SwFtnFrm* pFtnFrmOfCurr( pThis->FindFtnFrm() );
- ASSERT( pFtnFrmOfCurr,
+ OSL_ENSURE( pFtnFrmOfCurr,
"<SwFrm::_FindNextCnt() - unknown layout situation: current frame has to have an upper footnote frame." );
if ( pFtnFrmOfNext == pFtnFrmOfCurr )
{
@@ -1103,9 +1087,9 @@ SwCntntFrm* SwFrm::_FindPrevCnt( const bool _bInSameFtn )
// neither <pCurrCntntFrm> nor <pPrevCntntFrm> are
// inside a fly frame.
// Thus, method <FindFooterOrHeader()> can be used.
- ASSERT( pCurrCntntFrm->FindFooterOrHeader(),
+ OSL_ENSURE( pCurrCntntFrm->FindFooterOrHeader(),
"<SwFrm::_FindPrevCnt()> - unknown layout situation: current frame should be in page header or page footer" );
- ASSERT( !pPrevCntntFrm->IsInFly(),
+ OSL_ENSURE( !pPrevCntntFrm->IsInFly(),
"<SwFrm::_FindPrevCnt()> - unknown layout situation: found previous frame should *not* be inside a fly frame." );
if ( pPrevCntntFrm->FindFooterOrHeader() !=
pCurrCntntFrm->FindFooterOrHeader() )
@@ -1147,7 +1131,7 @@ SwFrm *SwFrm::_FindPrev()
SwLayoutFrm *pUp = pThis->GetUpper();
while ( !pUp->IsCellFrm() )
pUp = pUp->GetUpper();
- ASSERT( pUp, "Cntnt in Tabelle aber nicht in Zelle." );
+ OSL_ENSURE( pUp, "Cntnt in Tabelle aber nicht in Zelle." );
if ( pUp->IsAnLower( pPrvCnt ) )
return pPrvCnt;
}
@@ -1320,9 +1304,6 @@ sal_Bool lcl_IsInColSct( const SwFrm *pUp )
|*
|* SwFrm::IsMoveable();
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 05. May. 95
-|*
|*************************************************************************/
/** determine, if frame is moveable in given environment
@@ -1401,9 +1382,6 @@ bool SwFrm::IsMoveable( const SwLayoutFrm* _pLayoutFrm ) const
|*
|* SwFrm::SetInfFlags();
|*
-|* Ersterstellung MA 05. Apr. 94
-|* Letzte Aenderung MA 05. Apr. 94
-|*
|*************************************************************************/
void SwFrm::SetInfFlags()
{
@@ -1454,7 +1432,7 @@ void SwFrm::SetDirFlags( sal_Bool bVert )
const SwFrm* pAsk = IsFlyFrm() ?
((SwFlyFrm*)this)->GetAnchorFrm() : GetUpper();
- ASSERT( pAsk != this, "Autsch! Stack overflow is about to happen" )
+ OSL_ENSURE( pAsk != this, "Autsch! Stack overflow is about to happen" );
if( pAsk )
{
@@ -1480,7 +1458,7 @@ void SwFrm::SetDirFlags( sal_Bool bVert )
const SwFrm* pAsk = IsFlyFrm() ?
((SwFlyFrm*)this)->GetAnchorFrm() : GetUpper();
- ASSERT( pAsk != this, "Autsch! Stack overflow is about to happen" )
+ OSL_ENSURE( pAsk != this, "Autsch! Stack overflow is about to happen" );
if( pAsk )
bRightToLeft = pAsk->IsRightToLeft() ? 1 : 0;
@@ -1497,7 +1475,7 @@ SwLayoutFrm* SwFrm::GetNextCellLeaf( MakePageType )
while ( !pTmpFrm->IsCellFrm() )
pTmpFrm = pTmpFrm->GetUpper();
- ASSERT( pTmpFrm, "SwFrm::GetNextCellLeaf() without cell" )
+ OSL_ENSURE( pTmpFrm, "SwFrm::GetNextCellLeaf() without cell" );
return ((SwCellFrm*)pTmpFrm)->GetFollowCell();
}
@@ -1507,7 +1485,7 @@ SwLayoutFrm* SwFrm::GetPrevCellLeaf( MakePageType )
while ( !pTmpFrm->IsCellFrm() )
pTmpFrm = pTmpFrm->GetUpper();
- ASSERT( pTmpFrm, "SwFrm::GetNextPreviousLeaf() without cell" )
+ OSL_ENSURE( pTmpFrm, "SwFrm::GetNextPreviousLeaf() without cell" );
return ((SwCellFrm*)pTmpFrm)->GetPreviousCell();
}
@@ -1526,13 +1504,13 @@ SwCellFrm* lcl_FindCorrespondingCellFrm( const SwRowFrm& rOrigRow,
pCorrCell = (SwCellFrm*)pCorrCell->GetNext();
}
- ASSERT( pCell && pCorrCell, "lcl_FindCorrespondingCellFrm does not work" )
+ OSL_ENSURE( pCell && pCorrCell, "lcl_FindCorrespondingCellFrm does not work" );
if ( pCell != &rOrigCell )
{
// rOrigCell must be a lower of pCell. We need to recurse into the rows:
- ASSERT( pCell->Lower() && pCell->Lower()->IsRowFrm(),
- "lcl_FindCorrespondingCellFrm does not work" )
+ OSL_ENSURE( pCell->Lower() && pCell->Lower()->IsRowFrm(),
+ "lcl_FindCorrespondingCellFrm does not work" );
SwRowFrm* pRow = (SwRowFrm*)pCell->Lower();
while ( !pRow->IsAnLower( &rOrigCell ) )
@@ -1622,7 +1600,7 @@ SwCellFrm* SwCellFrm::GetPreviousCell() const
while( !pRow->IsRowFrm() || !pRow->GetUpper()->IsTabFrm() )
pRow = pRow->GetUpper();
- ASSERT( pRow->GetUpper() && pRow->GetUpper()->IsTabFrm(), "GetPreviousCell without Table" );
+ OSL_ENSURE( pRow->GetUpper() && pRow->GetUpper()->IsTabFrm(), "GetPreviousCell without Table" );
SwTabFrm* pTab = (SwTabFrm*)pRow->GetUpper();
@@ -1658,10 +1636,10 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
if ( !bStart && pTableFrm->IsFollow() && pTableFrm->IsInHeadline( *this ) )
return *this;
- ASSERT( pTableFrm &&
- ( bStart && GetTabBox()->getRowSpan() < 1 ||
- !bStart && GetLayoutRowSpan() > 1 ),
- "SwCellFrm::FindStartRowSpanCell: No rowspan, no table, no cookies" )
+ OSL_ENSURE( pTableFrm &&
+ ( (bStart && GetTabBox()->getRowSpan() < 1) ||
+ (!bStart && GetLayoutRowSpan() > 1) ),
+ "SwCellFrm::FindStartRowSpanCell: No rowspan, no table, no cookies" );
if ( pTableFrm )
{
@@ -1706,7 +1684,7 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
for ( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsCellFrm(), "Non-row frame registered in table line" )
+ OSL_ENSURE( ((SwFrm*)pLast)->IsCellFrm(), "Non-row frame registered in table line" );
const SwCellFrm* pMasterCell = static_cast<const SwCellFrm*>(pLast);
if ( pMasterCell->GetTabBox() == &rMasterBox )
@@ -1735,7 +1713,7 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
}
}
- ASSERT( pRet, "SwCellFrm::FindStartRowSpanCell: No result" )
+ OSL_ENSURE( pRet, "SwCellFrm::FindStartRowSpanCell: No result" );
return *pRet;
}
@@ -1743,7 +1721,7 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
const SwRowFrm* SwFrm::IsInSplitTableRow() const
{
- ASSERT( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" )
+ OSL_ENSURE( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" );
const SwFrm* pRow = this;
@@ -1753,7 +1731,7 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const
if ( !pRow ) return NULL;
- ASSERT( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" )
+ OSL_ENSURE( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" );
const SwTabFrm* pTab = (SwTabFrm*)pRow->GetUpper();
// --> OD 2006-06-28 #b6443897#
@@ -1770,14 +1748,14 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const
// skip headline
const SwRowFrm* pFollowRow = pTab->GetFollow()->GetFirstNonHeadlineRow();
- ASSERT( pFollowRow, "SwFrm::IsInSplitTableRow() does not work" )
+ OSL_ENSURE( pFollowRow, "SwFrm::IsInSplitTableRow() does not work" );
return pFollowRow;
}
const SwRowFrm* SwFrm::IsInFollowFlowRow() const
{
- ASSERT( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" )
+ OSL_ENSURE( IsInTab(), "IsInSplitTableRow should only be called for frames in tables" );
// find most upper row frame
const SwFrm* pRow = this;
@@ -1786,7 +1764,7 @@ const SwRowFrm* SwFrm::IsInFollowFlowRow() const
if ( !pRow ) return NULL;
- ASSERT( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" )
+ OSL_ENSURE( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" );
const SwTabFrm* pTab = (SwTabFrm*)pRow->GetUpper();
@@ -1830,3 +1808,5 @@ const SwFrm* SwLayoutFrm::GetLastLower() const
pRet = pRet->GetNext();
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index f5edaf5bbab4..c83532c0f454 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,9 +79,6 @@ sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
|*
|* SwFlowFrm::SwFlowFrm()
|*
-|* Ersterstellung MA 26. Apr. 95
-|* Letzte Aenderung MA 26. Apr. 95
-|*
|*************************************************************************/
@@ -116,9 +114,6 @@ sal_Bool SwFlowFrm::HasLockedFollow() const
|*
|* SwFlowFrm::IsKeepFwdMoveAllowed()
|*
-|* Ersterstellung MA 20. Jul. 94
-|* Letzte Aenderung MA 16. May. 95
-|*
|*************************************************************************/
@@ -147,10 +142,6 @@ sal_Bool SwFlowFrm::IsKeepFwdMoveAllowed()
|*
|* SwFlowFrm::CheckKeep()
|*
-|* Beschreibung
-|* Ersterstellung MA 20. Jun. 95
-|* Letzte Aenderung MA 09. Apr. 97
-|*
|*************************************************************************/
@@ -190,9 +181,6 @@ void SwFlowFrm::CheckKeep()
|*
|* SwFlowFrm::IsKeep()
|*
-|* Ersterstellung MA 09. Apr. 97
-|* Letzte Aenderung MA 09. Apr. 97
-|*
|*************************************************************************/
sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep ) const
@@ -208,8 +196,8 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
( !rThis.IsInTab() || rThis.IsTabFrm() ) &&
rAttrs.GetKeep().GetValue() );
- ASSERT( !bCheckIfLastRowShouldKeep || rThis.IsTabFrm(),
- "IsKeep with bCheckIfLastRowShouldKeep should only be used for tabfrms" )
+ OSL_ENSURE( !bCheckIfLastRowShouldKeep || rThis.IsTabFrm(),
+ "IsKeep with bCheckIfLastRowShouldKeep should only be used for tabfrms" );
// Ignore keep attribute if there are break situations:
if ( bKeep )
@@ -266,7 +254,7 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
if ( ! pSet )
pSet = pNxt->GetAttrSet();
- ASSERT( pSet, "No AttrSet to check keep attribute" )
+ OSL_ENSURE( pSet, "No AttrSet to check keep attribute" );
if ( pSet->GetPageDesc().GetPageDesc() )
bKeep = sal_False;
@@ -290,9 +278,6 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
|*
|* SwFlowFrm::BwdMoveNecessary()
|*
-|* Ersterstellung MA 20. Jul. 94
-|* Letzte Aenderung MA 02. May. 96
-|*
|*************************************************************************/
@@ -382,7 +367,7 @@ sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRe
GetFmt())->GetSectionNode();
else
{
- ASSERT( rThis.IsTabFrm(), "new FowFrm?" );
+ OSL_ENSURE( rThis.IsTabFrm(), "new FowFrm?" );
pNode = ((SwTabFrm&)rThis).GetTable()->
GetTabSortBoxes()[0]->GetSttNd()->FindTableNode();
}
@@ -409,8 +394,6 @@ sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRe
|* Beschreibung Eine Spezialisierte Form des Cut() und Paste(), die
|* eine ganze Kette umhaengt (naehmlich this und folgende). Dabei werden
|* nur minimale Operationen und Benachrichtigungen ausgefuehrt.
-|* Ersterstellung MA 18. Mar. 93
-|* Letzte Aenderung MA 18. May. 95
|*
|*************************************************************************/
@@ -466,7 +449,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
//Kann sein, dass der CntFrm gelockt ist, wir wollen hier nicht
//in eine endlose Seitenwanderung hineinlaufen und rufen das
//Calc garnicht erst!
- ASSERT( pCnt->IsTxtFrm(), "Die Graphic ist gelandet." );
+ OSL_ENSURE( pCnt->IsTxtFrm(), "Die Graphic ist gelandet." );
if ( ((SwTxtFrm*)pCnt)->IsLocked() ||
((SwTxtFrm*)pCnt)->GetFollow() == pStart )
break;
@@ -600,8 +583,8 @@ sal_Bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibl
void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
{
- ASSERT( pParent, "Kein Parent uebergeben." );
- ASSERT( rThis.GetUpper(), "Wo kommen wir denn her?" );
+ OSL_ENSURE( pParent, "Kein Parent uebergeben." );
+ OSL_ENSURE( rThis.GetUpper(), "Wo kommen wir denn her?" );
//Sparsamer benachrichtigen wenn eine Action laeuft.
ViewShell *pSh = rThis.GetShell();
@@ -686,9 +669,6 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
|*
|* SwFlowFrm::IsAnFollow()
|*
-|* Ersterstellung MA 26. Apr. 95
-|* Letzte Aenderung MA 26. Apr. 95
-|*
|*************************************************************************/
@@ -708,14 +688,11 @@ sal_Bool SwFlowFrm::IsAnFollow( const SwFlowFrm *pAssumed ) const
|*
|* SwFlowFrm::FindMaster()
|*
-|* Ersterstellung MA 26. Apr. 95
-|* Letzte Aenderung MA 26. Apr. 95
-|*
|*************************************************************************/
SwTxtFrm* SwCntntFrm::FindMaster() const
{
- ASSERT( IsFollow(), "SwCntntFrm::FindMaster(): !IsFollow" );
+ OSL_ENSURE( IsFollow(), "SwCntntFrm::FindMaster(): !IsFollow" );
const SwCntntFrm* pCnt = GetPrevCntntFrm();
@@ -723,19 +700,19 @@ SwTxtFrm* SwCntntFrm::FindMaster() const
{
if ( pCnt->HasFollow() && pCnt->GetFollow() == this )
{
- ASSERT( pCnt->IsTxtFrm(), "NoTxtFrm with follow found" )
+ OSL_ENSURE( pCnt->IsTxtFrm(), "NoTxtFrm with follow found" );
return (SwTxtFrm*)pCnt;
}
pCnt = pCnt->GetPrevCntntFrm();
}
- ASSERT( sal_False, "Follow ist lost in Space." );
+ OSL_ENSURE( sal_False, "Follow ist lost in Space." );
return 0;
}
SwSectionFrm* SwSectionFrm::FindMaster() const
{
- ASSERT( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" );
+ OSL_ENSURE( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" );
SwClientIter aIter( *pSection->GetFmt() );
SwClient *pLast = aIter.GoStart();
@@ -744,8 +721,8 @@ SwSectionFrm* SwSectionFrm::FindMaster() const
{
if ( pLast->ISA( SwFrm ) )
{
- ASSERT( ((SwFrm*)pLast)->IsSctFrm(),
- "Non-section frame registered in section format" )
+ OSL_ENSURE( ((SwFrm*)pLast)->IsSctFrm(),
+ "Non-section frame registered in section format" );
SwSectionFrm* pSect = (SwSectionFrm*)pLast;
if( pSect->GetFollow() == this )
return pSect;
@@ -753,13 +730,13 @@ SwSectionFrm* SwSectionFrm::FindMaster() const
pLast = aIter++;
}
- ASSERT( sal_False, "Follow ist lost in Space." );
+ OSL_ENSURE( sal_False, "Follow ist lost in Space." );
return 0;
}
SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
{
- ASSERT( IsFollow(), "SwTabFrm::FindMaster(): !IsFollow" );
+ OSL_ENSURE( IsFollow(), "SwTabFrm::FindMaster(): !IsFollow" );
SwClientIter aIter( *GetTable()->GetFrmFmt() );
SwClient* pLast = aIter.GoStart();
@@ -768,8 +745,8 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
{
if ( pLast->ISA( SwFrm ) )
{
- ASSERT( ((SwFrm*)pLast)->IsTabFrm(),
- "Non-table frame registered in table format" )
+ OSL_ENSURE( ((SwFrm*)pLast)->IsTabFrm(),
+ "Non-table frame registered in table format" );
SwTabFrm* pTab = (SwTabFrm*)pLast;
if ( bFirstMaster )
@@ -799,7 +776,7 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
pLast = aIter++;
}
- ASSERT( sal_False, "Follow ist lost in Space." );
+ OSL_ENSURE( sal_False, "Follow ist lost in Space." );
return 0;
}
@@ -811,8 +788,6 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
|* das _nicht_ unterhalb von this liegt (oder gar this selbst ist).
|* Ausserdem muss dieses LayoutBlatt im gleichen Textfluss wie
|* pAnch Ausgangsfrm liegen (Body, Ftn)
-|* Ersterstellung MA 25. Nov. 92
-|* Letzte Aenderung MA 25. Apr. 95
|*
|*************************************************************************/
@@ -850,9 +825,6 @@ const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd,
|*
|* Beschreibung Ruft Get[Next|Prev]Leaf
|*
-|* Ersterstellung MA 20. Mar. 93
-|* Letzte Aenderung MA 25. Apr. 95
-|*
|*************************************************************************/
@@ -975,15 +947,12 @@ sal_Bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|* Frame gemoved werden kann.
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 05. Dec. 96
-|*
|*************************************************************************/
SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
{
- ASSERT( !IsInFtn(), "GetNextLeaf(), don't call me for Ftn." );
- ASSERT( !IsInSct(), "GetNextLeaf(), don't call me for Sections." );
+ OSL_ENSURE( !IsInFtn(), "GetNextLeaf(), don't call me for Ftn." );
+ OSL_ENSURE( !IsInSct(), "GetNextLeaf(), don't call me for Sections." );
const sal_Bool bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
//Will ich auch im Body landen.
@@ -1118,15 +1087,13 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
|*
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|* Frame gemoved werden kann.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 25. Apr. 95
|*
|*************************************************************************/
SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType )
{
- ASSERT( !IsInFtn(), "GetPrevLeaf(), don't call me for Ftn." );
+ OSL_ENSURE( !IsInFtn(), "GetPrevLeaf(), don't call me for Ftn." );
const sal_Bool bBody = IsInDocBody(); //Wenn ich aus dem DocBody komme
//will ich auch im Body landen.
@@ -1161,9 +1128,6 @@ SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType )
|*
|* SwFlowFrm::IsPrevObjMove()
|*
-|* Ersterstellung MA 20. Feb. 96
-|* Letzte Aenderung MA 22. Feb. 96
-|*
|*************************************************************************/
@@ -1180,7 +1144,7 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
if ( pPre && pPre->GetDrawObjs() )
{
- ASSERT( SwFlowFrm::CastFlowFrm( pPre ), "new flowfrm?" );
+ OSL_ENSURE( SwFlowFrm::CastFlowFrm( pPre ), "new flowfrm?" );
if( SwFlowFrm::CastFlowFrm( pPre )->IsAnFollow( this ) )
return sal_False;
SwLayoutFrm* pPreUp = pPre->GetUpper();
@@ -1243,8 +1207,6 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
|* im FrmFmt ein PageDesc angegeben wird.
|* Die Implementierung arbeitet zuaechst nur auf CntntFrms!
|* -->Fuer LayoutFrms ist die Definition des Vorgaengers unklar.
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 21. Mar. 95
|*
|*************************************************************************/
@@ -1265,7 +1227,7 @@ sal_Bool SwFlowFrm::IsPageBreak( sal_Bool bAct ) const
if ( pPrev )
{
- ASSERT( pPrev->IsInDocBody(), "IsPageBreak: Not in DocBody?" );
+ OSL_ENSURE( pPrev->IsInDocBody(), "IsPageBreak: Not in DocBody?" );
if ( bAct )
{ if ( rThis.FindPageFrm() == pPrev->FindPageFrm() )
return sal_False;
@@ -1307,8 +1269,6 @@ sal_Bool SwFlowFrm::IsPageBreak( sal_Bool bAct ) const
|* gibt ist jede weitere Ueberlegung ueberfluessig.
|* Die Implementierung arbeitet zuaechst nur auf CntntFrms!
|* -->Fuer LayoutFrms ist die Definition des Vorgaengers unklar.
-|* Ersterstellung MA 11. Jun. 93
-|* Letzte Aenderung MA 21. Mar. 95
|*
|*************************************************************************/
@@ -1372,7 +1332,7 @@ sal_Bool SwFlowFrm::HasParaSpaceAtPages( sal_Bool bSct ) const
return sal_False;
pTmp = pTmp->GetUpper();
}
- ASSERT( sal_False, "HasParaSpaceAtPages: Where's my page?" );
+ OSL_ENSURE( sal_False, "HasParaSpaceAtPages: Where's my page?" );
return sal_False;
}
if( !rThis.IsInDocBody() || ( rThis.IsInTab() && !rThis.IsTabFrm()) ||
@@ -1683,7 +1643,7 @@ SwTwips SwFlowFrm::_GetUpperSpaceAmountConsideredForPageGrid(
nUpperSpaceAmountConsideredForPageGrid =
nNewUpperSpace - _nUpperSpaceWithoutGrid;
- ASSERT( nUpperSpaceAmountConsideredForPageGrid >= 0,
+ OSL_ENSURE( nUpperSpaceAmountConsideredForPageGrid >= 0,
"<SwFlowFrm::GetUpperSpaceAmountConsideredForPageGrid(..)> - negative space considered for page grid!" );
}
}
@@ -1846,8 +1806,6 @@ SwTwips SwFlowFrm::CalcAddLowerSpaceAsLastInTableCell(
|*
|* Beschreibung Moved den Frm vorwaerts wenn es durch die aktuellen
|* Bedingungen und Attribute notwendig erscheint.
-|* Ersterstellung MA 05. Dec. 96
-|* Letzte Aenderung MA 09. Mar. 98
|*
|*************************************************************************/
@@ -1941,8 +1899,6 @@ sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool
|* sal_Bool SwFlowFrm::MoveFwd()
|*
|* Beschreibung Returnwert sagt, ob der Frm die Seite gewechselt hat.
-|* Ersterstellung MA 05. Dec. 96
-|* Letzte Aenderung MA 05. Dec. 96
|*
|*************************************************************************/
@@ -1970,11 +1926,6 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
( rThis.GetUpper()->IsInTab() &&
rThis.GetUpper()->FindTabFrm()->IsFwdMoveAllowed() ) ) &&
0 != const_cast<SwFrm&>(rThis).GetNextCellLeaf( MAKEPAGE_NONE ) )
-/*
- &&
- // NEW TABLES
- // Have a look at our main competitor: We don't move inside row span cells:
- ( !rThis.GetUpper()->IsCellFrm() || !rThis.GetUpper()->IsLeaveUpperAllowed() ) )*/
{
bNoFwd = sal_False;
}
@@ -2056,7 +2007,7 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
(pOldBoss->Frm().*fnRect->fnGetBottom)() );
SwCntntFrm* pStart = rThis.IsCntntFrm() ?
(SwCntntFrm*)&rThis : ((SwLayoutFrm&)rThis).ContainsCntnt();
- ASSERT( pStart || ( rThis.IsTabFrm() && !((SwTabFrm&)rThis).Lower() ),
+ OSL_ENSURE( pStart || ( rThis.IsTabFrm() && !((SwTabFrm&)rThis).Lower() ),
"MoveFwd: Missing Content" );
SwLayoutFrm* pBody = pStart ? ( pStart->IsTxtFrm() ?
(SwLayoutFrm*)((SwTxtFrm*)pStart)->FindBodyFrm() : 0 ) : 0;
@@ -2149,8 +2100,6 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
|* Beschreibung Returnwert sagt, ob der Frm die Seite wechseln soll.
|* Sollte von abgeleiteten Klassen gerufen werden.
|* Das moven selbst muessen die abgeleiteten uebernehmen.
-|* Ersterstellung MA 05. Dec. 96
-|* Letzte Aenderung MA 05. Dec. 96
|*
|*************************************************************************/
@@ -2208,7 +2157,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
pRef = pFtn->GetRef();
// <--
- ASSERT( pRef, "MoveBwd: Endnote for an empty section?" );
+ OSL_ENSURE( pRef, "MoveBwd: Endnote for an empty section?" );
if( !bEndnote )
pOldBoss = pOldBoss->FindFtnBossFrm( sal_True );
@@ -2544,7 +2493,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
}
pIndNext = pIndNext->GetIndNext();
}
- ASSERT( !pIndNext || pIndNext->ISA(SwTxtFrm),
+ OSL_ENSURE( !pIndNext || pIndNext->ISA(SwTxtFrm),
"<SwFlowFrm::MovedBwd(..)> - incorrect next found." );
if ( pIndNext && pIndNext->IsFlowFrm() &&
SwFlowFrm::CastFlowFrm(pIndNext)->IsJoinLocked() )
@@ -2569,7 +2518,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
: MAKEPAGE_NONE,
sal_True );
// --> OD 2007-01-10 #i73194# - make code robust
- ASSERT( pNextNewUpper, "<SwFlowFrm::MoveBwd(..)> - missing next new upper" );
+ OSL_ENSURE( pNextNewUpper, "<SwFlowFrm::MoveBwd(..)> - missing next new upper" );
if ( pNextNewUpper &&
( pNextNewUpper == rThis.GetUpper() ||
pNextNewUpper->GetType() != rThis.GetUpper()->GetType() ) )
@@ -2577,14 +2526,14 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
pNewUpper = 0L;
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFlowFrm::MoveBwd(..)> - layout loop control for layout action <Move Backward> applied!" );
#endif
}
}
// <--
- ASSERT( pNewUpper != rThis.GetUpper(),
+ OSL_ENSURE( pNewUpper != rThis.GetUpper(),
"<SwFlowFrm::MoveBwd(..)> - moving backward to the current upper frame!? -> Please inform OD." );
if ( pNewUpper )
{
@@ -2708,9 +2657,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
|*
|* SwFlowFrm::CastFlowFrm
|*
-|* Ersterstellung MA 03. May. 95
-|* Letzte Aenderung AMA 02. Dec. 97
-|*
|*************************************************************************/
SwFlowFrm *SwFlowFrm::CastFlowFrm( SwFrm *pFrm )
@@ -2734,3 +2680,5 @@ const SwFlowFrm *SwFlowFrm::CastFlowFrm( const SwFrm *pFrm )
return (SwSectionFrm*)pFrm;
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8cd4253f6ddc..c80aed84caeb 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,7 +81,6 @@
#include "pam.hxx"
#include "frmatr.hxx"
#include "viewimp.hxx"
-#include "errhdl.hxx"
#include "dcontact.hxx"
#include "dflyobj.hxx"
#include "dview.hxx"
@@ -109,9 +109,6 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
|*
|* SwFlyFrm::SwFlyFrm()
|*
-|* Ersterstellung MA 28. Sep. 92
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
@@ -218,7 +215,7 @@ void SwFlyFrm::Chain( SwFrm* _pAnch )
SwFlyFrm* pFollow = FindChainNeighbour( *rChain.GetNext(), _pAnch );
if ( pFollow )
{
- ASSERT( !pFollow->GetPrevLink(), "wrong chain detected" );
+ OSL_ENSURE( !pFollow->GetPrevLink(), "wrong chain detected" );
if ( !pFollow->GetPrevLink() )
SwFlyFrm::ChainFrames( this, pFollow );
}
@@ -228,7 +225,7 @@ void SwFlyFrm::Chain( SwFrm* _pAnch )
SwFlyFrm *pMaster = FindChainNeighbour( *rChain.GetPrev(), _pAnch );
if ( pMaster )
{
- ASSERT( !pMaster->GetNextLink(), "wrong chain detected" );
+ OSL_ENSURE( !pMaster->GetNextLink(), "wrong chain detected" );
if ( !pMaster->GetNextLink() )
SwFlyFrm::ChainFrames( pMaster, this );
}
@@ -242,7 +239,7 @@ void SwFlyFrm::InsertCnt()
if ( !GetPrevLink() )
{
const SwFmtCntnt& rCntnt = GetFmt()->GetCntnt();
- ASSERT( rCntnt.GetCntntIdx(), ":-( no content prepared." );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), ":-( no content prepared." );
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,
@@ -264,7 +261,7 @@ void SwFlyFrm::InsertCnt()
// Check, if column are allowed.
// Columns are not allowed for fly frames, which represent graphics or embedded objects.
const SwFmtCntnt& rCntnt = GetFmt()->GetCntnt();
- ASSERT( rCntnt.GetCntntIdx(), "<SwFlyFrm::InsertColumns()> - no content prepared." );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "<SwFlyFrm::InsertColumns()> - no content prepared." );
SwNodeIndex aFirstCntnt( *(rCntnt.GetCntntIdx()), 1 );
if ( aFirstCntnt.GetNode().IsNoTxtNode() )
{
@@ -290,9 +287,6 @@ void SwFlyFrm::InsertCnt()
|*
|* SwFlyFrm::~SwFlyFrm()
|*
-|* Ersterstellung MA 28. Sep. 92
-|* Letzte Aenderung MA 07. Jul. 95
-|*
|*************************************************************************/
SwFlyFrm::~SwFlyFrm()
@@ -390,9 +384,6 @@ void SwFlyFrm::DeleteCnt()
|*
|* SwFlyFrm::InitDrawObj()
|*
-|* Ersterstellung MA 02. Dec. 94
-|* Letzte Aenderung MA 30. Nov. 95
-|*
|*************************************************************************/
void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
{
@@ -410,7 +401,7 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
pIDDMA->GetOrCreateDrawModel() );
// <--
}
- ASSERT( pContact, "InitDrawObj failed" );
+ OSL_ENSURE( pContact, "InitDrawObj failed" );
// OD 2004-03-22 #i26791#
SetDrawObj( *(pContact->CreateNewRef( this )) );
@@ -430,9 +421,6 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
|*
|* SwFlyFrm::FinitDrawObj()
|*
-|* Ersterstellung MA 12. Dec. 94
-|* Letzte Aenderung MA 15. May. 95
-|*
|*************************************************************************/
void SwFlyFrm::FinitDrawObj()
@@ -495,16 +483,13 @@ void SwFlyFrm::FinitDrawObj()
|*
|* SwFlyFrm::ChainFrames()
|*
-|* Ersterstellung MA 29. Oct. 97
-|* Letzte Aenderung MA 20. Jan. 98
-|*
|*************************************************************************/
void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
{
- ASSERT( pMaster && pFollow, "uncomplete chain" );
- ASSERT( !pMaster->GetNextLink(), "link can not be changed" );
- ASSERT( !pFollow->GetPrevLink(), "link can not be changed" );
+ OSL_ENSURE( pMaster && pFollow, "uncomplete chain" );
+ OSL_ENSURE( !pMaster->GetNextLink(), "link can not be changed" );
+ OSL_ENSURE( !pFollow->GetPrevLink(), "link can not be changed" );
pMaster->pNextLink = pFollow;
pFollow->pPrevLink = pMaster;
@@ -533,7 +518,7 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
//Es gibt nur noch den Inhalt des Masters, der Inhalt vom Follow
//hat keine Frames mehr (sollte immer nur genau ein leerer TxtNode sein).
SwFrm *pFrm = pFollow->ContainsCntnt();
- ASSERT( !pFrm->IsTabFrm() && !pFrm->FindNext(), "follow in chain contains content" );
+ OSL_ENSURE( !pFrm->IsTabFrm() && !pFrm->FindNext(), "follow in chain contains content" );
pFrm->Cut();
delete pFrm;
}
@@ -558,7 +543,7 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
{
pUpper = static_cast<SwLayoutFrm*>(pUpper->GetLastLower());
pUpper = static_cast<SwLayoutFrm*>(pUpper->Lower()); // der (Column)BodyFrm
- ASSERT( pUpper && pUpper->IsColBodyFrm(), "Missing ColumnBody" );
+ OSL_ENSURE( pUpper && pUpper->IsColBodyFrm(), "Missing ColumnBody" );
}
SwFlyFrm *pFoll = pFollow;
while ( pFoll )
@@ -574,7 +559,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." );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), ":-( Kein Inhalt vorbereitet." );
sal_uLong nIndex = rCntnt.GetCntntIdx()->GetIndex();
// Lower() bedeutet SwColumnFrm, dieser beinhaltet wieder einen SwBodyFrm
::_InsertCnt( pFollow->Lower() ? (SwLayoutFrm*)((SwLayoutFrm*)pFollow->Lower())->Lower()
@@ -591,9 +576,6 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
|*
|* SwFlyFrm::FindChainNeighbour()
|*
-|* Ersterstellung MA 11. Nov. 97
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
@@ -637,7 +619,7 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
}
else if ( pFly )
{
- ASSERT( !aIter.Next(), "chain with more than one inkarnation" );
+ OSL_ENSURE( !aIter.Next(), "chain with more than one inkarnation" );
}
return pFly;
}
@@ -647,9 +629,6 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
|*
|* SwFlyFrm::FindLastLower()
|*
-|* Ersterstellung MA 29. Oct. 97
-|* Letzte Aenderung MA 29. Oct. 97
-|*
|*************************************************************************/
SwFrm *SwFlyFrm::FindLastLower()
@@ -670,9 +649,6 @@ SwFrm *SwFlyFrm::FindLastLower()
|*
|* SwFlyFrm::FrmSizeChg()
|*
-|* Ersterstellung MA 17. Dec. 92
-|* Letzte Aenderung MA 24. Jul. 96
-|*
|*************************************************************************/
sal_Bool SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
@@ -730,9 +706,6 @@ sal_Bool SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
|*
|* SwFlyFrm::Modify()
|*
-|* Ersterstellung MA 17. Dec. 92
-|* Letzte Aenderung MA 17. Jan. 97
-|*
|*************************************************************************/
void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
@@ -1110,8 +1083,6 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
|* SwFlyFrm::GetInfo()
|*
|* Beschreibung erfragt Informationen
-|* Ersterstellung JP 31.03.94
-|* Letzte Aenderung JP 31.03.94
|*
*************************************************************************/
@@ -1127,9 +1098,6 @@ sal_Bool SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const
|*
|* SwFlyFrm::_Invalidate()
|*
-|* Ersterstellung MA 15. Oct. 92
-|* Letzte Aenderung MA 26. Jun. 96
-|*
|*************************************************************************/
void SwFlyFrm::_Invalidate( SwPageFrm *pPage )
@@ -1169,8 +1137,6 @@ void SwFlyFrm::_Invalidate( SwPageFrm *pPage )
|*
|* Beschreibung Aenderung der relativen Position, die Position wird
|* damit automatisch Fix, das Attribut wird entprechend angepasst.
-|* Ersterstellung MA 25. Aug. 92
-|* Letzte Aenderung MA 09. Aug. 95
|*
|*************************************************************************/
@@ -1212,7 +1178,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
aVert.SetVertOrient( text::VertOrientation::NONE );
xub_StrLen nOfs =
pFmt->GetAnchor().GetCntntAnchor()->nContent.GetIndex();
- ASSERT( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected" );
+ OSL_ENSURE( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected" );
pAutoFrm = (SwTxtFrm*)GetAnchorFrm();
while( pAutoFrm->GetFollow() &&
pAutoFrm->GetFollow()->GetOfst() <= nOfs )
@@ -1269,7 +1235,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
{
xub_StrLen nOfs = pFmt->GetAnchor().GetCntntAnchor()
->nContent.GetIndex();
- ASSERT( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected");
+ OSL_ENSURE( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected");
pAutoFrm = (SwTxtFrm*)GetAnchorFrm();
while( pAutoFrm->GetFollow() &&
pAutoFrm->GetFollow()->GetOfst() <= nOfs )
@@ -1295,14 +1261,12 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
|*
|* Beschreibung: "Formatiert" den Frame; Frm und PrtArea.
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 14. Jun. 93
-|* Letzte Aenderung MA 13. Jun. 96
|*
|*************************************************************************/
void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
{
- ASSERT( pAttrs, "FlyFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "FlyFrm::Format, pAttrs ist 0." );
ColLock();
@@ -1328,8 +1292,8 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
const SwFmtFrmSize &rFrmSz = GetFmt()->GetFrmSize();
Size aRelSize( CalcRel( rFrmSz ) );
- ASSERT( pAttrs->GetSize().Height() != 0 || rFrmSz.GetHeightPercent(), "Hoehe des RahmenAttr ist 0." );
- ASSERT( pAttrs->GetSize().Width() != 0 || rFrmSz.GetWidthPercent(), "Breite des RahmenAttr ist 0." );
+ OSL_ENSURE( pAttrs->GetSize().Height() != 0 || rFrmSz.GetHeightPercent(), "Hoehe des RahmenAttr ist 0." );
+ OSL_ENSURE( pAttrs->GetSize().Width() != 0 || rFrmSz.GetWidthPercent(), "Breite des RahmenAttr ist 0." );
SWRECTFN( this )
if( !HasFixSize() )
@@ -1440,7 +1404,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
if ( !bFormatHeightOnly )
{
- ASSERT( aRelSize == CalcRel( rFrmSz ), "SwFlyFrm::Format CalcRel problem" )
+ OSL_ENSURE( aRelSize == CalcRel( rFrmSz ), "SwFlyFrm::Format CalcRel problem" );
SwTwips nNewSize = bVert ? aRelSize.Height() : aRelSize.Width();
if ( rFrmSz.GetWidthSizeType() != ATT_FIX_SIZE )
@@ -1647,7 +1611,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
bAgain = true;
if ( pAgainObj2 == pAnchoredObj )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"::CalcCntnt(..) - loop detected, perform attribute changes to avoid the loop" );
//Oszillation unterbinden.
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
@@ -1732,7 +1696,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
continue;
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in CalcCntnt" )
+ OSL_ENSURE( false, "LoopControl in CalcCntnt" );
#endif
}
}
@@ -1804,9 +1768,6 @@ void CalcCntnt( SwLayoutFrm *pLay,
|*
|* SwFlyFrm::MakeFlyPos()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 14. Nov. 96
-|*
|*************************************************************************/
// OD 2004-03-23 #i26791#
//void SwFlyFrm::MakeFlyPos()
@@ -1840,9 +1801,6 @@ void SwFlyFrm::MakeObjPos()
|*
|* SwFlyFrm::MakePrtArea()
|*
-|* Ersterstellung MA 23. Jun. 93
-|* Letzte Aenderung MA 23. Jun. 93
-|*
|*************************************************************************/
void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
{
@@ -1864,9 +1822,6 @@ void SwFlyFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
|*
|* SwFlyFrm::_Grow(), _Shrink()
|*
-|* Ersterstellung MA 05. Oct. 92
-|* Letzte Aenderung MA 05. Sep. 96
-|*
|*************************************************************************/
SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
@@ -2055,9 +2010,6 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
|*
|* SwFlyFrm::ChgSize()
|*
-|* Ersterstellung MA 05. Oct. 92
-|* Letzte Aenderung MA 04. Sep. 96
-|*
|*************************************************************************/
Size SwFlyFrm::ChgSize( const Size& aNewSize )
@@ -2108,14 +2060,11 @@ Size SwFlyFrm::ChgSize( const Size& aNewSize )
|*
|* SwFlyFrm::IsLowerOf()
|*
-|* Ersterstellung MA 27. Dec. 93
-|* Letzte Aenderung MA 27. Dec. 93
-|*
|*************************************************************************/
sal_Bool SwFlyFrm::IsLowerOf( const SwLayoutFrm* pUpperFrm ) const
{
- ASSERT( GetAnchorFrm(), "8-( Fly is lost in Space." );
+ OSL_ENSURE( GetAnchorFrm(), "8-( Fly is lost in Space." );
const SwFrm* pFrm = GetAnchorFrm();
do
{
@@ -2132,9 +2081,6 @@ sal_Bool SwFlyFrm::IsLowerOf( const SwLayoutFrm* pUpperFrm ) const
|*
|* SwFlyFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
void SwFlyFrm::Cut()
@@ -2145,9 +2091,6 @@ void SwFlyFrm::Cut()
|*
|* SwFrm::AppendFly(), RemoveFly()
|*
-|* Ersterstellung MA 25. Aug. 92
-|* Letzte Aenderung MA 09. Jun. 95
-|*
|*************************************************************************/
void SwFrm::AppendFly( SwFlyFrm *pNew )
@@ -2244,7 +2187,7 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
{
if ( !_rNewObj.ISA(SwAnchoredDrawObject) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"SwFrm::AppendDrawObj(..) - anchored object of unexcepted type -> object not appended" );
return;
}
@@ -2333,9 +2276,6 @@ void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
|*
|* SwFrm::InvalidateObjs()
|*
-|* Ersterstellung MA 29. Nov. 96
-|* Letzte Aenderung MA 29. Nov. 96
-|*
|*************************************************************************/
// --> OD 2004-07-01 #i28701# - change purpose of method and adjust its name
void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
@@ -2474,7 +2414,7 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
}
else
{
- ASSERT( pObj->ISA(SwAnchoredDrawObject),
+ OSL_ENSURE( pObj->ISA(SwAnchoredDrawObject),
"<SwLayoutFrm::NotifyFlys() - anchored object of unexcepted type" );
// --> OD 2004-10-08 #i26945# - use <pAnchorFrm> to check, if
// fly frame is lower of layout frame resp. if fly frame is
@@ -2500,9 +2440,6 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
|*
|* SwFlyFrm::NotifyDrawObj()
|*
-|* Ersterstellung OK 22. Nov. 94
-|* Letzte Aenderung MA 10. Jan. 97
-|*
|*************************************************************************/
void SwFlyFrm::NotifyDrawObj()
@@ -2520,9 +2457,6 @@ void SwFlyFrm::NotifyDrawObj()
|*
|* SwFlyFrm::CalcRel()
|*
-|* Ersterstellung MA 13. Jun. 96
-|* Letzte Aenderung MA 10. Oct. 96
-|*
|*************************************************************************/
Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const
@@ -2643,32 +2577,8 @@ SwTwips SwFlyFrm::CalcAutoWidth() const
/*************************************************************************
|*
-|* SwFlyFrm::AddSpacesToFrm
-|*
-|* Ersterstellung MA 11. Nov. 96
-|* Letzte Aenderung MA 10. Mar. 97
-|*
-|*************************************************************************/
-
-//SwRect SwFlyFrm::AddSpacesToFrm() const
-//{
-// SwRect aRect( Frm() );
-// const SvxULSpaceItem &rUL = GetFmt()->GetULSpace();
-// const SvxLRSpaceItem &rLR = GetFmt()->GetLRSpace();
-// aRect.Left( Max( aRect.Left() - long(rLR.GetLeft()), 0L ) );
-// aRect.SSize().Width() += rLR.GetRight();
-// aRect.Top( Max( aRect.Top() - long(rUL.GetUpper()), 0L ) );
-// aRect.SSize().Height()+= rUL.GetLower();
-// return aRect;
-//}
-
-/*************************************************************************
-|*
|* SwFlyFrm::GetContour()
|*
-|* Ersterstellung MA 09. Jan. 97
-|* Letzte Aenderung MA 10. Jan. 97
-|*
|*************************************************************************/
/// OD 16.04.2003 #i13147# - If called for paint and the <SwNoTxtFrm> contains
/// a graphic, load of intrinsic graphic has to be avoided.
@@ -2695,7 +2605,7 @@ sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour,
pGrfObj = new GraphicObject( pNd->GetGraphic() );
bGrfObjCreated = sal_True;
}
- ASSERT( pGrfObj, "SwFlyFrm::GetContour() - No Graphic/GraphicObject found at <SwNoTxtNode>." );
+ OSL_ENSURE( pGrfObj, "SwFlyFrm::GetContour() - No Graphic/GraphicObject found at <SwNoTxtNode>." );
if ( pGrfObj && pGrfObj->GetType() != GRAPHIC_NONE )
{
if( !pNd->HasContour() )
@@ -2704,7 +2614,7 @@ sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour,
// 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." );
+ OSL_ENSURE( false, "SwFlyFrm::GetContour() - No Contour found at <SwNoTxtNode> during paint." );
return bRet;
}
pNd->CreateContour();
@@ -2724,8 +2634,6 @@ sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour,
const MapMode aDispMap( MAP_TWIP );
const MapMode aGrfMap( pGrfObj->GetPrefMapMode() );
const Size aGrfSize( pGrfObj->GetPrefSize() );
- double fScaleX;
- double fScaleY;
Size aOrgSize;
Point aNewPoint;
sal_Bool bPixelMap = aGrfMap.GetMapUnit() == MAP_PIXEL;
@@ -2737,8 +2645,8 @@ sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour,
if ( aOrgSize.Width() && aOrgSize.Height() )
{
- fScaleX = (double) aOrig.Width() / aOrgSize.Width();
- fScaleY = (double) aOrig.Height() / aOrgSize.Height();
+ double fScaleX = (double) aOrig.Width() / aOrgSize.Width();
+ double fScaleY = (double) aOrig.Height() / aOrgSize.Height();
for ( sal_uInt16 j = 0, nPolyCount = rContour.Count(); j < nPolyCount; j++ )
{
@@ -2798,13 +2706,13 @@ void SwFlyFrm::InvalidateObjPos()
SwFrmFmt& SwFlyFrm::GetFrmFmt()
{
- ASSERT( GetFmt(),
+ OSL_ENSURE( GetFmt(),
"<SwFlyFrm::GetFrmFmt()> - missing frame format -> crash." );
return *GetFmt();
}
const SwFrmFmt& SwFlyFrm::GetFrmFmt() const
{
- ASSERT( GetFmt(),
+ OSL_ENSURE( GetFmt(),
"<SwFlyFrm::GetFrmFmt()> - missing frame format -> crash." );
return *GetFmt();
}
@@ -2875,3 +2783,4 @@ SwFlyFrmFmt * SwFlyFrm::GetFmt()
return static_cast< SwFlyFrmFmt * >( GetDep() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 2a5b688e7110..cec345016d11 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,6 @@
#include "hints.hxx"
#include "ndtxt.hxx"
#include "swundo.hxx"
-#include "errhdl.hxx"
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <fmtanchr.hxx>
@@ -58,20 +58,12 @@
#include "crstate.hxx"
#include "sectfrm.hxx"
-// OD 29.10.2003 #113049#
#include <tocntntanchoredobjectposition.hxx>
-// OD 2004-05-24 #i28701#
#include <dcontact.hxx>
#include <sortedobjs.hxx>
-// --> OD 2005-09-29 #125370#,#125957#
#include <layouter.hxx>
-// <--
-// --> OD 2005-11-17 #i56300#
#include <objectformattertxtfrm.hxx>
-// <--
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
using namespace ::com::sun::star;
@@ -80,9 +72,6 @@ using namespace ::com::sun::star;
|*
|* SwFlyAtCntFrm::SwFlyAtCntFrm()
|*
-|* Ersterstellung MA 11. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
@@ -92,16 +81,12 @@ SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId());
}
-// --> OD 2004-06-29 #i28701#
+// #i28701#
TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm);
-// <--
/*************************************************************************
|*
|* SwFlyAtCntFrm::Modify()
|*
-|* Ersterstellung MA 08. Feb. 93
-|* Letzte Aenderung MA 23. Nov. 94
-|*
|*************************************************************************/
void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
@@ -124,7 +109,7 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( pAnch )
{
- ASSERT( pAnch->GetAnchorId() == GetFmt()->GetAnchor().GetAnchorId(),
+ OSL_ENSURE( pAnch->GetAnchorId() == GetFmt()->GetAnchor().GetAnchorId(),
"Unzulaessiger Wechsel des Ankertyps." );
//Abmelden, neuen Anker besorgen und 'dranhaengen.
@@ -150,13 +135,11 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
//immer noch vom Node einen Frame besorgen. Die Change, dass dies dann
//der richtige ist, ist gut.
const bool bNext = aOldIdx < aNewIdx;
- // --> OD 2006-02-28 #125892#
// consider the case that at found anchor frame candidate already a
// fly frame of the given fly format is registered.
- // --> OD 2006-03-15 #133407# - consider, that <pCntnt> is the already
+ // consider, that <pCntnt> is the already
// the new anchor frame.
bool bFound( aOldIdx == aNewIdx );
- // <--
while ( pCntnt && !bFound )
{
do
@@ -171,7 +154,6 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( pCntnt )
aOldIdx = *pCntnt->GetNode();
- // --> OD 2006-02-28 #125892#
// check, if at found anchor frame candidate already a fly frame
// of the given fly frame format is registered.
bFound = aOldIdx == aNewIdx;
@@ -190,14 +172,12 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
}
}
- // <--
}
- // <--
if ( !pCntnt )
{
SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode();
pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, sal_False );
- ASSERT( pCntnt, "Neuen Anker nicht gefunden" );
+ OSL_ENSURE( pCntnt, "Neuen Anker nicht gefunden" );
}
//Flys haengen niemals an einem Follow sondern immer am
//Master, den suchen wir uns jetzt.
@@ -215,7 +195,7 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
_InvalidatePos();
InvalidatePage();
SetNotifyBack();
- // --> OD 2004-06-24 #i28701# - reset member <maLastCharRect> and
+ // #i28701# - reset member <maLastCharRect> and
// <mnLastTopOfLine> for to-character anchored objects.
ClearCharRectAndTopOfLine();
}
@@ -246,13 +226,10 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
|* fall das Attribut des Rahmens auf automatische Ausrichtung oben
|* eingestellt.
|*
-|* Ersterstellung MA 12. Nov. 92
-|* Letzte Aenderung MA 20. Sep. 96
-|*
|*************************************************************************/
//Wir brauchen ein Paar Hilfsklassen zur Kontrolle der Ozillation und ein paar
//Funktionen um die Uebersicht zu gewaehrleisten.
-// OD 2004-08-25 #i3317# - re-factoring of the position stack
+// #i3317# - re-factoring of the position stack
class SwOszControl
{
static const SwFlyFrm *pStk1;
@@ -262,10 +239,9 @@ class SwOszControl
static const SwFlyFrm *pStk5;
const SwFlyFrm *pFly;
- // --> OD 2004-08-25 #i3317#
+ // #i3317#
sal_uInt8 mnPosStackSize;
std::vector<Point*> maObjPositions;
- // <--
public:
SwOszControl( const SwFlyFrm *pFrm );
@@ -281,9 +257,8 @@ const SwFlyFrm *SwOszControl::pStk5 = 0;
SwOszControl::SwOszControl( const SwFlyFrm *pFrm )
: pFly( pFrm ),
- // --> OD 2004-08-25 #i3317#
+ // #i3317#
mnPosStackSize( 20 )
- // <--
{
if ( !SwOszControl::pStk1 )
SwOszControl::pStk1 = pFly;
@@ -309,7 +284,7 @@ SwOszControl::~SwOszControl()
SwOszControl::pStk4 = 0;
else if ( SwOszControl::pStk5 == pFly )
SwOszControl::pStk5 = 0;
- // --> OD 2004-08-25 #i3317#
+ // #i3317#
while ( !maObjPositions.empty() )
{
Point* pPos = maObjPositions.back();
@@ -317,7 +292,6 @@ SwOszControl::~SwOszControl()
maObjPositions.pop_back();
}
- // <--
}
sal_Bool SwOszControl::IsInProgress( const SwFlyFrm *pFly )
@@ -353,7 +327,7 @@ bool SwOszControl::ChkOsz()
{
if ( *(pNewObjPos) == *(*aObjPosIter) )
{
- // position already occured -> oscillation
+ // position already occurred -> oscillation
bOscillationDetected = true;
delete pNewObjPos;
break;
@@ -370,7 +344,6 @@ bool SwOszControl::ChkOsz()
void SwFlyAtCntFrm::MakeAll()
{
- // OD 2004-01-19 #110582#
if ( !GetFmt()->GetDoc()->IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
{
return;
@@ -378,7 +351,7 @@ void SwFlyAtCntFrm::MakeAll()
if ( !SwOszControl::IsInProgress( this ) && !IsLocked() && !IsColLocked() )
{
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if( !GetPageFrm() && GetAnchorFrm() && GetAnchorFrm()->IsInFly() )
{
SwFlyFrm* pFly = AnchorFrm()->FindFlyFrm();
@@ -386,7 +359,7 @@ void SwFlyAtCntFrm::MakeAll()
if( pTmpPage )
pTmpPage->AppendFlyToPage( this );
}
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if( GetPageFrm() )
{
bSetCompletePaintOnInvalidate = sal_True;
@@ -409,74 +382,68 @@ void SwFlyAtCntFrm::MakeAll()
SwOszControl aOszCntrl( this );
- // --> OD 2005-02-22 #i43255#
- // --> OD 2005-06-07 #i50356# - format the anchor frame, which
+ // #i43255#
+ // #i50356# - format the anchor frame, which
// contains the anchor position. E.g., for at-character anchored
// object this can be the follow frame of the anchor frame.
const bool bFormatAnchor =
!static_cast<const SwTxtFrm*>( GetAnchorFrmContainingAnchPos() )->IsAnyJoinLocked() &&
!ConsiderObjWrapInfluenceOnObjPos() &&
!ConsiderObjWrapInfluenceOfOtherObjs();
- // <--
const SwFrm* pFooter = GetAnchorFrm()->FindFooterOrHeader();
if( pFooter && !pFooter->IsFooterFrm() )
pFooter = NULL;
bool bOsz = false;
sal_Bool bExtra = Lower() && Lower()->IsColumnFrm();
- // --> OD 2004-08-25 #i3317# - boolean, to apply temporarly the
+ // #i3317# - boolean, to apply temporarly the
// 'straightforward positioning process' for the frame due to its
// overlapping with a previous column.
bool bConsiderWrapInfluenceDueToOverlapPrevCol( false );
- // <--
- // --> OD 2004-10-22 #i35911# - boolean, to apply temporarly the
+ // #i35911# - boolean, to apply temporarly the
// 'straightforward positioning process' for the frame due to fact
// that it causes the complete content of its layout environment
// to move forward.
- // --> OD 2005-01-14 #i40444# - extend usage of this boolean:
+ // #i40444# - extend usage of this boolean:
// apply temporarly the 'straightforward positioning process' for
// the frame due to the fact that the frame clears the area for
// the anchor frame, thus it has to move forward.
bool bConsiderWrapInfluenceDueToMovedFwdAnchor( false );
- // <--
do {
SWRECTFN( this )
Point aOldPos( (Frm().*fnRect->fnGetPos)() );
SwFlyFreeFrm::MakeAll();
const bool bPosChgDueToOwnFormat =
aOldPos != (Frm().*fnRect->fnGetPos)();
- // --> OD 2004-08-25 #i3317#
+ // #i3317#
if ( !ConsiderObjWrapInfluenceOnObjPos() &&
OverlapsPrevColumn() )
{
bConsiderWrapInfluenceDueToOverlapPrevCol = true;
}
- // <--
- // OD 2004-05-12 #i28701# - no format of anchor frame, if
+ // #i28701# - no format of anchor frame, if
// wrapping style influence is considered on object positioning
if ( bFormatAnchor )
{
SwTxtFrm* pAnchPosAnchorFrm =
dynamic_cast<SwTxtFrm*>(GetAnchorFrmContainingAnchPos());
- ASSERT( pAnchPosAnchorFrm,
+ OSL_ENSURE( pAnchPosAnchorFrm,
"<SwFlyAtCntFrm::MakeAll()> - anchor frame of wrong type -> crash" );
- // --> OD 2006-01-27 #i58182# - For the usage of new method
+ // #i58182# - For the usage of new method
// <SwObjectFormatterTxtFrm::CheckMovedFwdCondition(..)>
// to check move forward of anchor frame due to the object
// positioning it's needed to know, if the object is anchored
// at the master frame before the anchor frame is formatted.
const bool bAnchoredAtMaster( !pAnchPosAnchorFrm->IsFollow() );
- // <--
- // --> OD 2005-11-17 #i56300#
+ // #i56300#
// perform complete format of anchor text frame and its
// previous frames, which have become invalid due to the
// fly frame format.
SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( *pAnchPosAnchorFrm );
- // <--
- // --> OD 2004-10-22 #i35911#
- // --> OD 2005-01-14 #i40444#
- // --> OD 2006-01-27 #i58182# - usage of new method
+ // #i35911#
+ // #i40444#
+ // #i58182# - usage of new method
// <SwObjectFormatterTxtFrm::CheckMovedFwdCondition(..)>
sal_uInt32 nToPageNum( 0L );
bool bDummy( false );
@@ -485,7 +452,7 @@ void SwFlyAtCntFrm::MakeAll()
bAnchoredAtMaster, nToPageNum, bDummy ) )
{
bConsiderWrapInfluenceDueToMovedFwdAnchor = true;
- // --> OD 2005-09-29 #125370#,#125957# - mark anchor text frame
+ // mark anchor text frame
// directly, that it is moved forward by object positioning.
SwTxtFrm* pAnchorTxtFrm( static_cast<SwTxtFrm*>(AnchorFrm()) );
bool bInsert( true );
@@ -504,9 +471,7 @@ void SwFlyAtCntFrm::MakeAll()
SwLayouter::InsertMovedFwdFrm( rDoc, *pAnchorTxtFrm,
nToPageNum );
}
- // <--
}
- // <--
}
if ( aOldPos != (Frm().*fnRect->fnGetPos)() ||
@@ -515,7 +480,6 @@ void SwFlyAtCntFrm::MakeAll()
{
bOsz = aOszCntrl.ChkOsz();
- // --> OD 2006-04-13 #b6403541#
// special loop prevention for dedicated document:
if ( bOsz &&
HasFixSize() && IsClipped() &&
@@ -535,13 +499,12 @@ void SwFlyAtCntFrm::MakeAll()
pFmt->UnlockModify();
bOsz = false;
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFlyAtCntFrm::MakeAll()> - special loop prevention for dedicated document of b6403541 applied" );
#endif
}
}
}
- // <--
}
if ( bExtra && Lower() && !Lower()->GetValidPosFlag() )
@@ -553,17 +516,15 @@ void SwFlyAtCntFrm::MakeAll()
bExtra = sal_False; // Sicherhaltshalber gibt es nur eine Ehrenrunde.
}
} while ( !IsValid() && !bOsz &&
- // --> OD 2004-08-25 #i3317#
+ // #i3317#
!bConsiderWrapInfluenceDueToOverlapPrevCol &&
- // <--
- // --> OD 2005-01-14 #i40444#
+ // #i40444#
!bConsiderWrapInfluenceDueToMovedFwdAnchor &&
- // <--
GetFmt()->GetDoc()->IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) );
- // --> OD 2004-08-25 #i3317# - instead of attribute change apply
+ // #i3317# - instead of attribute change apply
// temporarly the 'straightforward positioning process'.
- // --> OD 2007-11-29 #i80924#
+ // #i80924#
// handle special case during splitting of table rows
if ( bConsiderWrapInfluenceDueToMovedFwdAnchor &&
GetAnchorFrm()->IsInTab() &&
@@ -584,19 +545,14 @@ void SwFlyAtCntFrm::MakeAll()
}
}
}
- // <--
if ( bOsz || bConsiderWrapInfluenceDueToOverlapPrevCol ||
- // --> OD 2005-01-14 #i40444#
+ // #i40444#
bConsiderWrapInfluenceDueToMovedFwdAnchor )
- // <--
{
SetTmpConsiderWrapInfluence( true );
SetRestartLayoutProcess( true );
- // --> OD 2006-07-24 #b6449874#
SetTmpConsiderWrapInfluenceOfOtherObjs( true );
- // <--
}
- // <--
bSetCompletePaintOnInvalidate = sal_False;
}
}
@@ -604,9 +560,7 @@ void SwFlyAtCntFrm::MakeAll()
/** method to determine, if a <MakeAll()> on the Writer fly frame is possible
- OD 2004-05-11 #i28701#
-
- @author OD
+ #i28701#
*/
bool SwFlyAtCntFrm::IsFormatPossible() const
{
@@ -622,8 +576,6 @@ bool SwFlyAtCntFrm::IsFormatPossible() const
|* Absatzgebundene Objekte.
|* Wird beim Draggen von Absatzgebundenen Objekten zur Ankeranzeige sowie
|* fuer Ankerwechsel benoetigt.
-|* Ersterstellung MA 22. Jun. 93
-|* Letzte Aenderung MA 30. Jan. 95
|*
|*************************************************************************/
@@ -665,7 +617,7 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
const bool bVertL2R = pUp->IsVertLR();
//Dem Textflus folgen.
- // --> OD 2009-01-12 #i70582#
+ // #i70582#
// --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script
const SwTwips nTopForObjPos =
bVert
@@ -677,11 +629,10 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) )
: ( pCnt->Frm().Top() +
pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() );
- // <--
if ( pUp->Frm().IsInside( rPt ) )
{
- // OD 26.09.2003 - <rPt> point is inside environment of given content frame
- // --> OD 2009-01-12 #i70582#
+ // <rPt> point is inside environment of given content frame
+ // #i70582#
if( bVert )
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
@@ -692,27 +643,26 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
rRet.nMain = rPt.Y() - nTopForObjPos;
- // <--
return pCnt;
}
else if ( rPt.Y() <= pUp->Frm().Top() )
{
- // OD 26.09.2003 - <rPt> point is above environment of given content frame
- // OD: correct for vertical layout?
+ // <rPt> point is above environment of given content frame
+ // correct for vertical layout?
rRet.nMain = LONG_MAX;
}
else if( rPt.X() < pUp->Frm().Left() &&
rPt.Y() <= ( bVert ? pUp->Frm().Top() : pUp->Frm().Bottom() ) )
{
- // OD 26.09.2003 - <rPt> point is left of environment of given content frame
- // OD: seems not to be correct for vertical layout!?
+ // <rPt> point is left of environment of given content frame
+ // seems not to be correct for vertical layout!?
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()) )
{
- // OD 26.09.2003 - <rPt> point is in left border of environment
- // --> OD 2009-01-12 #i70582#
+ // <rPt> point is in left border of environment
+ // #i70582#
if( bVert )
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
@@ -723,7 +673,6 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
rRet.nMain = rPt.Y() - nTopForObjPos;
- // <--
return pCnt;
}
else
@@ -731,8 +680,7 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet,
}
else
{
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- // --> OD 2009-01-12 #i70582#
+ // Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
rRet.nMain = bVert
? ( bVertL2R
? ( (pUp->Frm().Left() + pUp->Prt().Right()) - nTopForObjPos )
@@ -1268,7 +1216,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
//fluss sondern in irgendwelchen Raendern steht.
if ( nDownLst.nMain == LONG_MAX && nUpLst.nMain == LONG_MAX )
{
- // #102861# If an OLE objects, which is contained in a fly frame
+ // If an OLE objects, which is contained in a fly frame
// is resized in inplace mode and the new Position is outside the
// fly frame, we do not want to leave our fly frame.
if ( pCnt->IsInFly() )
@@ -1284,9 +1232,6 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
|*
|* SwFlyAtCntFrm::SetAbsPos()
|*
-|* Ersterstellung MA 22. Jun. 93
-|* Letzte Aenderung MA 11. Sep. 98
-|*
|*************************************************************************/
void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
@@ -1334,7 +1279,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwTwips nY;
if ( pCnt->Frm().IsInside( aNew ) )
{
- // --> OD 2009-01-12 #i70582#
+ // #i70582#
const SwTwips nTopForObjPos =
bVert
? ( bVertL2R
@@ -1357,7 +1302,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
{
nY = rNew.Y() - nTopForObjPos;
}
- // <--
}
else
{
@@ -1406,7 +1350,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
if ( nY == LONG_MAX )
{
- // --> OD 2009-01-12 #i70582#
+ // #i70582#
const SwTwips nTopForObjPos =
bVert
? ( bVertL2R
@@ -1429,7 +1373,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
{
nY = rNew.Y() - nTopForObjPos;
}
- // <--
}
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
@@ -1501,7 +1444,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
pPos->nContent.Assign( pCnt->GetNode(), 0 );
}
- // --> OD 2006-02-27 #125892#
// handle change of anchor node:
// if count of the anchor frame also change, the fly frames have to be
// re-created. Thus, delete all fly frames except the <this> before the
@@ -1510,9 +1452,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwHandleAnchorNodeChg aHandleAnchorNodeChg( *pFmt, aAnch, this );
pFmt->GetDoc()->SetAttr( aAnch, *pFmt );
}
- // <--
}
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
else if ( pTmpPage && pTmpPage != GetPageFrm() )
GetPageFrm()->MoveFly( this, pTmpPage );
@@ -1527,71 +1468,11 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
sal_False );
}
-// OD 2004-08-12 #i32795# - Note: method no longer used in <flyincnt.cxx>
-//void DeepCalc( const SwFrm *pFrm )
-//{
-// if( pFrm->IsSctFrm() ||
-// ( pFrm->IsFlyFrm() && ((SwFlyFrm*)pFrm)->IsFlyInCntFrm() ) )
-// return;
-// const SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( pFrm );
-// if( pFlow && pFlow->IsAnyJoinLocked() )
-// return;
-
-// sal_uInt16 nCnt = 0;
-
-// sal_Bool bContinue = sal_False;
-// do
-// {
-// if ( ++nCnt == 10 )
-// {
-// ASSERT( !nCnt, "DeepCalc: Loop detected1?" );
-// break;
-// }
-
-// const sal_Bool bSetComplete = !pFrm->IsValid();
-// const SwRect aOldFrm( pFrm->Frm() );
-// const SwRect aOldPrt( pFrm->Prt() );
-
-// const SwFrm *pUp = pFrm->GetUpper();
-// if ( pUp )
-// {
-// //Nicht weiter wenn der Up ein Fly mit Spalten ist.
-// if( ( !pUp->IsFlyFrm() || !((SwLayoutFrm*)pUp)->Lower() ||
-// !((SwLayoutFrm*)pUp)->Lower()->IsColumnFrm() ) &&
-// !pUp->IsSctFrm() )
-// {
-// SWRECTFN( pUp )
-// const Point aPt( (pUp->Frm().*fnRect->fnGetPos)() );
-// ::DeepCalc( pUp );
-// bContinue = aPt != (pUp->Frm().*fnRect->fnGetPos)();
-// }
-// }
-// else
-// pUp = pFrm;
-
-// pFrm->Calc();
-// if ( bSetComplete && (aOldFrm != pFrm->Frm() || aOldPrt != pFrm->Prt()))
-// pFrm->SetCompletePaint();
-
-// if ( pUp->IsFlyFrm() )
-// {
-// if ( ((SwFlyFrm*)pUp)->IsLocked() ||
-// (((SwFlyFrm*)pUp)->IsFlyAtCntFrm() &&
-// SwOszControl::IsInProgress( (const SwFlyFrm*)pUp )) )
-// {
-// bContinue = sal_False;
-// }
-// }
-// } while ( bContinue );
-//}
-
/** method to assure that anchored object is registered at the correct
page frame
- OD 2004-07-02 #i28701#
+ #i28701#
takes over functionality of deleted method <SwFlyAtCntFrm::AssertPage()>
-
- @author OD
*/
void SwFlyAtCntFrm::RegisterAtCorrectPage()
{
@@ -1609,33 +1490,31 @@ void SwFlyAtCntFrm::RegisterAtCorrectPage()
}
}
-// OD 2004-03-23 #i26791#
+// #i26791#
//void SwFlyAtCntFrm::MakeFlyPos()
void SwFlyAtCntFrm::MakeObjPos()
{
- // OD 02.10.2002 #102646#
// if fly frame position is valid, nothing is to do. Thus, return
if ( bValidPos )
{
return;
}
- // OD 2004-03-24 #i26791# - validate position flag here.
+ // #i26791# - validate position flag here.
bValidPos = sal_True;
- // --> OD 2004-10-22 #i35911# - no calculation of new position, if
+ // #i35911# - no calculation of new position, if
// anchored object is marked that it clears its environment and its
// environment is already cleared.
- // --> OD 2006-01-02 #125977# - before checking for cleared environment
+ // before checking for cleared environment
// check, if member <mpVertPosOrientFrm> is set.
if ( GetVertPosOrientFrm() &&
ClearedEnvironment() && HasClearedEnvironment() )
{
return;
}
- // <--
- // OD 29.10.2003 #113049# - use new class to position object
+ // use new class to position object
objectpositioning::SwToCntntAnchoredObjectPosition
aObjPositioning( *GetVirtDrawObj() );
aObjPositioning.CalcPosition();
@@ -1643,7 +1522,7 @@ void SwFlyAtCntFrm::MakeObjPos()
SetVertPosOrientFrm ( aObjPositioning.GetVertPosOrientFrm() );
}
-// OD 2004-05-12 #i28701#
+// #i28701#
bool SwFlyAtCntFrm::_InvalidationAllowed( const InvalidationType _nInvalid ) const
{
bool bAllowed( SwFlyFreeFrm::_InvalidationAllowed( _nInvalid ) );
@@ -1660,3 +1539,5 @@ bool SwFlyAtCntFrm::_InvalidationAllowed( const InvalidationType _nInvalid ) con
return bAllowed;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 1ff29c582696..51df36b56ff9 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,9 +49,6 @@ void DeepCalc( const SwFrm *pFrm );
|*
|* SwFlyInCntFrm::SwFlyInCntFrm(), ~SwFlyInCntFrm()
|*
-|* Ersterstellung MA 01. Dec. 92
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
SwFlyFrm( pFmt, pAnch )
@@ -83,16 +81,13 @@ TYPEINIT1(SwFlyInCntFrm,SwFlyFrm);
|*
|* SwFlyInCntFrm::SetRefPoint(),
|*
-|* Ersterstellung MA 01. Dec. 92
-|* Letzte Aenderung MA 06. Aug. 95
-|*
|*************************************************************************/
void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
const Point& rRelAttr,
const Point& rRelPos )
{
// OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject>
- ASSERT( rPoint != aRef || rRelAttr != GetCurrRelPos(), "SetRefPoint: no change" );
+ OSL_ENSURE( rPoint != aRef || rRelAttr != GetCurrRelPos(), "SetRefPoint: no change" );
SwFlyNotify *pNotify = NULL;
// No notify at a locked fly frame, if a fly frame is locked, there's
// already a SwFlyNotify object on the stack (MakeAll).
@@ -119,9 +114,6 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
|*
|* SwFlyInCntFrm::Modify()
|*
-|* Ersterstellung MA 16. Dec. 92
-|* Letzte Aenderung MA 02. Sep. 93
-|*
|*************************************************************************/
void SwFlyInCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
@@ -167,8 +159,6 @@ void SwFlyInCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
|* SwFlyInCntFrm::Format()
|*
|* Beschreibung: Hier wird der Inhalt initial mit Formatiert.
-|* Ersterstellung MA 16. Dec. 92
-|* Letzte Aenderung MA 19. May. 93
|*
|*************************************************************************/
void SwFlyInCntFrm::Format( const SwBorderAttrs *pAttrs )
@@ -192,8 +182,6 @@ void SwFlyInCntFrm::Format( const SwBorderAttrs *pAttrs )
|* Beschreibung Im Unterschied zu anderen Frms wird hier nur die
|* die RelPos berechnet. Die absolute Position wird ausschliesslich
|* per SetAbsPos errechnet.
-|* Ersterstellung MA 03. Dec. 92
-|* Letzte Aenderung MA 12. Apr. 96
|*
|*************************************************************************/
// OD 2004-03-23 #i26791#
@@ -235,9 +223,6 @@ void SwFlyInCntFrm::_ActionOnInvalidation( const InvalidationType _nInvalid )
|*
|* SwFlyInCntFrm::NotifyBackground()
|*
-|* Ersterstellung MA 03. Dec. 92
-|* Letzte Aenderung MA 26. Aug. 93
-|*
|*************************************************************************/
void SwFlyInCntFrm::NotifyBackground( SwPageFrm *, const SwRect& rRect,
PrepareHint eHint)
@@ -252,9 +237,6 @@ void SwFlyInCntFrm::NotifyBackground( SwPageFrm *, const SwRect& rRect,
|*
|* SwFlyInCntFrm::GetRelPos()
|*
-|* Ersterstellung MA 04. Dec. 92
-|* Letzte Aenderung MA 04. Dec. 92
-|*
|*************************************************************************/
const Point SwFlyInCntFrm::GetRelPos() const
{
@@ -266,15 +248,12 @@ const Point SwFlyInCntFrm::GetRelPos() const
|*
|* SwFlyInCntFrm::RegistFlys()
|*
-|* Ersterstellung MA 26. Nov. 93
-|* Letzte Aenderung MA 26. Nov. 93
-|*
|*************************************************************************/
void SwFlyInCntFrm::RegistFlys()
{
// vgl. SwRowFrm::RegistFlys()
SwPageFrm *pPage = FindPageFrm();
- ASSERT( pPage, "Flys ohne Seite anmelden?" );
+ OSL_ENSURE( pPage, "Flys ohne Seite anmelden?" );
::RegistFlys( pPage, this );
}
@@ -282,9 +261,6 @@ void SwFlyInCntFrm::RegistFlys()
|*
|* SwFlyInCntFrm::MakeAll()
|*
-|* Ersterstellung MA 18. Feb. 94
-|* Letzte Aenderung MA 13. Jun. 96
-|*
|*************************************************************************/
void SwFlyInCntFrm::MakeAll()
{
@@ -359,3 +335,4 @@ void SwFlyInCntFrm::MakeAll()
Unlock();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 4a240b9d256d..79aa866bc5c3 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,6 @@
#include "ftnfrm.hxx"
#include "frmtool.hxx"
#include "frmfmt.hxx"
-#include "errhdl.hxx"
#include "hints.hxx"
#include "pam.hxx"
#include "sectfrm.hxx"
@@ -52,11 +52,10 @@
#include "ndole.hxx"
#include "tabfrm.hxx"
#include "flyfrms.hxx"
-// OD 22.09.2003 #i18732#
+// #i18732#
#include <fmtfollowtextflow.hxx>
-// OD 29.10.2003 #113049#
#include <environmentofanchoredobject.hxx>
-// OD 2004-05-24 #i28701#
+// #i28701#
#include <sortedobjs.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
@@ -69,32 +68,27 @@ using namespace ::com::sun::star;
|*
|* SwFlyFreeFrm::SwFlyFreeFrm(), ~SwFlyFreeFrm()
|*
-|* Ersterstellung MA 03. Dec. 92
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
SwFlyFrm( pFmt, pAnch ),
pPage( 0 ),
- // --> OD 2004-11-15 #i34753#
+ // #i34753#
mbNoMakePos( false ),
- // <--
- // --> OD 2004-11-12 #i37068#
+ // #i37068#
mbNoMoveOnCheckClip( false )
- // <--
{
}
SwFlyFreeFrm::~SwFlyFreeFrm()
{
//und Tschuess.
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if( GetPageFrm() )
{
if( GetFmt()->GetDoc()->IsInDtor() )
{
- // --> OD 2004-06-04 #i29879# - remove also to-frame anchored Writer
+ // #i29879# - remove also to-frame anchored Writer
// fly frame from page.
const bool bRemoveFromPage =
GetPageFrm()->GetSortedObjs() &&
@@ -113,9 +107,8 @@ SwFlyFreeFrm::~SwFlyFreeFrm()
}
}
-// --> OD 2004-06-29 #i28701#
+// #i28701#
TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
-// <--
/*************************************************************************
|*
|* SwFlyFreeFrm::NotifyBackground()
@@ -126,8 +119,6 @@ TYPEINIT1(SwFlyFreeFrm,SwFlyFrm);
|* ueberlappt werden.
|* Es werden auch die CntntFrms innerhalb von anderen Flys
|* beruecksichtigt.
-|* Ersterstellung MA 03. Dec. 92
-|* Letzte Aenderung MA 26. Aug. 93
|*
|*************************************************************************/
@@ -141,14 +132,10 @@ void SwFlyFreeFrm::NotifyBackground( SwPageFrm *pPageFrm,
|*
|* SwFlyFreeFrm::MakeAll()
|*
-|* Ersterstellung MA 18. Feb. 94
-|* Letzte Aenderung MA 03. Mar. 97
-|*
|*************************************************************************/
void SwFlyFreeFrm::MakeAll()
{
- // OD 2004-01-19 #110582#
if ( !GetFmt()->GetDoc()->IsVisibleLayerId( GetVirtDrawObj()->GetLayer() ) )
{
return;
@@ -156,7 +143,7 @@ void SwFlyFreeFrm::MakeAll()
if ( !GetAnchorFrm() || IsLocked() || IsColLocked() )
return;
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if( !GetPageFrm() && GetAnchorFrm() && GetAnchorFrm()->IsInFly() )
{
SwFlyFrm* pFly = AnchorFrm()->FindFlyFrm();
@@ -175,23 +162,21 @@ void SwFlyFreeFrm::MakeAll()
if ( IsClipped() )
{
bValidSize = bHeightClipped = bWidthClipped = sal_False;
- // --> OD 2004-11-03 #114798# - no invalidation of position,
+ // 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.
- // --> OD 2004-11-15 #i34753# - add condition:
+ // #i34753# - add condition:
// no invalidation of position, if no direct move is requested in <CheckClip(..)>
if ( !IsNoMoveOnCheckClip() &&
!( PositionLocked() &&
GetAnchorFrm()->IsInFly() &&
GetFrmFmt().GetFollowTextFlow().GetValue() ) )
- // <--
{
bValidPos = sal_False;
}
- // <--
}
- // FME 2007-08-30 #i81146# new loop control
+ // #i81146# new loop control
sal_uInt16 nLoopControlRuns = 0;
const sal_uInt16 nLoopControlMax = 10;
@@ -209,21 +194,6 @@ void SwFlyFreeFrm::MakeAll()
if ( !bValidSize )
{
bValidPrtArea = sal_False;
-/*
- // This is also done in the Format function, so I think
- // this code is not necessary anymore:
- const Size aRelSize( CalcRel( *pSz ) );
- const SwTwips nMin = MINFLY + rAttrs.CalcLeftLine()+rAttrs.CalcRightLine();
- long nDiff = bVert ? aRelSize.Height() : aRelSize.Width();
- if( nDiff < nMin )
- nDiff = nMin;
- nDiff -= (aFrm.*fnRect->fnGetWidth)();
- if( nDiff )
- {
- (aFrm.*fnRect->fnAddRight)( nDiff );
- bValidPos = sal_False;
- }
-*/
}
if ( !bValidPrtArea )
@@ -239,14 +209,13 @@ void SwFlyFreeFrm::MakeAll()
if ( !bValidPos )
{
const Point aOldPos( (Frm().*fnRect->fnGetPos)() );
- // OD 2004-03-23 #i26791# - use new method <MakeObjPos()>
- // --> OD 2004-11-15 #i34753# - no positioning, if requested.
+ // #i26791# - use new method <MakeObjPos()>
+ // #i34753# - no positioning, if requested.
if ( IsNoMakePos() )
bValidPos = sal_True;
else
- // OD 2004-03-23 #i26791# - use new method <MakeObjPos()>
+ // #i26791# - use new method <MakeObjPos()>
MakeObjPos();
- // <--
if( aOldPos == (Frm().*fnRect->fnGetPos)() )
{
if( !bValidPos && GetAnchorFrm()->IsInSct() &&
@@ -263,7 +232,7 @@ void SwFlyFreeFrm::MakeAll()
++nLoopControlRuns;
#if OSL_DEBUG_LEVEL > 1
- ASSERT( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrm::MakeAll" )
+ OSL_ENSURE( nLoopControlRuns < nLoopControlMax, "LoopControl in SwFlyFreeFrm::MakeAll" );
#endif
if ( nLoopControlRuns < nLoopControlMax )
@@ -274,9 +243,9 @@ void SwFlyFreeFrm::MakeAll()
}
Unlock();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SWRECTFN( this )
- ASSERT( bHeightClipped || ( (Frm().*fnRect->fnGetHeight)() > 0 &&
+ OSL_ENSURE( bHeightClipped || ( (Frm().*fnRect->fnGetHeight)() > 0 &&
(Prt().*fnRect->fnGetHeight)() > 0),
"SwFlyFreeFrm::Format(), flipping Fly." );
@@ -285,14 +254,12 @@ void SwFlyFreeFrm::MakeAll()
/** determines, if direct environment of fly frame has 'auto' size
- OD 07.08.2003 #i17297#, #111066#, #111070#
+ #i17297#
start with anchor frame and search via <GetUpper()> for a header, footer,
row or fly frame stopping at page frame.
return <true>, if such a frame is found and it has 'auto' size.
otherwise <false> is returned.
- @author OD
-
@return boolean indicating, that direct environment has 'auto' size
*/
bool SwFlyFreeFrm::HasEnvironmentAutoSize() const
@@ -325,9 +292,6 @@ bool SwFlyFreeFrm::HasEnvironmentAutoSize() const
|*
|* SwFlyFreeFrm::CheckClip()
|*
-|* Ersterstellung MA 21. Feb. 94
-|* Letzte Aenderung MA 03. Mar. 97
-|*
|*************************************************************************/
void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
@@ -355,10 +319,9 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
if ( bBot || bRig )
{
sal_Bool bAgain = sal_False;
- // --> OD 2004-11-12 #i37068# - no move, if it's requested
+ // #i37068# - no move, if it's requested
if ( bBot && !IsNoMoveOnCheckClip() &&
!GetDrawObjs() && !GetAnchorFrm()->IsInTab() )
- // <--
{
SwFrm* pHeader = FindFooterOrHeader();
// In a header, correction of the position is no good idea.
@@ -423,7 +386,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
bWidthClipped = sal_True;
}
- // OD 06.08.2003 #i17297#, #111066#, #111070# - no proportional
+ // #i17297# - no proportional
// scaling of graphics in environments, which determines its size
// by its content ('auto' size). Otherwise layout loops can occur and
// layout sizes of the environment can be incorrect.
@@ -464,9 +427,10 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
bWidthClipped = sal_True;
}
- // OD 07.08.2003 #i17297#, #111066#, #111070# - reactivate change
+ // #i17297# - reactivate change
// of size attribute for fly frames containing an ole object.
- // FME: 2004-05-19 Added the aFrmRect.HasArea() hack, because
+
+ // Added the aFrmRect.HasArea() hack, because
// the environment of the ole object does not have to be valid
// at this moment, or even worse, it does not have to have a
// resonable size. In this case we do not want to change to
@@ -520,17 +484,13 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
}
}
- // --> OD 2004-10-14 #i26945#
- ASSERT( Frm().Height() >= 0,
+ // #i26945#
+ OSL_ENSURE( Frm().Height() >= 0,
"<SwFlyFreeFrm::CheckClip(..)> - fly frame has negative height now." );
- // <--
}
/** method to determine, if a <MakeAll()> on the Writer fly frame is possible
-
- OD 2005-03-03 #i43771#
-
- @author OD
+ #i43771#
*/
bool SwFlyFreeFrm::IsFormatPossible() const
{
@@ -543,9 +503,6 @@ bool SwFlyFreeFrm::IsFormatPossible() const
|*
|* SwFlyLayFrm::SwFlyLayFrm()
|*
-|* Ersterstellung MA 25. Aug. 92
-|* Letzte Aenderung MA 09. Apr. 99
-|*
|*************************************************************************/
SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
@@ -554,16 +511,12 @@ SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
bLayout = sal_True;
}
-// --> OD 2004-06-29 #i28701#
+// #i28701#
TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm);
-// <--
/*************************************************************************
|*
|* SwFlyLayFrm::Modify()
|*
-|* Ersterstellung MA 08. Feb. 93
-|* Letzte Aenderung MA 28. Aug. 93
-|*
|*************************************************************************/
void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
@@ -586,14 +539,14 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( pAnch )
{
- ASSERT( pAnch->GetAnchorId() ==
+ OSL_ENSURE( pAnch->GetAnchorId() ==
GetFmt()->GetAnchor().GetAnchorId(),
"8-) Unzulaessiger Wechsel des Ankertyps." );
//Abmelden, Seite besorgen, an den entsprechenden LayoutFrm
//haengen.
SwRect aOld( GetObjRectWithSpaces() );
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
SwPageFrm *pOldPage = GetPageFrm();
AnchorFrm()->RemoveFly( this );
@@ -607,9 +560,8 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
if ( i == nPgNum )
{
- // --> OD 2005-06-09 #i50432# - adjust synopsis of <PlaceFly(..)>
+ // #i50432# - adjust synopsis of <PlaceFly(..)>
pTmpPage->PlaceFly( this, 0 );
- // <--
}
}
if( !pTmpPage )
@@ -630,7 +582,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
pTmp->AppendFly( this );
}
}
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if ( pOldPage && pOldPage != GetPageFrm() )
NotifyBackground( pOldPage, aOld, PREP_FLY_LEAVE );
SetCompletePaint();
@@ -645,9 +597,6 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
|*
|* SwPageFrm::AppendFly()
|*
-|* Ersterstellung MA 10. Oct. 92
-|* Letzte Aenderung MA 08. Jun. 96
-|*
|*************************************************************************/
void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
@@ -669,7 +618,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
}
SdrObject* pObj = pNew->GetVirtDrawObj();
- ASSERT( pNew->GetAnchorFrm(), "Fly without Anchor" );
+ OSL_ENSURE( pNew->GetAnchorFrm(), "Fly without Anchor" );
const SwFlyFrm* pFly = pNew->GetAnchorFrm()->FindFlyFrm();
if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
{
@@ -695,18 +644,17 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
#endif
pSortedObjs->Insert( *pNew );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( bSucessInserted, "Fly nicht in Sorted eingetragen." )
+ OSL_ENSURE( bSucessInserted, "Fly nicht in Sorted eingetragen." );
(void) bSucessInserted;
#endif
- // --> OD 2008-04-22 #i87493#
- ASSERT( pNew->GetPageFrm() == 0 || pNew->GetPageFrm() == this,
+ // #i87493#
+ OSL_ENSURE( pNew->GetPageFrm() == 0 || pNew->GetPageFrm() == this,
"<SwPageFrm::AppendFlyToPage(..)> - anchored fly frame seems to be registered at another page frame. Serious defect -> please inform OD." );
- // <--
- // --> OD 2004-06-30 #i28701# - use new method <SetPageFrm(..)>
+ // #i28701# - use new method <SetPageFrm(..)>
pNew->SetPageFrm( this );
pNew->InvalidatePage( this );
- // OD 2004-05-17 #i28701#
+ // #i28701#
pNew->UnlockPosition();
// Notify accessible layout. That's required at this place for
@@ -721,7 +669,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
}
}
- // --> OD 2004-06-09 #i28701# - correction: consider also drawing objects
+ // #i28701# - correction: consider also drawing objects
if ( pNew->GetDrawObjs() )
{
SwSortedObjs &rObjs = *pNew->GetDrawObjs();
@@ -731,14 +679,13 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
if ( pTmpObj->ISA(SwFlyFrm) )
{
SwFlyFrm* pTmpFly = static_cast<SwFlyFrm*>(pTmpObj);
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if ( pTmpFly->IsFlyFreeFrm() && !pTmpFly->GetPageFrm() )
AppendFlyToPage( pTmpFly );
}
else if ( pTmpObj->ISA(SwAnchoredDrawObject) )
{
- // --> OD 2008-04-22 #i87493#
-// AppendDrawObjToPage( *pTmpObj );
+ // #i87493#
if ( pTmpObj->GetPageFrm() != this )
{
if ( pTmpObj->GetPageFrm() != 0 )
@@ -747,7 +694,6 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
}
AppendDrawObjToPage( *pTmpObj );
}
- // <--
}
}
}
@@ -757,9 +703,6 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
|*
|* SwPageFrm::RemoveFly()
|*
-|* Ersterstellung MA 10. Oct. 92
-|* Letzte Aenderung MA 26. Aug. 96
-|*
|*************************************************************************/
void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
@@ -802,7 +745,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
{ DELETEZ( pSortedObjs );
}
}
- // --> OD 2004-06-30 #i28701# - use new method <SetPageFrm(..)>
+ // #i28701# - use new method <SetPageFrm(..)>
pToRemove->SetPageFrm( 0L );
}
@@ -810,9 +753,6 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
|*
|* SwPageFrm::MoveFly
|*
-|* Ersterstellung MA 25. Jan. 97
-|* Letzte Aenderung MA 25. Jan. 97
-|*
|*************************************************************************/
void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
@@ -866,16 +806,16 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
#endif
pDest->GetSortedObjs()->Insert( *pToMove );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( bSucessInserted, "Fly nicht in Sorted eingetragen." )
+ OSL_ENSURE( bSucessInserted, "Fly nicht in Sorted eingetragen." );
(void) bSucessInserted;
#endif
- // --> OD 2004-06-30 #i28701# - use new method <SetPageFrm(..)>
+ // #i28701# - use new method <SetPageFrm(..)>
pToMove->SetPageFrm( pDest );
pToMove->InvalidatePage( pDest );
pToMove->SetNotifyBack();
pDest->InvalidateFlyCntnt();
- // OD 2004-05-17 #i28701#
+ // #i28701#
pToMove->UnlockPosition();
// Notify accessible layout. That's required at this place for
@@ -889,7 +829,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
->AddAccessibleFrm( pToMove );
}
- // --> OD 2004-06-09 #i28701# - correction: move lowers of Writer fly frame
+ // #i28701# - correction: move lowers of Writer fly frame
if ( pToMove->GetDrawObjs() )
{
SwSortedObjs &rObjs = *pToMove->GetDrawObjs();
@@ -901,7 +841,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pObj);
if ( pFly->IsFlyFreeFrm() )
{
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
SwPageFrm* pPageFrm = pFly->GetPageFrm();
if ( pPageFrm )
pPageFrm->MoveFly( pFly, pDest );
@@ -922,14 +862,14 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
|*
|* SwPageFrm::AppendDrawObjToPage(), RemoveDrawObjFromPage()
|*
-|* --> OD 2004-07-02 #i28701# - new methods
+|* #i28701# - new methods
|*
|*************************************************************************/
void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
{
if ( !_rNewObj.ISA(SwAnchoredDrawObject) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"SwPageFrm::AppendDrawObjToPage(..) - anchored object of unexcepted type -> object not appended" );
return;
}
@@ -939,7 +879,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
((SwRootFrm*)GetUpper())->InvalidateBrowseWidth();
}
- ASSERT( _rNewObj.GetAnchorFrm(), "anchored draw object without anchor" );
+ OSL_ENSURE( _rNewObj.GetAnchorFrm(), "anchored draw object without anchor" );
const SwFlyFrm* pFlyFrm = _rNewObj.GetAnchorFrm()->FindFlyFrm();
if ( pFlyFrm &&
_rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrm->GetVirtDrawObj()->GetOrdNum() )
@@ -963,15 +903,14 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
}
if ( !pSortedObjs->Insert( _rNewObj ) )
{
-#ifdef DBG_UTIL
- ASSERT( pSortedObjs->Contains( _rNewObj ),
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pSortedObjs->Contains( _rNewObj ),
"Drawing object not appended into list <pSortedObjs>." );
#endif
}
- // --> OD 2008-04-22 #i87493#
- ASSERT( _rNewObj.GetPageFrm() == 0 || _rNewObj.GetPageFrm() == this,
+ // #i87493#
+ OSL_ENSURE( _rNewObj.GetPageFrm() == 0 || _rNewObj.GetPageFrm() == this,
"<SwPageFrm::AppendDrawObjToPage(..)> - anchored draw object seems to be registered at another page frame. Serious defect -> please inform OD." );
- // <--
_rNewObj.SetPageFrm( this );
// invalidate page in order to force a reformat of object layout of the page.
@@ -982,7 +921,7 @@ void SwPageFrm::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj )
{
if ( !_rToRemoveObj.ISA(SwAnchoredDrawObject) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"SwPageFrm::RemoveDrawObjFromPage(..) - anchored object of unexcepted type -> object not removed" );
return;
}
@@ -1012,17 +951,14 @@ void SwPageFrm::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj )
|*
|* SwPageFrm::PlaceFly
|*
-|* Ersterstellung MA 08. Feb. 93
-|* Letzte Aenderung MA 27. Feb. 93
-|*
|*************************************************************************/
-// --> OD 2005-06-09 #i50432# - adjust method description and synopsis.
+// #i50432# - adjust method description and synopsis.
void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
{
- // --> OD 2005-06-09 #i50432# - consider the case that page is an empty page:
+ // #i50432# - consider the case that page is an empty page:
// In this case append the fly frame at the next page
- ASSERT( !IsEmptyPage() || GetNext(),
+ OSL_ENSURE( !IsEmptyPage() || GetNext(),
"<SwPageFrm::PlaceFly(..)> - empty page with no next page! -> fly frame appended at empty page" );
if ( IsEmptyPage() && GetNext() )
{
@@ -1035,32 +971,28 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
if ( pFly )
AppendFly( pFly );
else
- { ASSERT( pFmt, ":-( kein Format fuer Fly uebergeben." );
+ { OSL_ENSURE( pFmt, ":-( kein Format fuer Fly uebergeben." );
pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this );
AppendFly( pFly );
::RegistFlys( this, pFly );
}
}
- // <--
}
/*************************************************************************
|*
|* ::CalcClipRect
|*
-|* Ersterstellung AMA 24. Sep. 96
-|* Letzte Aenderung MA 18. Dec. 96
-|*
|*************************************************************************/
-// OD 22.09.2003 #i18732# - adjustments for following text flow or not
+// #i18732# - adjustments for following text flow or not
// AND alignment at 'page areas' for to paragraph/to character anchored objects
-// OD 06.11.2003 #i22305# - adjustment for following text flow
+// #i22305# - adjustment for following text flow
// for to frame anchored objects
-// OD 2004-06-02 #i29778# - Because the calculation of the position of the
+// #i29778# - Because the calculation of the position of the
// floating screen object (Writer fly frame or drawing object) doesn't perform
// a calculation on its upper frames and its anchor frame, a calculation of
// the upper frames in this method no longer sensible.
-// --> OD 2004-07-06 #i28701# - if document compatibility option 'Consider
+// #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.
sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
@@ -1070,16 +1002,15 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
{
const SwFlyFrm* pFly = ((const SwVirtFlyDrawObj*)pSdrObj)->GetFlyFrm();
const bool bFollowTextFlow = pFly->GetFmt()->GetFollowTextFlow().GetValue();
- // --> OD 2004-07-06 #i28701#
+ // #i28701#
const bool bConsiderWrapOnObjPos =
pFly->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION);
- // <--
const SwFmtVertOrient &rV = pFly->GetFmt()->GetVertOrient();
if( pFly->IsFlyLayFrm() )
{
const SwFrm* pClip;
- // OD 06.11.2003 #i22305#
- // --> OD 2004-07-06 #i28701#
+ // #i22305#
+ // #i28701#
if ( !bFollowTextFlow || bConsiderWrapOnObjPos )
{
pClip = pFly->GetAnchorFrm()->FindPageFrm();
@@ -1110,12 +1041,12 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else if( pFly->IsFlyAtCntFrm() )
{
- // OD 22.09.2003 #i18732# - consider following text flow or not
+ // #i18732# - consider following text flow or not
// AND alignment at 'page areas'
const SwFrm* pVertPosOrientFrm = pFly->GetVertPosOrientFrm();
if ( !pVertPosOrientFrm )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"::CalcClipRect(..) - frame, vertical position is oriented at, is missing .");
pVertPosOrientFrm = pFly->GetAnchorFrm();
}
@@ -1125,9 +1056,9 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
const SwLayoutFrm* pClipFrm = pVertPosOrientFrm->FindPageFrm();
rRect = bMove ? pClipFrm->GetUpper()->Frm()
: pClipFrm->Frm();
- // --> OD 2004-10-14 #i26945# - consider that a table, during
+ // #i26945# - consider that a table, during
// its format, can exceed its upper printing area bottom.
- // Thus, enlarge the clip rectangle, if such a case occured
+ // Thus, enlarge the clip rectangle, if such a case occurred
if ( pFly->GetAnchorFrm()->IsInTab() )
{
const SwTabFrm* pTabFrm = const_cast<SwFlyFrm*>(pFly)
@@ -1135,7 +1066,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
SwRect aTmp( pTabFrm->Prt() );
aTmp += pTabFrm->Frm().Pos();
rRect.Union( aTmp );
- // --> OD 2005-03-30 #i43913# - consider also the cell frame
+ // #i43913# - consider also the cell frame
const SwFrm* pCellFrm = const_cast<SwFlyFrm*>(pFly)
->GetAnchorFrmContainingAnchPos()->GetUpper();
while ( pCellFrm && !pCellFrm->IsCellFrm() )
@@ -1148,13 +1079,12 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
aTmp += pCellFrm->Frm().Pos();
rRect.Union( aTmp );
}
- // <--
}
}
else if ( rV.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ||
rV.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA )
{
- // OD 29.10.2003 #113049# - new class <SwEnvironmentOfAnchoredObject>
+ // new class <SwEnvironmentOfAnchoredObject>
objectpositioning::SwEnvironmentOfAnchoredObject
aEnvOfObj( bFollowTextFlow );
const SwLayoutFrm& rVertClipFrm =
@@ -1182,10 +1112,9 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else
{
- // --> OD 2004-10-11 #i26945#
+ // #i26945#
const SwFrm *pClip =
const_cast<SwFlyFrm*>(pFly)->GetAnchorFrmContainingAnchPos();
- // <--
SWRECTFN( pClip )
const SwLayoutFrm *pUp = pClip->GetUpper();
const SwFrm *pCell = pUp->IsCellFrm() ? pUp : 0;
@@ -1260,8 +1189,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
const SwFrm *pTab = pUp->FindTabFrm();
(rRect.*fnRect->fnSetBottom)(
(pTab->GetUpper()->*fnRect->fnGetPrtBottom)() );
- // OD 08.08.2003 #110978# - expand to left and right
- // cell border
+ // expand to left and right cell border
rRect.Left ( pUp->Frm().Left() );
rRect.Width( pUp->Frm().Width() );
}
@@ -1297,7 +1225,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else if ( pUp->GetUpper()->IsPageFrm() )
{
- // #111909# Objects anchored as character may exceed right margin
+ // Objects anchored as character may exceed right margin
// of body frame:
(rRect.*fnRect->fnSetRight)( (pUp->GetUpper()->Frm().*fnRect->fnGetRight)() );
}
@@ -1336,7 +1264,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
const SwFrm* pAnchorFrm = pC->GetAnchorFrm( pSdrObj );
if( !pAnchorFrm )
{
- ASSERT( false, "<::CalcClipRect(..)> - missing anchor frame." );
+ OSL_ENSURE( false, "<::CalcClipRect(..)> - missing anchor frame." );
((SwDrawContact*)pC)->ConnectToLayout();
pAnchorFrm = pC->GetAnchorFrm();
}
@@ -1360,7 +1288,7 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else
{
- // OD 2004-04-13 #i26791# - value of <nTmpH> is needed to
+ // #i26791# - value of <nTmpH> is needed to
// calculate value of <nTop>.
nTmpH = bVert ? pSdrObj->GetCurrentBoundRect().GetWidth() :
pSdrObj->GetCurrentBoundRect().GetHeight();
@@ -1372,9 +1300,9 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
else
{
- // OD 23.06.2003 #108784# - restrict clip rectangle for drawing
+ // restrict clip rectangle for drawing
// objects in header/footer to the page frame.
- // OD 2004-03-29 #i26791#
+ // #i26791#
const SwFrm* pAnchorFrm = pC->GetAnchorFrm( pSdrObj );
if ( pAnchorFrm && pAnchorFrm->FindFooterOrHeader() )
{
@@ -1390,3 +1318,5 @@ sal_Bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, sal_Bool bMove )
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index 8d3b517c2efc..6ac6bf772502 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,3 +111,4 @@ sal_Bool SwPosFlyFrm::operator<( const SwPosFlyFrm& rPosFly )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 3d820e7a1e69..0d3f867d0a6b 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,9 +111,6 @@ sal_Bool StackHack::bLocked = sal_False;
|*
|* SwFrmNotify::SwFrmNotify()
|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
|*************************************************************************/
SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
@@ -145,9 +143,6 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
|*
|* SwFrmNotify::~SwFrmNotify()
|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
|*************************************************************************/
SwFrmNotify::~SwFrmNotify()
@@ -329,7 +324,7 @@ SwFrmNotify::~SwFrmNotify()
}
if ( pPageFrm != pFlyPageFrm )
{
- ASSERT( pFlyPageFrm, "~SwFrmNotify: Fly from Nowhere" );
+ OSL_ENSURE( pFlyPageFrm, "~SwFrmNotify: Fly from Nowhere" );
if( pFlyPageFrm )
pFlyPageFrm->MoveFly( pFlyFrm, pPageFrm );
else
@@ -401,7 +396,7 @@ SwFrmNotify::~SwFrmNotify()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwCntntNotify::~SwCntntNotify()> - unknown anchored object type. Please inform OD." );
}
}
@@ -460,9 +455,6 @@ SwFrmNotify::~SwFrmNotify()
|*
|* SwLayNotify::SwLayNotify()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 93
-|*
|*************************************************************************/
@@ -476,9 +468,6 @@ SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
|*
|* SwLayNotify::~SwLayNotify()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 13. Jun. 96
-|*
|*************************************************************************/
// OD 2004-05-11 #i28701# - local method to invalidate the position of all
@@ -692,9 +681,6 @@ SwLayNotify::~SwLayNotify()
|*
|* SwFlyNotify::SwFlyNotify()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 26. Aug. 93
-|*
|*************************************************************************/
SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
@@ -711,9 +697,6 @@ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
|*
|* SwFlyNotify::~SwFlyNotify()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 09. Nov. 95
-|*
|*************************************************************************/
SwFlyNotify::~SwFlyNotify()
@@ -827,9 +810,6 @@ SwFlyNotify::~SwFlyNotify()
|*
|* SwCntntNotify::SwCntntNotify()
|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 16. May. 95
-|*
|*************************************************************************/
SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
@@ -862,9 +842,6 @@ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
|*
|* SwCntntNotify::~SwCntntNotify()
|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
|*************************************************************************/
SwCntntNotify::~SwCntntNotify()
@@ -887,7 +864,7 @@ SwCntntNotify::~SwCntntNotify()
SwLayoutFrm* pCell = pCnt->GetUpper();
while( !pCell->IsCellFrm() && pCell->GetUpper() )
pCell = pCell->GetUpper();
- ASSERT( pCell->IsCellFrm(), "Where's my cell?" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Where's my cell?" );
if ( text::VertOrientation::NONE != pCell->GetFmt()->GetVertOrient().GetVertOrient() )
pCell->InvalidatePrt(); //fuer vertikale Ausrichtung.
}
@@ -953,7 +930,7 @@ SwCntntNotify::~SwCntntNotify()
(pNd->GetOLEObj().IsOleRef() ||
pNd->IsOLESizeInvalid()) )
{
- ASSERT( pCnt->IsInFly(), "OLE not in FlyFrm" );
+ OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrm" );
SwFlyFrm *pFly = pCnt->FindFlyFrm();
svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject();
SwFEShell *pFESh = 0;
@@ -975,7 +952,7 @@ SwCntntNotify::~SwCntntNotify()
// The layout is calculated _before_ calling PrtOLENotify,
// and the OLE objects are not invalidated during import.
// Therefore I added the condition !IsUpdateExpFld,
- // have a look at the occurence of CalcLayout in
+ // have a look at the occurrence of CalcLayout in
// uiview/view.cxx.
if ( !pNd->IsOLESizeInvalid() &&
!pSh->GetDoc()->IsUpdateExpFld() )
@@ -1036,7 +1013,6 @@ SwCntntNotify::~SwCntntNotify()
continue; //#60878# nicht etwa zeichengebundene.
}
- sal_Bool bCheckPos = sal_False;
if ( rAnch.GetCntntAnchor() )
{
if ( !pIdx )
@@ -1045,10 +1021,9 @@ SwCntntNotify::~SwCntntNotify()
}
if ( rAnch.GetCntntAnchor()->nNode == *pIdx )
{
- bCheckPos = sal_True;
if (FLY_AT_PAGE == rAnch.GetAnchorId())
{
- ASSERT( false, "<SwCntntNotify::~SwCntntNotify()> - to page anchored object with content position. Please inform OD." );
+ OSL_ENSURE( false, "<SwCntntNotify::~SwCntntNotify()> - to page anchored object with content position. Please inform OD." );
SwFmtAnchor aAnch( rAnch );
aAnch.SetAnchor( 0 );
aAnch.SetPageNum( pPage->GetPhyPageNum() );
@@ -1113,8 +1088,6 @@ SwCntntNotify::~SwCntntNotify()
|* Beschreibung Hilfsfunktionen, die friend von irgendwem sind, damit
|* nicht immer gleich 'ne ganze Klasse befreundet werden
|* muss.
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 11. May. 95
|*
|*************************************************************************/
@@ -1144,7 +1117,7 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, sal_uLong nIndex,
SdrObject* pSdrObj = 0;
if ( bSdrObj && 0 == (pSdrObj = pFmt->FindSdrObject()) )
{
- ASSERT( !bSdrObj, "DrawObject not found." );
+ OSL_ENSURE( !bSdrObj, "DrawObject not found." );
pFmt->GetDoc()->DelFrmFmt( pFmt );
--i;
continue;
@@ -1219,7 +1192,7 @@ sal_Bool MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
*/
bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt )
{
- ASSERT( lcl_ObjConnected( &_rFmt ),
+ OSL_ENSURE( lcl_ObjConnected( &_rFmt ),
"::lcl_InHeaderOrFooter(..) - <SwFrmFmt> has no connected object" );
bool bRetVal = false;
@@ -1373,7 +1346,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
( !pLay->IsInTab() || pSct->IsInTab() ) )
{
pActualSection = new SwActualSection( 0, pSct, 0 );
- ASSERT( !pLay->Lower() || !pLay->Lower()->IsColumnFrm(),
+ OSL_ENSURE( !pLay->Lower() || !pLay->Lower()->IsColumnFrm(),
"_InsertCnt: Wrong Call" );
}
}
@@ -1576,8 +1549,8 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
}
else if ( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode() )
{
- ASSERT( pActualSection, "Sectionende ohne Anfang?" );
- ASSERT( pActualSection->GetSectionNode() == pNd->StartOfSectionNode(),
+ OSL_ENSURE( pActualSection, "Sectionende ohne Anfang?" );
+ OSL_ENSURE( pActualSection->GetSectionNode() == pNd->StartOfSectionNode(),
"Sectionende mit falschen Start Node?" );
//Section schliessen, ggf. die umgebende Section wieder
@@ -1692,11 +1665,9 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
delete pPageMaker;
if( pDoc->GetLayoutCache() )
{
-#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
pDoc->GetLayoutCache()->CompareLayout( *pDoc );
#endif
-#endif
pDoc->GetLayoutCache()->ClearImpl();
}
}
@@ -1760,14 +1731,14 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
SwFrm *pMove = pFrm;
SwFrm *pPrev = pFrm->GetPrev();
SwFlowFrm *pTmp = SwFlowFrm::CastFlowFrm( pMove );
- ASSERT( pTmp, "Missing FlowFrm" );
+ OSL_ENSURE( pTmp, "Missing FlowFrm" );
if ( bApres )
{
// Wir wollen, dass der Rest der Seite leer ist, d.h.
// der naechste muss auf die naechste Seite wandern.
// Dieser kann auch in der naechsten Spalte stehen!
- ASSERT( !pTmp->HasFollow(), "Follows forbidden" );
+ OSL_ENSURE( !pTmp->HasFollow(), "Follows forbidden" );
pPrev = pFrm;
// Wenn unser umgebender SectionFrm einen Next besitzt,
// so soll dieser ebenfalls gemoved werden!
@@ -1822,7 +1793,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
else
{
- ASSERT( !pTmp->IsFollow(), "Follows really forbidden" );
+ OSL_ENSURE( !pTmp->IsFollow(), "Follows really forbidden" );
// Bei Bereichen muss natuerlich der Inhalt auf die Reise
// geschickt werden.
if( pMove->IsSctFrm() )
@@ -1927,9 +1898,6 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
|*
|* SwBorderAttrs::Ctor, DTor
|*
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 25. Jan. 97
-|*
|*************************************************************************/
SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor ) :
@@ -1983,8 +1951,6 @@ SwBorderAttrs::~SwBorderAttrs()
|* der Sicherheitsabstand wird nur einkalkuliert, wenn Umrandung und/oder
|* Schatten im Spiel sind; er soll vermeiden, dass aufgrund der
|* groben physikalischen Gegebenheiten Raender usw. uebermalt werden.
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 08. Jul. 93
|*
|*************************************************************************/
@@ -2002,8 +1968,9 @@ void SwBorderAttrs::_CalcBottom()
long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
{
- long nRight;
+ long nRight=0;
+ if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) {
// OD 23.01.2003 #106895# - for cell frame in R2L text direction the left
// and right border are painted on the right respectively left.
if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() )
@@ -2011,33 +1978,34 @@ long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
else
nRight = CalcRightLine();
+ }
// for paragraphs, "left" is "before text" and "right" is "after text"
if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
nRight += rLR.GetLeft();
else
nRight += rLR.GetRight();
- // --> OD 2008-01-21 #newlistlevelattrs#
// correction: retrieve left margin for numbering in R2L-layout
if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
{
nRight += ((SwTxtFrm*)pCaller)->GetTxtNode()->GetLeftMarginWithNum();
}
- // <--
return nRight;
}
long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
{
- long nLeft;
+ long nLeft=0;
+ if (!pCaller->IsTxtFrm() || !((SwTxtFrm*)pCaller)->GetTxtNode()->GetDoc()->get(IDocumentSettingAccess::INVERT_BORDER_SPACING)) {
// OD 23.01.2003 #106895# - for cell frame in R2L text direction the left
// and right border are painted on the right respectively left.
if ( pCaller->IsCellFrm() && pCaller->IsRightToLeft() )
nLeft = CalcRightLine();
else
nLeft = CalcLeftLine();
+ }
// for paragraphs, "left" is "before text" and "right" is "after text"
if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
@@ -2045,11 +2013,10 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
else
nLeft += rLR.GetLeft();
- // --> OD 2008-01-21 #newlistlevelattrs#
+
// correction: do not retrieve left margin for numbering in R2L-layout
// if ( pCaller->IsTxtFrm() )
if ( pCaller->IsTxtFrm() && !pCaller->IsRightToLeft() )
- // <--
{
nLeft += ((SwTxtFrm*)pCaller)->GetTxtNode()->GetLeftMarginWithNum();
}
@@ -2066,8 +2033,6 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
|* Es kann auch ohne Linien ein Abstand erwuenscht sein,
|* dieser wird dann nicht vom Attribut sondern hier
|* beruecksichtigt (bBorderDist, z.B. fuer Zellen).
-|* Ersterstellung MA 21. May. 93
-|* Letzte Aenderung MA 07. Jun. 99
|*
|*************************************************************************/
@@ -2111,9 +2076,6 @@ void SwBorderAttrs::_CalcRightLine()
|*
|* SwBorderAttrs::_IsLine()
|*
-|* Ersterstellung MA 29. Sep. 94
-|* Letzte Aenderung MA 29. Sep. 94
-|*
|*************************************************************************/
void SwBorderAttrs::_IsLine()
@@ -2141,9 +2103,6 @@ void SwBorderAttrs::_IsLine()
|* 3. Die Umrandungen links und rechts vor Vorgaenger bzw. Nachfolger
|* sind identisch.
|*
-|* Ersterstellung MA 22. Mar. 95
-|* Letzte Aenderung MA 22. May. 95
-|*
|*************************************************************************/
inline int CmpLines( const SvxBorderLine *pL1, const SvxBorderLine *pL2 )
{
@@ -2313,9 +2272,6 @@ void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm )
|*
|* SwBorderAttrAccess::CTor
|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 29. Nov. 95
-|*
|*************************************************************************/
SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
@@ -2333,9 +2289,6 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
|*
|* SwBorderAttrAccess::NewObj, Get
|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 20. Mar. 95
-|*
|*************************************************************************/
SwCacheObj *SwBorderAttrAccess::NewObj()
@@ -2353,9 +2306,6 @@ SwBorderAttrs *SwBorderAttrAccess::Get()
|*
|* SwOrderIter::Ctor
|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
|*************************************************************************/
SwOrderIter::SwOrderIter( const SwPageFrm *pPg, sal_Bool bFlys ) :
@@ -2369,9 +2319,6 @@ SwOrderIter::SwOrderIter( const SwPageFrm *pPg, sal_Bool bFlys ) :
|*
|* SwOrderIter::Top()
|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
|*************************************************************************/
const SdrObject *SwOrderIter::Top()
@@ -2379,10 +2326,10 @@ const SdrObject *SwOrderIter::Top()
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- sal_uInt32 nTopOrd = 0;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
+ sal_uInt32 nTopOrd = 0;
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
@@ -2405,9 +2352,6 @@ const SdrObject *SwOrderIter::Top()
|*
|* SwOrderIter::Bottom()
|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
|*************************************************************************/
const SdrObject *SwOrderIter::Bottom()
@@ -2441,9 +2385,6 @@ const SdrObject *SwOrderIter::Bottom()
|*
|* SwOrderIter::Next()
|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
|*************************************************************************/
const SdrObject *SwOrderIter::Next()
@@ -2478,9 +2419,6 @@ const SdrObject *SwOrderIter::Next()
|*
|* SwOrderIter::Prev()
|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
|*************************************************************************/
const SdrObject *SwOrderIter::Prev()
@@ -2489,10 +2427,10 @@ const SdrObject *SwOrderIter::Prev()
pCurrent = 0;
if ( pPage->GetSortedObjs() )
{
- sal_uInt32 nOrd = 0;
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
+ sal_uInt32 nOrd = 0;
(*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
@@ -2515,9 +2453,6 @@ const SdrObject *SwOrderIter::Prev()
|*
|* SaveCntnt(), RestoreCntnt()
|*
-|* Ersterstellung MA 10. Jun. 93
-|* Letzte Aenderung MA 07. Mar. 95
-|*
|*************************************************************************/
//Unterstruktur eines LayoutFrms fuer eine Aktion aufheben und wieder
@@ -2537,7 +2472,7 @@ const SdrObject *SwOrderIter::Prev()
// at-fly anchored objects from page
void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
{
- ASSERT( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_RemoveFlysFromPage." );
+ OSL_ENSURE( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_RemoveFlysFromPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
@@ -2657,7 +2592,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
}
}
else {
- ASSERT( !pFloat, "Neuer Float-Frame?" );
+ OSL_ENSURE( !pFloat, "Neuer Float-Frame?" );
}
}
if ( pFloat->GetNext() )
@@ -2705,7 +2640,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
// anchored objects to page
void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
{
- ASSERT( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_AddFlysToPage." );
+ OSL_ENSURE( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_AddFlysToPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
@@ -2761,7 +2696,7 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGrow )
{
- ASSERT( pSav && pParent, "Kein Save oder Parent fuer Restore." );
+ OSL_ENSURE( pSav && pParent, "Kein Save oder Parent fuer Restore." );
SWRECTFN( pParent )
//Wenn es bereits FlowFrms unterhalb des neuen Parent gibt, so wird die
@@ -2854,9 +2789,6 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
|* SqRt() Berechnung der Quadratwurzel, damit die math.lib
|* nicht auch noch dazugelinkt werden muss.
|*
-|* Ersterstellung OK ??
-|* Letzte Aenderung MA 09. Jan. 97
-|*
|*************************************************************************/
sal_uLong MA_FASTCALL SqRt( BigInt nX )
@@ -2879,9 +2811,6 @@ sal_uLong MA_FASTCALL SqRt( BigInt nX )
|*
|* InsertNewPage() Einsetzen einer neuen Seite.
|*
-|* Ersterstellung MA 01. Jul. 93
-|* Letzte Aenderung MA 31. Jul. 95
-|*
|*************************************************************************/
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
@@ -2896,7 +2825,7 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
if ( !pFmt )
{
pFmt = bOdd ? rDesc.GetLeftFmt() : rDesc.GetRightFmt();
- ASSERT( pFmt, "Descriptor without any format?!" );
+ OSL_ENSURE( pFmt, "Descriptor without any format?!" );
bInsertEmpty = !bInsertEmpty;
}
if( bInsertEmpty )
@@ -2922,9 +2851,6 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
|* eine Layoutstruktur und melden alle FlyFrms, die einen beliebigen Frm
|* innerhalb der Struktur als Anker haben bei der Seite an.
|*
-|* Ersterstellung MA 08. Jul. 93
-|* Letzte Aenderung MA 07. Jul. 95
-|*
|*************************************************************************/
void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
@@ -2995,8 +2921,6 @@ void RegistFlys( SwPageFrm *pPage, const SwLayoutFrm *pLay )
|*
|* Beschreibung Benachrichtigt den Hintergrund je nach der
|* Veraenderung zwischen altem und neuem Rechteckt.
-|* Ersterstellung MA 18. Jun. 93
-|* Letzte Aenderung MA 06. Jun. 96
|*
|*************************************************************************/
@@ -3385,7 +3309,7 @@ sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm();
aPos = pObj->GetCurrentBoundRect().TopLeft();
}
- ASSERT( pFrm, "8-( Fly is lost in Space." );
+ OSL_ENSURE( pFrm, "8-( Fly is lost in Space." );
pFrm = GetVirtualUpper( pFrm, aPos );
do
{ if ( pFrm == pCurrFrm )
@@ -3687,7 +3611,7 @@ void GetSpacingValuesOfFrm( const SwFrm& rFrm,
static_cast<const SwTxtFrm&>(rFrm).GetLineSpace( true ) == 0;
}
- ASSERT( onLowerSpacing >= 0 && onLineSpacing >= 0,
+ OSL_ENSURE( onLowerSpacing >= 0 && onLineSpacing >= 0,
"<GetSpacingValuesOfFrm(..)> - spacing values aren't positive!" );
}
}
@@ -3738,3 +3662,4 @@ bool SwDeletionChecker::HasBeenDeleted()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 08dee8d2e40e..ffbbd530bfd5 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <txtftn.hxx>
#include <fmtftn.hxx>
#include <ftnidx.hxx>
@@ -58,9 +58,6 @@
|* Dokument, dort stehen die Fussnoten gluecklicherweise nach ihrem
|* Index sortiert.
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 13. Dec. 93
-|*
|*************************************************************************/
#define ENDNOTE 0x80000000
@@ -69,29 +66,6 @@ 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 ( sal_uInt16 k = 0; k+1 < rFtnIdxs.Count(); ++k )
- {
- SwIndex aIdx1(&pDoc->GetNodes());
- SwIndex aIdx2(&pDoc->GetNodes());
- rFtnIdxs[k]->pFtn-> GetTxtNode().GetIndex(aIdx1);
- rFtnIdxs[k+1]->pFtn->GetTxtNode().GetIndex(aIdx2);
- if ( aIdx1.GetIndex() > aIdx2.GetIndex() )
- {
- ASSERT( !rFtnIdxs.Count(), "FtnIdxs not up to date" );
- }
- else if ( aIdx1.GetIndex() == aIdx2.GetIndex() )
- {
- SwTxtFtn *p1 = rFtnIdxs[k];
- SwTxtFtn *p2 = rFtnIdxs[k+1];
- ASSERT( *p1->GetStart() < *p2->GetStart(),
- "FtnIdxs not up to date" );
- }
- }
-#endif
-
sal_uInt16 nRet;
SwTxtFtnPtr pBla = (SwTxtFtn*)pAttr;
if ( rFtnIdxs.Seek_Entry( pBla, &nRet ) )
@@ -100,14 +74,14 @@ sal_uLong MA_FASTCALL lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
return sal_uLong(nRet) + ENDNOTE;
return nRet;
}
- ASSERT( !pDoc, "FtnPos not found." );
+ OSL_ENSURE( !pDoc, "FtnPos not found." );
return 0;
}
sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
{
const SwDoc* pDoc = GetFmt()->GetDoc();
- ASSERT( pDoc, "SwFtnFrm: Missing doc!" );
+ OSL_ENSURE( pDoc, "SwFtnFrm: Missing doc!" );
return lcl_FindFtnPos( pDoc, GetAttr() ) <
lcl_FindFtnPos( pDoc, pTxtFtn );
}
@@ -119,9 +93,6 @@ sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
|* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird
|* enthaelt pPage die neue Seite und die Funktion liefert sal_True.
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
@@ -139,7 +110,7 @@ sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
SwSectionFrm* pSct = rpBoss->FindSctFrm()->GetFollow();
if( pSct )
{
- ASSERT( pSct->Lower() && pSct->Lower()->IsColumnFrm(),
+ OSL_ENSURE( pSct->Lower() && pSct->Lower()->IsColumnFrm(),
"Where's the column?" );
rpBoss = (SwColumnFrm*)pSct->Lower();
SwPageFrm* pOld = rpPage;
@@ -171,9 +142,6 @@ sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
|* liefert die Spaltennummer, wenn pBoss eine Spalte ist,
|* sonst eine Null (bei Seiten).
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
@@ -208,9 +176,6 @@ sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
|*
|* SwFtnContFrm::SwFtnContFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 02. Mar. 93
-|*
|*************************************************************************/
@@ -257,8 +222,6 @@ long lcl_Undersize( const SwFrm* pFrm )
|*
|* Beschreibung: "Formatiert" den Frame;
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 01. Mar. 93
-|* Letzte Aenderung MA 17. Nov. 98
|*
|*************************************************************************/
@@ -340,9 +303,6 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
|*
|* SwFtnContFrm::GrowFrm(), ShrinkFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung AMA 05. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
@@ -353,9 +313,9 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
//moeglich.
//Wenn die Seite eine spezielle Fussnotenseite ist, so nehmen wir uns auch
//soviel Platz wie eben moeglich.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( !GetUpper() || !GetUpper()->IsFtnBossFrm() )
- { ASSERT( !this, "Keine FtnBoss." );
+ { OSL_ENSURE( !this, "Keine FtnBoss." );
return 0;
}
#endif
@@ -369,7 +329,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
if( IsInSct() )
{
SwSectionFrm* pSect = FindSctFrm();
- ASSERT( pSect, "GrowFrm: Missing SectFrm" );
+ OSL_ENSURE( pSect, "GrowFrm: Missing SectFrm" );
// In a section, which has to maximize, a footnotecontainer is allowed
// to grow, when the section can't grow anymore.
if( !bTst && !pSect->IsColLocked() &&
@@ -507,9 +467,6 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwFtnFrm::SwFtnFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 11. Oct. 93
-|*
|*************************************************************************/
@@ -531,9 +488,6 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
|*
|* SwFtnFrm::InvalidateNxtFtnCnts()
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 29. Jun. 93
-|*
|*************************************************************************/
@@ -561,11 +515,10 @@ void SwFtnFrm::InvalidateNxtFtnCnts( SwPageFrm *pPage )
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
-#if OSL_DEBUG_LEVEL > 1
static sal_uInt16 nNum = USHRT_MAX;
SwTxtFtn* pTxtFtn = GetAttr();
if ( pTxtFtn->GetFtn().GetNumber() == nNum )
@@ -574,14 +527,12 @@ SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
(void)bla;
}
-#endif
return SwLayoutFrm::GrowFrm( nDist, bTst, bInfo );
}
SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
-#if OSL_DEBUG_LEVEL > 1
static sal_uInt16 nNum = USHRT_MAX;
if( nNum != USHRT_MAX )
{
@@ -592,7 +543,6 @@ SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
(void)bla;
}
}
-#endif
return SwLayoutFrm::ShrinkFrm( nDist, bTst, bInfo );
}
#endif
@@ -601,9 +551,6 @@ SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwFtnFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 24. Jul. 95
-|*
|*************************************************************************/
@@ -662,19 +609,16 @@ void SwFtnFrm::Cut()
|*
|* SwFtnFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
{
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetNext() && !GetUpper(),
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
//In den Baum einhaengen.
@@ -694,7 +638,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
//Wenn mein Vorgaenger mein Master ist und/oder wenn mein Nachfolger mein
//Follow ist so kann ich deren Inhalt uebernehmen und sie vernichten.
if ( GetPrev() && GetPrev() == GetMaster() )
- { ASSERT( SwFlowFrm::CastFlowFrm( GetPrev()->GetLower() ),
+ { OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetPrev()->GetLower() ),
"Fussnote ohne Inhalt?" );
(SwFlowFrm::CastFlowFrm( GetPrev()->GetLower()))->
MoveSubTree( this, GetLower() );
@@ -703,23 +647,23 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
delete pDel;
}
if ( GetNext() && GetNext() == GetFollow() )
- { ASSERT( SwFlowFrm::CastFlowFrm( GetNext()->GetLower() ),
+ { OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetNext()->GetLower() ),
"Fussnote ohne Inhalt?" );
(SwFlowFrm::CastFlowFrm( GetNext()->GetLower()))->MoveSubTree( this );
SwFrm *pDel = GetNext();
pDel->Cut();
delete pDel;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwDoc *pDoc = GetFmt()->GetDoc();
if ( GetPrev() )
{
- ASSERT( lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetPrev())->GetAttr() ) <=
+ OSL_ENSURE( lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetPrev())->GetAttr() ) <=
lcl_FindFtnPos( pDoc, GetAttr() ), "Prev ist not FtnPrev" );
}
if ( GetNext() )
{
- ASSERT( lcl_FindFtnPos( pDoc, GetAttr() ) <=
+ OSL_ENSURE( lcl_FindFtnPos( pDoc, GetAttr() ) <=
lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetNext())->GetAttr() ),
"Next is not FtnNext" );
}
@@ -734,8 +678,6 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|* Frame gemoved werden kann.
|* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 09. Nov. 98
|*
|*************************************************************************/
@@ -756,7 +698,7 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
SwLayoutFrm* pNxt = pOldBoss->GetNextSctLeaf( eMakePage );
if( pNxt )
{
- ASSERT( pNxt->IsColBodyFrm(), "GetNextFtnLeaf: Funny Leaf" );
+ OSL_ENSURE( pNxt->IsColBodyFrm(), "GetNextFtnLeaf: Funny Leaf" );
pBoss = (SwFtnBossFrm*)pNxt->GetUpper();
pPage = pBoss->FindPageFrm();
}
@@ -829,8 +771,6 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
|*
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|* Frame gemoved werden kann.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 06. Nov. 98
|*
|*************************************************************************/
@@ -894,7 +834,7 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
pSect = (SwSectionFrm*)pSect->FindMaster();
if( !pSect || !pSect->Lower() )
return 0;
- ASSERT( pSect->Lower()->IsColumnFrm(),
+ OSL_ENSURE( pSect->Lower()->IsColumnFrm(),
"GetPrevFtnLeaf: Where's the column?" );
pNxtBoss = (SwFtnBossFrm*)pSect->Lower();
pBody = pSect;
@@ -962,9 +902,6 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
|*
|* SwFrm::IsFtnAllowed()
|*
-|* Ersterstellung MA 22. Mar. 94
-|* Letzte Aenderung MA 01. Dec. 94
-|*
|*************************************************************************/
@@ -987,9 +924,6 @@ sal_Bool SwFrm::IsFtnAllowed() const
|*
|* SwRootFrm::UpdateFtnNums()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung MA 09. Dec. 97
-|*
|*************************************************************************/
@@ -1012,9 +946,6 @@ void SwRootFrm::UpdateFtnNums()
|* RemoveFtns() Entfernen aller Fussnoten (nicht etwa die Referenzen)
|* und Entfernen aller Fussnotenseiten.
|*
-|* Ersterstellung MA 05. Dec. 97
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes )
@@ -1025,7 +956,7 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes
if ( pCont )
{
SwFtnFrm *pFtn = (SwFtnFrm*)pCont->Lower();
- ASSERT( pFtn, "FtnCont ohne Ftn." );
+ OSL_ENSURE( pFtn, "FtnCont ohne Ftn." );
if ( bPageOnly )
while ( pFtn->GetMaster() )
pFtn = pFtn->GetMaster();
@@ -1108,9 +1039,6 @@ void SwRootFrm::RemoveFtns( SwPageFrm *pPage, sal_Bool bPageOnly, sal_Bool bEndN
|*
|* SetFtnPageDescs() Seitenvorlagen der Fussnotenseiten aendern
|*
-|* Ersterstellung MA 11. Dec. 97
-|* Letzte Aenderung MA 11. Dec. 97
-|*
|*************************************************************************/
void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
@@ -1129,9 +1057,6 @@ void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
|*
|* SwFtnBossFrm::MakeFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1141,9 +1066,9 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
//immer direkt hinter dem Bodytext.
//Sein FrmFmt ist immer das DefaultFrmFmt.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( FindFtnCont() )
- { ASSERT( !this, "Fussnotencontainer bereits vorhanden." );
+ { OSL_ENSURE( !this, "Fussnotencontainer bereits vorhanden." );
return 0;
}
#endif
@@ -1158,9 +1083,6 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
|*
|* SwFtnBossFrm::FindFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1170,14 +1092,14 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
while( pFrm && !pFrm->IsFtnContFrm() )
pFrm = pFrm->GetNext();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( pFrm )
{
SwFrm *pFtn = pFrm->GetLower();
- ASSERT( pFtn, "Cont ohne Fussnote." );
+ OSL_ENSURE( pFtn, "Cont ohne Fussnote." );
while ( pFtn )
{
- ASSERT( pFtn->IsFtnFrm(), "Nachbar von Fussnote keine Fussnote." );
+ OSL_ENSURE( pFtn->IsFtnFrm(), "Nachbar von Fussnote keine Fussnote." );
pFtn = pFtn->GetNext();
}
}
@@ -1190,9 +1112,6 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
|*
|* SwFtnBossFrm::FindNearestFtnCont() Sucht den naechst greifbaren Fussnotencontainer.
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
@@ -1225,8 +1144,6 @@ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibung Erste Fussnote des Fussnotenbosses suchen.
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 99
|*
|*************************************************************************/
@@ -1250,7 +1167,7 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
if( pRet )
{
pBoss = pRet->GetRef()->FindFtnBossFrm();
- ASSERT( pBoss, "FindFirstFtn: No boss found" );
+ OSL_ENSURE( pBoss, "FindFirstFtn: No boss found" );
if( !pBoss )
return sal_False; // ?There must be a bug, but no GPF
pPage = pBoss->FindPageFrm();
@@ -1314,8 +1231,6 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibunt Erste Fussnote zum Cnt suchen.
-|* Ersterstellung MA 04. Mar. 93
-|* Letzte Aenderung AMA 28. Oct. 98
|*
|*************************************************************************/
@@ -1357,9 +1272,6 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
|*
|* SwFtnBossFrm::ResetFtn()
|*
-|* Ersterstellung MA 11. May. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1367,7 +1279,7 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
{
//Vernichten der Inkarnationen von Fussnoten zum Attribut, wenn sie nicht
//zu pAssumed gehoeren.
- ASSERT( !pCheck->GetMaster(), "Master not an Master." );
+ OSL_ENSURE( !pCheck->GetMaster(), "Master not an Master." );
SwNodeIndex aIdx( *pCheck->GetAttr()->GetStartNode(), 1 );
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
@@ -1407,22 +1319,11 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
|*
|* SwFtnBossFrm::InsertFtn()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
-#if (OSL_DEBUG_LEVEL > 1) && defined(DBG_UTIL)
- static sal_uInt16 nStop = 0;
- if ( nStop == pNew->GetFrmId() )
- {
- int bla = 5;
- (void)bla;
- }
-#endif
//Die Fussnote haben wir, sie muss jetzt nur noch irgendwo
//hin und zwar vor die Fussnote, deren Attribut vor das
//der neuen zeigt (Position wird ueber das Doc ermittelt)
@@ -1528,7 +1429,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
//werden.
pSibling = (SwFtnFrm*)pParent->Lower();
if ( !pSibling )
- { ASSERT( !this, "Keinen Platz fuer Fussnote gefunden.");
+ { OSL_ENSURE( !this, "Keinen Platz fuer Fussnote gefunden.");
return;
}
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
@@ -1547,7 +1448,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
if ( pSibling->GetNext() )
{
pSibling = (SwFtnFrm*)pSibling->GetNext();
- ASSERT( !pSibling->GetMaster() || ( ENDNOTE > nStPos &&
+ OSL_ENSURE( !pSibling->GetMaster() || ( ENDNOTE > nStPos &&
pSibling->GetAttr()->GetFtn().IsEndNote() ),
"InsertFtn: Master expected I" );
}
@@ -1569,7 +1470,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
if ( pSibling )
{
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
- ASSERT( nCmpPos > nLastPos, "InsertFtn: Order of FtnFrm's buggy" );
+ OSL_ENSURE( nCmpPos > nLastPos, "InsertFtn: Order of FtnFrm's buggy" );
}
}
// pLastSib ist jetzt die letzte Fussnote vor uns,
@@ -1589,7 +1490,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
pSibling = pLastSib;
while( pSibling->GetFollow() )
pSibling = pSibling->GetFollow();
- ASSERT( !pSibling->GetNext(), "InsertFtn: Who's that guy?" );
+ OSL_ENSURE( !pSibling->GetNext(), "InsertFtn: Who's that guy?" );
}
}
}
@@ -1668,7 +1569,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
{
if( ENDNOTE > nCmpPos || nStPos >= ENDNOTE )
{
- ASSERT( sal_False, "InsertFtn: Master expected II" );
+ OSL_ENSURE( sal_False, "InsertFtn: Master expected II" );
do
pSibling = pSibling->GetMaster();
while ( pSibling->GetMaster() );
@@ -1677,7 +1578,7 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
pParent = (SwFtnContFrm*)pSibling->GetUpper();
}
}
- ASSERT( pParent, "paste in space?" );
+ OSL_ENSURE( pParent, "paste in space?" );
pNew->Paste( pParent, pSibling );
}
@@ -1685,9 +1586,6 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
|*
|* SwFtnBossFrm::AppendFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1749,7 +1647,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
SwFtnContFrm *pCont = pNxt->FindFtnCont();
if ( pCont && pCont->Lower() )
{
- ASSERT( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
+ OSL_ENSURE( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
if ( nStPos > ::lcl_FindFtnPos( pDoc,
((SwFtnFrm*)pCont->Lower())->GetAttr()))
{
@@ -1792,7 +1690,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
SwFtnContFrm *pCont = pNxt->FindFtnCont();
if ( pCont && pCont->Lower() )
{
- ASSERT( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
+ OSL_ENSURE( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
if ( nStPos > ::lcl_FindFtnPos( pDoc,
((SwFtnFrm*)pCont->Lower())->GetAttr()))
{
@@ -1808,7 +1706,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
//Erstmal eine Fussnote und die benoetigten CntntFrms anlegen.
if ( !pAttr->GetStartNode() )
- { ASSERT( !this, "Kein Fussnoteninhalt." );
+ { OSL_ENSURE( !this, "Kein Fussnoteninhalt." );
return;
}
@@ -1842,7 +1740,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
if( bChgPage )
{
SwLayoutFrm* pBody = pPage->FindBodyCont();
- ASSERT( pBody, "AppendFtn: NoPageBody?" );
+ OSL_ENSURE( pBody, "AppendFtn: NoPageBody?" );
if( pBody->Lower() && pBody->Lower()->IsColumnFrm() )
pBoss = (SwFtnBossFrm*)pBody->Lower();
else
@@ -1920,16 +1818,13 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::FindFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
{
//Der einfachste und sicherste Weg geht ueber das Attribut.
- ASSERT( pAttr->GetStartNode(), "FtnAtr ohne StartNode." );
+ OSL_ENSURE( pAttr->GetStartNode(), "FtnAtr ohne StartNode." );
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
if ( !pNd )
@@ -1971,9 +1866,6 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::RemoveFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1992,7 +1884,7 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
} while ( pFtn );
if( bPrep && pRef->IsFollow() )
{
- ASSERT( pRef->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+ OSL_ENSURE( pRef->IsTxtFrm(), "NoTxtFrm has Footnote?" );
SwTxtFrm* pMaster = (SwTxtFrm*)pRef->FindMaster();
if( !pMaster->IsLocked() )
pMaster->Prepare( PREP_FTN_GONE );
@@ -2005,9 +1897,6 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::ChangeFtnRef()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2026,9 +1915,6 @@ void SwFtnBossFrm::ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2094,9 +1980,6 @@ void SwFtnBossFrm::CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
inline void FtnInArr( SvPtrarr& rFtnArr, SwFtnFrm* pFtn )
{
@@ -2119,7 +2002,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
// OD 03.04.2003 #108446# - assert, that no reference footnote boss frame
// is set, in spite of the order, that only previous footnotes has to be
// collected.
- ASSERT( !_bCollectOnlyPreviousFtns || _pRefFtnBossFrm,
+ OSL_ENSURE( !_bCollectOnlyPreviousFtns || _pRefFtnBossFrm,
"<SwFtnBossFrm::_CollectFtns(..)> - No reference footnote boss frame for collecting only previous footnotes set.\nCrash will be caused!" );
//Alle Fussnoten die von pRef referenziert werden nacheinander
@@ -2138,7 +2021,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
//Hier sollte keiner mit einer Follow-Ftn ankommen, es sei denn er hat
//ernste Absichten (:-)); spricht er kommt mit einer Ftn an die vor der
//ersten der Referenz liegt.
- ASSERT( !_pFtn->GetMaster() || _pFtn->GetRef() != _pRef, "FollowFtn moven?" );
+ OSL_ENSURE( !_pFtn->GetMaster() || _pFtn->GetRef() != _pRef, "FollowFtn moven?" );
while ( _pFtn->GetMaster() )
_pFtn = _pFtn->GetMaster();
@@ -2178,13 +2061,13 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
} while( !pNxtFtn && pBoss );
}
else if( !pNxtFtn->GetAttr()->GetFtn().IsEndNote() )
- { ASSERT( !pNxtFtn->GetMaster(), "_CollectFtn: Master exspected" );
+ { OSL_ENSURE( !pNxtFtn->GetMaster(), "_CollectFtn: Master exspected" );
while ( pNxtFtn->GetMaster() )
pNxtFtn = pNxtFtn->GetMaster();
}
if ( pNxtFtn == _pFtn )
{
- ASSERT( sal_False, "_CollectFtn: Devil's circle" );
+ OSL_ENSURE( sal_False, "_CollectFtn: Devil's circle" );
pNxtFtn = 0;
}
@@ -2195,7 +2078,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
if ( _bCollectOnlyPreviousFtns )
{
SwFtnBossFrm* pBossOfFoundFtn = _pFtn->FindFtnBossFrm( sal_True );
- ASSERT( pBossOfFoundFtn,
+ OSL_ENSURE( pBossOfFoundFtn,
"<SwFtnBossFrm::_CollectFtns(..)> - footnote boss frame of found footnote frame missing.\nWrong layout!" );
if ( !pBossOfFoundFtn || // don't crash, if no footnote boss is found.
pBossOfFoundFtn->IsBefore( _pRefFtnBossFrm )
@@ -2212,7 +2095,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
if ( bCollectFoundFtn )
{
- ASSERT( !_pFtn->GetMaster(), "FollowFtn moven?" );
+ OSL_ENSURE( !_pFtn->GetMaster(), "FollowFtn moven?" );
SwFtnFrm *pNxt = _pFtn->GetFollow();
while ( pNxt )
{
@@ -2227,7 +2110,7 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
} while ( pCnt );
}
else
- { ASSERT( !pNxt, "Fussnote ohne Inhalt?" );
+ { OSL_ENSURE( !pNxt, "Fussnote ohne Inhalt?" );
pNxt->Cut();
delete pNxt;
}
@@ -2256,9 +2139,6 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_MoveFtns()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2393,7 +2273,7 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
}
}
else
- { ASSERT( !pFtn->GetMaster() && !pFtn->GetFollow(),
+ { OSL_ENSURE( !pFtn->GetMaster() && !pFtn->GetFollow(),
"DelFtn und Master/Follow?" );
delete pFtn;
// --> OD 2004-06-10 #i21478#
@@ -2474,9 +2354,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
|*
|* SwFtnBossFrm::MoveFtns()
|*
-|* Ersterstellung BP 05. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2488,7 +2365,7 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|| pAttr->GetFtn().IsEndNote() )
return;
- ASSERT( this == pSrc->FindFtnBossFrm( sal_True ),
+ OSL_ENSURE( this == pSrc->FindFtnBossFrm( TRUE ),
"SwPageFrm::MoveFtns: source frame isn't on that FtnBoss" );
SwFtnFrm *pFtn = FindFirstFtn();
@@ -2496,7 +2373,7 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
{
ChangeFtnRef( pSrc, pAttr, pDest );
SwFtnBossFrm *pDestBoss = pDest->FindFtnBossFrm( sal_True );
- ASSERT( pDestBoss, "+SwPageFrm::MoveFtns: no destination boss" );
+ OSL_ENSURE( pDestBoss, "+SwPageFrm::MoveFtns: no destination boss" );
if( pDestBoss ) // robust
{
SvPtrarr aFtnArr( 5, 5 );
@@ -2522,9 +2399,6 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|*
|* SwFtnBossFrm::RearrangeFtns()
|*
-|* Ersterstellung MA 20. Jan. 94
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2662,7 +2536,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
!pFtnFrm->IsColLocked() )
{
// --> OD 2005-08-10 #i49383#
- ASSERT( pLastFtnFrm == pFtnFrm,
+ OSL_ENSURE( pLastFtnFrm == pFtnFrm,
"<SwFtnBossFrm::RearrangeFtns(..)> - <pLastFtnFrm> != <pFtnFrm>" );
pLastFtnFrm = 0L;
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
@@ -2766,9 +2640,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
|*
|* SwPageFrm::UpdateFtnNum()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
void SwPageFrm::UpdateFtnNum()
@@ -2808,11 +2679,11 @@ void SwPageFrm::UpdateFtnNum()
else
{
SwFtnBossFrm* pTmpBoss = pFtn->FindFtnBossFrm( sal_True );
- SwPageFrm* pPage = pTmpBoss->FindPageFrm();
- pFtn = NULL;
- lcl_NextFtnBoss( pTmpBoss, pPage, sal_False );
if( pTmpBoss )
{
+ SwPageFrm* pPage = pTmpBoss->FindPageFrm();
+ pFtn = NULL;
+ lcl_NextFtnBoss( pTmpBoss, pPage, sal_False );
SwFtnContFrm *pCont = pTmpBoss->FindNearestFtnCont();
if ( pCont )
pFtn = (SwFtnFrm*)pCont->Lower();
@@ -2831,9 +2702,6 @@ void SwPageFrm::UpdateFtnNum()
|*
|* SwFtnBossFrm::SetFtnDeadLine()
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
@@ -2867,9 +2735,6 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
|*
|* SwFtnBossFrm::GetVarSpace()
|*
-|* Ersterstellung MA 03. Apr. 95
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnBossFrm::GetVarSpace() const
{
@@ -2880,7 +2745,7 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
// die ganze Seite/Spalte ein.
const SwPageFrm* pPg = FindPageFrm();
- ASSERT( pPg || IsInSct(), "Footnote lost page" );
+ OSL_ENSURE( pPg || IsInSct(), "Footnote lost page" );
const SwFrm *pBody = FindBodyCont();
SwTwips nRet;
@@ -2897,7 +2762,7 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
// the bottom of the last contentfrm
if( pSect->IsEndnAtEnd() ) // endnotes allowed?
{
- ASSERT( !Lower() || !Lower()->GetNext() || Lower()->GetNext()->
+ OSL_ENSURE( !Lower() || !Lower()->GetNext() || Lower()->GetNext()->
IsFtnContFrm(), "FtnContainer exspected" );
const SwFtnContFrm* pCont = Lower() ?
(SwFtnContFrm*)Lower()->GetNext() : 0;
@@ -2952,9 +2817,6 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
|* gibt und die Fussnoten nicht vom Bereich eingesammelt werden, ist ein Adjust..,
|* ansonsten ein Grow/Shrink notwendig.
|*
-|* Ersterstellung AMA 09. Dec 98
-|* Letzte Aenderung AMA 09. Dec 98
-|*
|*************************************************************************/
sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
@@ -2967,18 +2829,18 @@ sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
nRet = NA_GROW_SHRINK;
else
{
- ASSERT( GetUpper()->IsSctFrm(), "NeighbourhoodAdjustment: Unexspected Upper" );
+ OSL_ENSURE( GetUpper()->IsSctFrm(), "NeighbourhoodAdjustment: Unexspected Upper" );
if( !GetNext() && !GetPrev() )
nRet = NA_GROW_ADJUST; // section with a single column (FtnAtEnd)
else
{
const SwFrm* pTmp = Lower();
- ASSERT( pTmp, "NeighbourhoodAdjustment: Missing Lower()" );
+ OSL_ENSURE( pTmp, "NeighbourhoodAdjustment: Missing Lower()" );
if( !pTmp->GetNext() )
nRet = NA_GROW_SHRINK;
else if( !GetUpper()->IsColLocked() )
nRet = NA_ADJUST_GROW;
- ASSERT( !pTmp->GetNext() || pTmp->GetNext()->IsFtnContFrm(),
+ OSL_ENSURE( !pTmp->GetNext() || pTmp->GetNext()->IsFtnContFrm(),
"NeighbourhoodAdjustment: Who's that guy?" );
}
}
@@ -2990,9 +2852,6 @@ sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
|*
|* SwPageFrm::SetColMaxFtnHeight()
|*
-|* Ersterstellung AMA 29. Oct 98
-|* Letzte Aenderung AMA 29. Oct 98
-|*
|*************************************************************************/
void SwPageFrm::SetColMaxFtnHeight()
{
@@ -3012,9 +2871,6 @@ void SwPageFrm::SetColMaxFtnHeight()
|*
|* SwLayoutFrm::MoveLowerFtns
|*
-|* Ersterstellung MA 01. Sep. 94
-|* Letzte Aenderung MA 05. Sep. 95
-|*
|*************************************************************************/
@@ -3053,7 +2909,7 @@ sal_Bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
pStart = pStart->GetNextCntntFrm();
}
- ASSERT( pOldBoss->IsInSct() == pNewBoss->IsInSct(),
+ OSL_ENSURE( pOldBoss->IsInSct() == pNewBoss->IsInSct(),
"MoveLowerFtns: Section confusion" );
SvPtrarr *pFtnArr;
SwLayoutFrm* pNewChief = 0;
@@ -3110,15 +2966,12 @@ sal_Bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
|*
|* SwLayoutFrm::MoveFtnCntFwd()
|*
-|* Ersterstellung MA 24. Nov. 94
-|* Letzte Aenderung MA 15. Jun. 95
-|*
|*************************************************************************/
sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
{
- ASSERT( IsInFtn(), "Keine Ftn." );
+ OSL_ENSURE( IsInFtn(), "Keine Ftn." );
SwLayoutFrm *pFtn = FindFtnFrm();
// The first paragraph in the first footnote in the first column in the
@@ -3177,7 +3030,7 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
SwFtnFrm* pTmpFtn = pNewUpper->IsFtnFrm() ? ((SwFtnFrm*)pNewUpper) : 0;
if( !pTmpFtn )
{
- ASSERT( pNewUpper->IsFtnContFrm(), "Neuer Upper kein FtnCont.");
+ OSL_ENSURE( pNewUpper->IsFtnContFrm(), "Neuer Upper kein FtnCont.");
SwFtnContFrm *pCont = (SwFtnContFrm*)pNewUpper;
//Fussnote erzeugen.
@@ -3199,7 +3052,7 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
pTmpFtn->Paste( pCont, pNx );
pTmpFtn->Calc();
}
- ASSERT( pTmpFtn->GetAttr() == FindFtnFrm()->GetAttr(), "Wrong Footnote!" );
+ OSL_ENSURE( pTmpFtn->GetAttr() == FindFtnFrm()->GetAttr(), "Wrong Footnote!" );
// Bereiche in Fussnoten beduerfen besonderer Behandlung
SwLayoutFrm *pNewUp = pTmpFtn;
if( IsInSct() )
@@ -3231,7 +3084,7 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
pTmpNxt = (SwSectionFrm*)pTmp;
else
{
- ASSERT( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" );
+ OSL_ENSURE( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" );
pTmpNxt = (SwTabFrm*)pTmp;
}
pTmpNxt->MoveSubTree( pTmpFtn, pNewUp->GetNext() );
@@ -3252,9 +3105,6 @@ sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
|*
|* class SwSaveFtnHeight
|*
-|* Ersterstellung MA 19. Jan. 94
-|* Letzte Aenderung MA 19. Jan. 94
-|*
|*************************************************************************/
@@ -3277,7 +3127,7 @@ SwSaveFtnHeight::~SwSaveFtnHeight()
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//JP 15.10.2001: in a non pro version test if the attribute has the same
// meaning which his reference is
@@ -3289,7 +3139,7 @@ SwSaveFtnHeight::~SwSaveFtnHeight()
const SwCntntFrm* SwFtnFrm::GetRef() const
{
const SwCntntFrm* pRefAttr = GetRefFromAttr();
- ASSERT( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
+ OSL_ENSURE( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
|| pRefAttr->IsAnFollow( pRef ),
"access to deleted Frame? pRef != pAttr->GetRef()" );
return pRef;
@@ -3298,7 +3148,7 @@ const SwCntntFrm* SwFtnFrm::GetRef() const
SwCntntFrm* SwFtnFrm::GetRef()
{
const SwCntntFrm* pRefAttr = GetRefFromAttr();
- ASSERT( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
+ OSL_ENSURE( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
|| pRefAttr->IsAnFollow( pRef ),
"access to deleted Frame? pRef != pAttr->GetRef()" );
return pRef;
@@ -3314,7 +3164,7 @@ const SwCntntFrm* SwFtnFrm::GetRefFromAttr() const
SwCntntFrm* SwFtnFrm::GetRefFromAttr()
{
- ASSERT( pAttr, "invalid Attribute" );
+ OSL_ENSURE( pAttr, "invalid Attribute" );
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, sal_False );
@@ -3367,3 +3217,4 @@ SwCntntFrm* SwFtnFrm::FindLastCntnt()
return pLastCntntFrm;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 57790fbb3eb3..298761e901e1 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include "pagefrm.hxx"
#include "viewsh.hxx"
#include "doc.hxx"
-#include "errhdl.hxx"
#include <fmtcntnt.hxx>
#include <fmthdft.hxx>
#include <fmtfsize.hxx>
@@ -125,7 +125,7 @@ SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, sal_uInt16 nTypeIn)
const SwFmtCntnt &rCnt = pFmt->GetCntnt();
- ASSERT( rCnt.GetCntntIdx(), "Kein Inhalt fuer Header." );
+ OSL_ENSURE( rCnt.GetCntntIdx(), "Kein Inhalt fuer Header." );
//Fuer Header Footer die Objekte gleich erzeugen lassen.
sal_Bool bOld = bObjsDirect;
@@ -281,7 +281,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
// --> OD 2005-05-03 #i46941# - frame has to be valid.
// Note: frame could be invalid after calling its format,
// if it's locked
- ASSERT( StackHack::IsLocked() || !pFrm->IsTxtFrm() ||
+ OSL_ENSURE( StackHack::IsLocked() || !pFrm->IsTxtFrm() ||
pFrm->IsValid() ||
static_cast<SwTxtFrm*>(pFrm)->IsJoinLocked(),
"<SwHeadFootFrm::FormatSize(..)> - text frame invalid and not locked." );
@@ -417,7 +417,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
void SwHeadFootFrm::Format(const SwBorderAttrs * pAttrs)
{
- ASSERT( pAttrs, "SwFooterFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "SwFooterFrm::Format, pAttrs ist 0." );
if ( bValidPrtArea && bValidSize )
return;
@@ -458,7 +458,7 @@ SwTwips SwHeadFootFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
SwBorderAttrAccess * pAccess =
new SwBorderAttrAccess( SwFrm::GetCache(), this );
- ASSERT(pAccess, "no border attributes");
+ OSL_ENSURE(pAccess, "no border attributes");
SwBorderAttrs * pAttrs = pAccess->Get();
@@ -591,7 +591,7 @@ SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
SwBorderAttrAccess * pAccess =
new SwBorderAttrAccess( SwFrm::GetCache(), this );
- ASSERT(pAccess, "no border attributes");
+ OSL_ENSURE(pAccess, "no border attributes");
SwBorderAttrs * pAttrs = pAccess->Get();
@@ -661,7 +661,7 @@ SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
sal_Bool SwHeadFootFrm::GetEatSpacing() const
{
const SwFrmFmt * pFmt = GetFmt();
- ASSERT(pFmt, "SwHeadFootFrm: no format?");
+ OSL_ENSURE(pFmt, "SwHeadFootFrm: no format?");
if (pFmt->GetHeaderAndFooterEatSpacing().GetValue())
return sal_True;
@@ -675,8 +675,6 @@ sal_Bool SwHeadFootFrm::GetEatSpacing() const
|* SwPageFrm::PrepareHeader()
|*
|* Beschreibung Erzeugt oder Entfernt Header
-|* Ersterstellung MA 04. Feb. 93
-|* Letzte Aenderung MA 12. May. 96
|*
|*************************************************************************/
@@ -714,7 +712,7 @@ void SwPageFrm::PrepareHeader()
if ( bOn && rH.IsActive() )
{ //Header einsetzen, vorher entfernen falls vorhanden.
- ASSERT( rH.GetHeaderFmt(), "FrmFmt fuer Header nicht gefunden." );
+ OSL_ENSURE( rH.GetHeaderFmt(), "FrmFmt fuer Header nicht gefunden." );
if ( pLay->GetFmt() == (SwFrmFmt*)rH.GetHeaderFmt() )
return; //Der Footer ist bereits der richtige
@@ -726,7 +724,7 @@ void SwPageFrm::PrepareHeader()
pDel->Cut();
delete pDel;
}
- ASSERT( pLay, "Wohin mit dem Header?" );
+ OSL_ENSURE( pLay, "Wohin mit dem Header?" );
SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt() );
pH->Paste( this, pLay );
if ( GetUpper() )
@@ -744,8 +742,6 @@ void SwPageFrm::PrepareHeader()
|* SwPageFrm::PrepareFooter()
|*
|* Beschreibung Erzeugt oder Entfernt Footer
-|* Ersterstellung MA 04. Feb. 93
-|* Letzte Aenderung MA 12. May. 96
|*
|*************************************************************************/
@@ -764,7 +760,7 @@ void SwPageFrm::PrepareFooter()
if ( bOn && rF.IsActive() )
{ //Footer einsetzen, vorher entfernen falls vorhanden.
- ASSERT( rF.GetFooterFmt(), "FrmFmt fuer Footer nicht gefunden." );
+ OSL_ENSURE( rF.GetFooterFmt(), "FrmFmt fuer Footer nicht gefunden." );
if ( pLay->GetFmt() == (SwFrmFmt*)rF.GetFooterFmt() )
return; //Der Footer ist bereits der richtige.
@@ -793,3 +789,4 @@ void SwPageFrm::PrepareFooter()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1608425d94ab..353cfb81a481 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include <time.h>
#include "rootfrm.hxx"
#include "pagefrm.hxx"
@@ -65,9 +64,6 @@
#include <editeng/brshitem.hxx>
#include <SwSmartTagMgr.hxx>
-#define _SVSTDARR_BOOLS
-#include <svl/svstdarr.hxx>
-
#define _LAYACT_CXX
#include "layact.hxx"
#include <swwait.hxx>
@@ -75,9 +71,7 @@
#include <fmtanchr.hxx>
#include <tools/shl.hxx>
#include <sfx2/progress.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include "swmodule.hxx"
#include "fmtline.hxx"
@@ -95,6 +89,7 @@
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
#include <PostItMgr.hxx>
+#include <vector>
// <--
//#pragma optimize("ity",on)
@@ -103,9 +98,6 @@
|*
|* SwLayAction Statisches Geraffel
|*
-|* Ersterstellung MA 22. Dec. 93
-|* Letzte Aenderung MA 22. Dec. 93
-|*
|*************************************************************************/
#define IS_FLYS (pPage->GetSortedObjs())
@@ -113,7 +105,7 @@
//Sparen von Schreibarbeit um den Zugriff auf zerstoerte Seiten zu vermeiden.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static void BreakPoint()
{
@@ -179,9 +171,6 @@ void SwLayAction::CheckWaitCrsr()
|*
|* SwLayAction::CheckIdleEnd()
|*
-|* Ersterstellung MA 12. Aug. 94
-|* Letzte Aenderung MA 24. Jun. 96
-|*
|*************************************************************************/
//Ist es wirklich schon soweit...
inline void SwLayAction::CheckIdleEnd()
@@ -194,9 +183,6 @@ inline void SwLayAction::CheckIdleEnd()
|*
|* SwLayAction::SetStatBar()
|*
-|* Ersterstellung MA 10. Aug. 94
-|* Letzte Aenderung MA 06. Aug. 95
-|*
|*************************************************************************/
void SwLayAction::SetStatBar( sal_Bool bNew )
{
@@ -217,8 +203,6 @@ void SwLayAction::SetStatBar( sal_Bool bNew )
|* Veraenderungen ausgegeben bzw. wird die auszugebende Flaeche in der
|* Region eingetragen.
|* PaintCntnt: fuellt die Region,
-|* Ersterstellung BP 19. Jan. 92
-|* Letzte Aenderung MA 10. Sep. 96
|*
|*************************************************************************/
sal_Bool SwLayAction::PaintWithoutFlys( const SwRect &rRect, const SwCntntFrm *pCnt,
@@ -373,9 +357,6 @@ void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt,
|*
|* SwLayAction::SwLayAction()
|*
-|* Ersterstellung MA 30. Oct. 92
-|* Letzte Aenderung MA 09. Jun. 95
-|*
|*************************************************************************/
SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) :
pRoot( pRt ),
@@ -401,7 +382,7 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) :
SwLayAction::~SwLayAction()
{
- ASSERT( !pWait, "Wait object not destroyed" );
+ OSL_ENSURE( !pWait, "Wait object not destroyed" );
pImp->pLayAct = 0; //Abmelden
}
@@ -409,9 +390,6 @@ SwLayAction::~SwLayAction()
|*
|* SwLayAction::Reset()
|*
-|* Ersterstellung MA 11. Aug. 94
-|* Letzte Aenderung MA 09. Jun. 95
-|*
|*************************************************************************/
void SwLayAction::Reset()
{
@@ -428,9 +406,6 @@ void SwLayAction::Reset()
|*
|* SwLayAction::RemoveEmptyBrowserPages()
|*
-|* Ersterstellung MA 10. Sep. 97
-|* Letzte Aenderung MA 10. Sep. 97
-|*
|*************************************************************************/
sal_Bool SwLayAction::RemoveEmptyBrowserPages()
@@ -464,9 +439,6 @@ sal_Bool SwLayAction::RemoveEmptyBrowserPages()
|*
|* SwLayAction::Action()
|*
-|* Ersterstellung MA 10. Aug. 94
-|* Letzte Aenderung MA 06. Aug. 95
-|*
|*************************************************************************/
void SwLayAction::Action()
{
@@ -590,7 +562,7 @@ class NotifyLayoutOfPageInProgress
void SwLayAction::InternalAction()
{
- ASSERT( pRoot->Lower()->IsPageFrm(), ":-( Keine Seite unterhalb der Root.");
+ OSL_ENSURE( pRoot->Lower()->IsPageFrm(), ":-( Keine Seite unterhalb der Root.");
pRoot->Calc();
@@ -721,7 +693,8 @@ void SwLayAction::InternalAction()
if ( ++nLoopControlRuns_1 > nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl_1 in SwLayAction::InternalAction" )
+ OSL_ENSURE( false, "LoopControl_1 in SwLayAction::InternalAction" );
+
#endif
break;
}
@@ -915,7 +888,7 @@ void SwLayAction::InternalAction()
if ( ++nLoopControlRuns_3 > nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl_3 in Interrupt formatting in SwLayAction::InternalAction" )
+ OSL_ENSURE( false, "LoopControl_3 in Interrupt formatting in SwLayAction::InternalAction" );
#endif
break;
}
@@ -940,7 +913,7 @@ void SwLayAction::InternalAction()
if ( ++nLoopControlRuns_2 > nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl_2 in Interrupt formatting in SwLayAction::InternalAction" )
+ OSL_ENSURE( false, "LoopControl_2 in Interrupt formatting in SwLayAction::InternalAction" );
#endif
break;
}
@@ -978,9 +951,6 @@ void SwLayAction::InternalAction()
|*
|* SwLayAction::TurboAction(), _TurboAction()
|*
-|* Ersterstellung MA 04. Dec. 92
-|* Letzte Aenderung MA 15. Aug. 93
-|*
|*************************************************************************/
sal_Bool SwLayAction::_TurboAction( const SwCntntFrm *pCnt )
{
@@ -1069,8 +1039,6 @@ sal_Bool SwLayAction::TurboAction()
|* Fuer den BrowseMode kann auch dann der ShortCut aktiviert werden,
|* wenn der ungueltige Inhalt der Seite unterhalb des sichbaren
|* bereiches liegt.
-|* Ersterstellung MA 30. Oct. 92
-|* Letzte Aenderung MA 18. Jul. 96
|*
|*************************************************************************/
static bool lcl_IsInvaLay( const SwFrm *pFrm, long nBottom )
@@ -1087,7 +1055,7 @@ static bool lcl_IsInvaLay( const SwFrm *pFrm, long nBottom )
static const SwFrm *lcl_FindFirstInvaLay( const SwFrm *pFrm, long nBottom )
{
- ASSERT( pFrm->IsLayoutFrm(), "FindFirstInvaLay, no LayFrm" );
+ OSL_ENSURE( pFrm->IsLayoutFrm(), "FindFirstInvaLay, no LayFrm" );
if (lcl_IsInvaLay(pFrm, nBottom))
return pFrm;
@@ -1157,7 +1125,7 @@ static const SwFrm *lcl_FindFirstInvaCntnt( const SwLayoutFrm *pLay, long nBotto
static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
long _nBottom )
{
- ASSERT( _pPage->GetSortedObjs(), "FindFirstInvaObj, no Objs" )
+ OSL_ENSURE( _pPage->GetSortedObjs(), "FindFirstInvaObj, no Objs" );
for ( sal_uInt16 i = 0; i < _pPage->GetSortedObjs()->Count(); ++i )
{
@@ -1411,14 +1379,11 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
|*
|* SwLayAction::FormatLayout(), FormatLayoutFly, FormatLayoutTab()
|*
-|* Ersterstellung MA 30. Oct. 92
-|* Letzte Aenderung MA 18. May. 98
-|*
|*************************************************************************/
// OD 15.11.2002 #105155# - introduce support for vertical layout
sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
{
- ASSERT( !IsAgain(), "Ungueltige Seite beachten." );
+ OSL_ENSURE( !IsAgain(), "Ungueltige Seite beachten." );
if ( IsAgain() )
return sal_False;
@@ -1462,8 +1427,6 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
if ( pLay->IsPageFrm() )
{
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
- const int nBorderWidth =
- pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->BorderPxWidth(), 0 ) ).Width();
const int nShadowWidth =
pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->ShadowPxWidth(), 0 ) ).Width();
@@ -1474,22 +1437,20 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
{
case sw::sidebarwindows::SIDEBAR_LEFT:
{
- aPaint.Left( aPaint.Left() - nBorderWidth - nSidebarWidth);
- aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth);
+ aPaint.Left( aPaint.Left() - nSidebarWidth);
+ aPaint.Right( aPaint.Right() + nShadowWidth);
}
break;
case sw::sidebarwindows::SIDEBAR_RIGHT:
{
- aPaint.Left( aPaint.Left() - nBorderWidth );
- aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth + nSidebarWidth);
+ aPaint.Right( aPaint.Right() + nShadowWidth + nSidebarWidth);
}
break;
case sw::sidebarwindows::SIDEBAR_NONE:
// nothing to do
break;
}
- aPaint.Top( aPaint.Top() - nBorderWidth );
- aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth);
+ aPaint.Bottom( aPaint.Bottom() + nShadowWidth );
}
if ( pLay->IsPageFrm() &&
@@ -1633,7 +1594,7 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
{
- ASSERT( !IsAgain(), "Ungueltige Seite beachten." );
+ OSL_ENSURE( !IsAgain(), "Ungueltige Seite beachten." );
if ( IsAgain() )
return sal_False;
@@ -1691,7 +1652,7 @@ sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
// Implement vertical layout support
sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect )
{
- ASSERT( !IsAgain(), "8-) Ungueltige Seite beachten." );
+ OSL_ENSURE( !IsAgain(), "8-) Ungueltige Seite beachten." );
if ( IsAgain() || !pTab->Lower() )
return sal_False;
@@ -1841,9 +1802,6 @@ sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect )
|*
|* SwLayAction::FormatCntnt()
|*
-|* Ersterstellung MA 30. Oct. 92
-|* Letzte Aenderung MA 16. Nov. 95
-|*
|*************************************************************************/
sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
{
@@ -2034,15 +1992,13 @@ sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
|*
|* 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
|*
|*************************************************************************/
void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
const SwPageFrm *pPage )
{
//wird sind hier evtl. nur angekommen, weil der Cntnt DrawObjekte haelt.
- const sal_Bool bDrawObjsOnly = pCntnt->IsValid() && !pCntnt->IsCompletePaint() &&
+ const bool bDrawObjsOnly = pCntnt->IsValid() && !pCntnt->IsCompletePaint() &&
!pCntnt->IsRetouche();
SWRECTFN( pCntnt )
if ( !bDrawObjsOnly && IsPaint() )
@@ -2075,8 +2031,6 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
|* Beschreibung:
|* - 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
|*
|*************************************************************************/
sal_Bool SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
@@ -2145,13 +2099,10 @@ sal_Bool SwLayAction::IsStopPrt() const
|*
|* SwLayAction::FormatSpelling(), _FormatSpelling()
|*
-|* Ersterstellung AMA 01. Feb. 96
-|* Letzte Aenderung AMA 01. Feb. 96
-|*
|*************************************************************************/
sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
{
- ASSERT( pCnt->IsTxtFrm(), "NoTxt neighbour of Txt" );
+ OSL_ENSURE( pCnt->IsTxtFrm(), "NoTxt neighbour of Txt" );
// robust against misuse by e.g. #i52542#
if( !pCnt->IsTxtFrm() )
return sal_False;
@@ -2289,7 +2240,7 @@ sal_Bool SwLayIdle::DoIdleJob( IdleJobType eJob, sal_Bool bVisAreaOnly )
!SwSmartTagMgr::Get().IsSmartTagsEnabled() )
return sal_False;
break;
- default: ASSERT( false, "Unknown idle job type" )
+ default: OSL_ENSURE( false, "Unknown idle job type" );
}
SwPageFrm *pPage;
@@ -2354,16 +2305,12 @@ sal_Bool SwLayIdle::DoIdleJob( IdleJobType eJob, sal_Bool bVisAreaOnly )
}
-#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
|*
|* void SwLayIdle::SwLayIdle()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 09. Jun. 94
-|*
|*************************************************************************/
void SwLayIdle::ShowIdle( ColorData eColorData )
{
@@ -2388,26 +2335,18 @@ void SwLayIdle::ShowIdle( ColorData eColorData )
#else
#define SHOW_IDLE( ColorData )
#endif
-#else
-#define SHOW_IDLE( ColorData )
-#endif
/*************************************************************************
|*
|* void SwLayIdle::SwLayIdle()
|*
-|* Ersterstellung MA 30. Oct. 92
-|* Letzte Aenderung MA 23. May. 95
-|*
|*************************************************************************/
SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
pRoot( pRt ),
pImp( pI )
-#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
, bIndicator( sal_False )
#endif
-#endif
{
pImp->pIdleAct = this;
@@ -2426,7 +2365,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
//Veraenderungen der Seitenzahl nicht zu unerwuenschten Effekten kommt.
//Wir merken uns bei welchen Shells der Cursor sichtbar ist, damit
//wir ihn bei Dokumentaenderung ggf. wieder sichbar machen koennen.
- SvBools aBools;
+ std::vector<bool> aBools;
ViewShell *pSh = pImp->GetShell();
do
{ ++pSh->nStartAction;
@@ -2587,27 +2526,15 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
if( pImp->IsAccessible() )
pImp->FireAccessibleEvents();
-#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
if ( bIndicator && pImp->GetShell()->GetWin() )
{
// #i75172# Do not invalidate indicator, this may cause a endless loop. Instead, just repaint it
// This should be replaced by an overlay object in the future, anyways. Since it's only for debug
// purposes, it is not urgent.
- static bool bCheckWithoutInvalidating(true);
- if(bCheckWithoutInvalidating)
- {
bIndicator = false; SHOW_IDLE( COL_LIGHTGREEN );
- }
- else
- {
- Rectangle aRect( 0, 0, 5, 5 );
- aRect = pImp->GetShell()->GetWin()->PixelToLogic( aRect );
- pImp->GetShell()->GetWin()->Invalidate( aRect );
- }
}
#endif
-#endif
}
SwLayIdle::~SwLayIdle()
@@ -2615,3 +2542,4 @@ SwLayIdle::~SwLayIdle()
pImp->pIdleAct = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index bab2154bc7a9..b0c49369ff2b 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -251,7 +252,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
pSub = pSub->GetNext();
}
pTab = pTab->GetFollow();
- ASSERT( pTab, "Table follow without master" );
+ OSL_ENSURE( pTab, "Table follow without master" );
}
}
do
@@ -289,7 +290,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
SwPageFrm *pTabPage = pTab->FindPageFrm();
if( pTabPage != pPage )
{
- ASSERT( pPage->GetPhyPageNum() <
+ OSL_ENSURE( pPage->GetPhyPageNum() <
pTabPage->GetPhyPageNum(),
"Looping Tableframes" );
pPage = pTabPage;
@@ -344,7 +345,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
{
sal_Bool bRet = sal_True;
@@ -471,7 +472,7 @@ void SwLayoutCache::ClearImpl()
SwLayoutCache::~SwLayoutCache()
{
- ASSERT( !nLockCount, "Deleting a locked SwLayoutCache!?" );
+ OSL_ENSURE( !nLockCount, "Deleting a locked SwLayoutCache!?" );
delete pImpl;
}
@@ -539,7 +540,7 @@ SwLayHelper::~SwLayHelper()
{
if( pImpl )
{
- ASSERT( pDoc && pDoc->GetLayoutCache(), "Missing layoutcache" );
+ OSL_ENSURE( pDoc && pDoc->GetLayoutCache(), "Missing layoutcache" );
pDoc->GetLayoutCache()->UnlockImpl();
}
}
@@ -657,18 +658,18 @@ sal_Bool SwLayHelper::CheckInsertPage()
bNextPageOdd, bInsertEmpty, sal_False, rpPage->GetNext() );
if ( bEnd )
{
- ASSERT( rpPage->GetNext(), "Keine neue Seite?" );
+ OSL_ENSURE( rpPage->GetNext(), "Keine neue Seite?" );
do
{ rpPage = (SwPageFrm*)rpPage->GetNext();
} while ( rpPage->GetNext() );
}
else
{
- ASSERT( rpPage->GetNext(), "Keine neue Seite?" );
+ OSL_ENSURE( rpPage->GetNext(), "Keine neue Seite?" );
rpPage = (SwPageFrm*)rpPage->GetNext();
if ( rpPage->IsEmptyPage() )
{
- ASSERT( rpPage->GetNext(), "Keine neue Seite?" );
+ OSL_ENSURE( rpPage->GetNext(), "Keine neue Seite?" );
rpPage = (SwPageFrm*)rpPage->GetNext();
}
}
@@ -734,7 +735,7 @@ void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
uno::UNO_QUERY );
try
{
- xDocInfo->setPropertyValue( rtl::OUString::createFromAscii("WorkaroundForB6375613Applied"), uno::makeAny( true ) );
+ xDocInfo->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkaroundForB6375613Applied")), uno::makeAny( true ) );
}
catch( uno::Exception& )
{
@@ -890,7 +891,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
SwRowFrm* pHeadline = 0;
while( nRowIdx < nRepeat )
{
- ASSERT( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" );
+ OSL_ENSURE( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" );
pHeadline =
new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ] );
pHeadline->SetRepeatedHeadline( true );
@@ -1023,59 +1024,6 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
sal_uInt16 nPgNum = pPage->GetPhyPageNum();
-/*
-
- //
- // NOTE: This code assumes that all objects have already been
- // inserted into the drawing layout, so that the cached objects
- // can be identified by their ordnum. Unfortunately this function
- // is called with page n if page n+1 has been inserted. Thus
- // not all the objects have been inserted and the ordnums cannot
- // be used to identify the objects.
- //
-
- for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i ) // check objects
- {
- SdrObject *pO = rObjs[i];
- if ( pO->ISA(SwVirtFlyDrawObj) ) // a text frame?
- {
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
- if( pFly->Frm().Left() == WEIT_WECH && pFly->GetAnchor() &&
- !pFly->GetAnchor()->FindFooterOrHeader() )
- { // Only frame with default position and not in header/footer
- const SwContact *pC = (SwContact*)GetUserCall(pO);
- if( pC )
- {
- sal_uLong nOrdNum = pO->GetOrdNum(); // the Id
- SwFlyCache* pFlyC;
- while( nFlyIdx < nFlyCount && ( pFlyC = pImpl->
- GetFlyCache(nFlyIdx) )->nPageNum < nPgNum)
- ++nFlyIdx;
- if( nFlyIdx < nFlyCount &&
- pFlyC->nPageNum == nPgNum )
- {
- sal_uInt16 nIdx = nFlyIdx;
- while( nIdx < nFlyCount && ( pFlyC = pImpl->
- GetFlyCache( nIdx ) )->nPageNum == nPgNum &&
- pFlyC->nOrdNum != nOrdNum )
- ++nIdx;
- if( nIdx < nFlyCount && pFlyC->nPageNum == nPgNum &&
- pFlyC->nOrdNum == nOrdNum )
- { // we get the stored information
- pFly->Frm().Pos().X() = pFlyC->Left() +
- pPage->Frm().Left();
- pFly->Frm().Pos().Y() = pFlyC->Top() +
- pPage->Frm().Top();
- pFly->Frm().Width( pFlyC->Width() );
- pFly->Frm().Height( pFlyC->Height() );
- }
- }
- }
- }
- }
- }
- */
-
//
// NOTE: Here we do not use the absolute ordnums but
// relative ordnums for the objects on this page.
@@ -1237,13 +1185,10 @@ SwLayCacheIoImpl::SwLayCacheIoImpl( SvStream& rStrm, sal_Bool bWrtMd ) :
sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
{
sal_Bool bRes = sal_True;
- size_t nLvl = aRecTypes.size();
- ASSERT( nLvl == aRecSizes.Count(), "OpenRec: Level" );
sal_uInt32 nPos = pStream->Tell();
if( bWriteMode )
{
- aRecTypes.push_back( cType );
- aRecSizes.Insert( nPos, nLvl );
+ aRecords.push_back( RecTypeSize(cType, nPos) );
*pStream << (sal_uInt32) 0;
}
else
@@ -1251,20 +1196,20 @@ sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
sal_uInt32 nVal;
*pStream >> nVal;
sal_uInt8 cRecTyp = (sal_uInt8)nVal;
- aRecTypes.push_back( cRecTyp );
- sal_uInt32 nSize = nVal >> 8;
- aRecSizes.Insert( nPos + nSize, nLvl );
if( !nVal || cRecTyp != cType ||
pStream->GetErrorCode() != SVSTREAM_OK || pStream->IsEof() )
{
- ASSERT( nVal, "OpenRec: Record-Header is 0" );
- ASSERT( cRecTyp == cType,
- "OpenRec: Wrong Record Type" );
- aRecTypes.back() = 0;
- aRecSizes[nLvl] = pStream->Tell();
+ OSL_ENSURE( nVal, "OpenRec: Record-Header is 0" );
+ OSL_ENSURE( cRecTyp == cType, "OpenRec: Wrong Record Type" );
+ aRecords.push_back( RecTypeSize(0, pStream->Tell()) );
bRes = sal_False;
bError = sal_True;
}
+ else
+ {
+ sal_uInt32 nSize = nVal >> 8;
+ aRecords.push_back( RecTypeSize(cRecTyp, nPos+nSize) );
+ }
}
return bRes;
}
@@ -1274,19 +1219,16 @@ sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
sal_Bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
{
sal_Bool bRes = sal_True;
- size_t nLvl = aRecTypes.size();
- ASSERT( nLvl == aRecSizes.Count(), "CloseRec: wrong Level" );
- ASSERT( nLvl, "CloseRec: no levels" );
- if( nLvl )
+ OSL_ENSURE( !aRecords.empty(), "CloseRec: no levels" );
+ if( !aRecords.empty() )
{
- nLvl--;
sal_uInt32 nPos = pStream->Tell();
if( bWriteMode )
{
- sal_uInt32 nBgn = aRecSizes[nLvl];
+ sal_uInt32 nBgn = aRecords.back().size;
pStream->Seek( nBgn );
sal_uInt32 nSize = nPos - nBgn;
- sal_uInt32 nVal = ( nSize << 8 ) | aRecTypes.back();
+ sal_uInt32 nVal = ( nSize << 8 ) | aRecords.back().type;
*pStream << nVal;
pStream->Seek( nPos );
if( pStream->GetError() != SVSTREAM_OK )
@@ -1294,8 +1236,8 @@ sal_Bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
}
else
{
- sal_uInt32 n = aRecSizes[nLvl];
- ASSERT( n >= nPos, "CloseRec: to much data read" );
+ sal_uInt32 n = aRecords.back().size;
+ OSL_ENSURE( n >= nPos, "CloseRec: to much data read" );
if( n != nPos )
{
pStream->Seek( n );
@@ -1305,9 +1247,7 @@ sal_Bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
if( pStream->GetErrorCode() != SVSTREAM_OK )
bRes = sal_False;
}
-
- aRecTypes.pop_back();
- aRecSizes.Remove( nLvl, 1 );
+ aRecords.pop_back();
}
if( !bRes )
@@ -1318,16 +1258,14 @@ sal_Bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
sal_uInt32 SwLayCacheIoImpl::BytesLeft()
{
- sal_uInt16 nLvl = aRecSizes.Count();
sal_uInt32 n = 0;
- if( !bError && nLvl )
+ if( !bError && !aRecords.empty() )
{
- sal_uInt32 nEndPos = aRecSizes[ nLvl-1 ];
+ sal_uInt32 nEndPos = aRecords.back().size;
sal_uInt32 nPos = pStream->Tell();
if( nEndPos > nPos )
n = nEndPos - nPos;
}
-
return n;
}
@@ -1352,13 +1290,13 @@ void SwLayCacheIoImpl::SkipRec()
{
sal_uInt8 c = Peek();
OpenRec( c );
- pStream->Seek( aRecSizes[aRecSizes.Count()-1] );
+ pStream->Seek( aRecords.back().size );
CloseRec( c );
}
sal_uInt8 SwLayCacheIoImpl::OpenFlagRec()
{
- ASSERT( !bWriteMode, "OpenFlagRec illegal in write mode" );
+ OSL_ENSURE( !bWriteMode, "OpenFlagRec illegal in write mode" );
sal_uInt8 cFlags;
*pStream >> cFlags;
nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F );
@@ -1367,9 +1305,9 @@ sal_uInt8 SwLayCacheIoImpl::OpenFlagRec()
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" );
+ OSL_ENSURE( bWriteMode, "OpenFlagRec illegal in read mode" );
+ OSL_ENSURE( (nFlags & 0xF0) == 0, "illegal flags set" );
+ OSL_ENSURE( nLen < 16, "wrong flag record length" );
sal_uInt8 cFlags = (nFlags << 4) + nLen;
*pStream << cFlags;
nFlagRecEnd = pStream->Tell() + nLen;
@@ -1379,12 +1317,14 @@ void SwLayCacheIoImpl::CloseFlagRec()
{
if( bWriteMode )
{
- ASSERT( pStream->Tell() == nFlagRecEnd, "Wrong amount of data written" );
+ OSL_ENSURE( pStream->Tell() == nFlagRecEnd, "Wrong amount of data written" );
}
else
{
- ASSERT( pStream->Tell() <= nFlagRecEnd, "To many data read" );
+ OSL_ENSURE( pStream->Tell() <= nFlagRecEnd, "To many data read" );
if( pStream->Tell() != nFlagRecEnd )
pStream->Seek( nFlagRecEnd );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 48aeefa68e1f..d690940320d7 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,11 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
-#define _SVSTDARR_BYTES
#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
#endif
#include <swrect.hxx>
+#include <vector>
class SwDoc;
class SwFrm;
@@ -166,8 +167,13 @@ public:
class SwLayCacheIoImpl
{
- SvBytes aRecTypes;
- SvULongs aRecSizes;
+private:
+ struct RecTypeSize {
+ sal_uInt8 type;
+ sal_uLong size;
+ RecTypeSize(sal_uInt8 typ, sal_uLong siz) : type(typ), size(siz) {}
+ };
+ std::vector<RecTypeSize> aRecords;
SvStream *pStream;
@@ -230,3 +236,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 17d0dd4356bc..891b048958fe 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "layouter.hxx"
#include "doc.hxx"
#include "sectfrm.hxx"
@@ -72,14 +71,14 @@ public:
~SwEndnoter() { delete pEndArr; }
void CollectEndnotes( SwSectionFrm* pSct );
void CollectEndnote( SwFtnFrm* pFtn );
- const SwSectionFrm* GetSect() { return pSect; }
+ const SwSectionFrm* GetSect() const { return pSect; }
void InsertEndnotes();
sal_Bool HasEndnotes() const { return pEndArr && pEndArr->Count(); }
};
void SwEndnoter::CollectEndnotes( SwSectionFrm* pSct )
{
- ASSERT( pSct, "CollectEndnotes: Which section?" );
+ OSL_ENSURE( pSct, "CollectEndnotes: Which section?" );
if( !pSect )
pSect = pSct;
else if( pSct != pSect )
@@ -109,7 +108,7 @@ void SwEndnoter::CollectEndnote( SwFtnFrm* pFtn )
} while ( pCnt );
}
else
- { ASSERT( pNxt->Lower() && pNxt->Lower()->IsSctFrm(),
+ { OSL_ENSURE( pNxt->Lower() && pNxt->Lower()->IsSctFrm(),
"Endnote without content?" );
pNxt->Cut();
delete pNxt;
@@ -146,7 +145,7 @@ void SwEndnoter::InsertEndnotes()
pSect = NULL;
return;
}
- ASSERT( pSect->Lower() && pSect->Lower()->IsFtnBossFrm(),
+ OSL_ENSURE( pSect->Lower() && pSect->Lower()->IsFtnBossFrm(),
"InsertEndnotes: Where's my column?" );
SwFrm* pRef = pSect->FindLastCntnt( FINDMODE_MYLAST );
SwFtnBossFrm *pBoss = pRef ? pRef->FindFtnBossFrm()
@@ -159,7 +158,7 @@ void SwEndnoter::InsertEndnotes()
SwLooping::SwLooping( SwPageFrm* pPage )
{
- ASSERT( pPage, "Where's my page?" );
+ OSL_ENSURE( pPage, "Where's my page?" );
nMinPage = pPage->GetPhyPageNum();
nMaxPage = nMinPage;
nCount = 0;
@@ -198,19 +197,15 @@ void SwLooping::Control( SwPageFrm* pPage )
}
else if( ++nCount > LOOP_DETECT )
{
-#ifdef DBG_UTIL
#if OSL_DEBUG_LEVEL > 1
static sal_Bool bNoLouie = sal_False;
if( bNoLouie )
return;
-#endif
-#endif
// FME 2007-08-30 #i81146# new loop control
-#if OSL_DEBUG_LEVEL > 1
- ASSERT( 0 != mnLoopControlStage, "Looping Louie: Stage 1!" );
- ASSERT( 1 != mnLoopControlStage, "Looping Louie: Stage 2!!" );
- ASSERT( 2 > mnLoopControlStage, "Looping Louie: Stage 3!!!" );
+ OSL_ENSURE( 0 != mnLoopControlStage, "Looping Louie: Stage 1!" );
+ OSL_ENSURE( 1 != mnLoopControlStage, "Looping Louie: Stage 2!!" );
+ OSL_ENSURE( 2 > mnLoopControlStage, "Looping Louie: Stage 3!!!" );
#endif
Drastic( pPage->Lower() );
@@ -228,9 +223,6 @@ void SwLooping::Control( SwPageFrm* pPage )
|*
|* SwLayouter::SwLayouter()
|*
-|* Ersterstellung AMA 02. Nov. 99
-|* Letzte Aenderung AMA 02. Nov. 99
-|*
|*************************************************************************/
SwLayouter::SwLayouter()
@@ -285,7 +277,7 @@ void SwLayouter::InsertEndnotes( SwSectionFrm* pSect )
void SwLayouter::LoopControl( SwPageFrm* pPage, sal_uInt8 )
{
- ASSERT( pLooping, "Looping: Lost control" );
+ OSL_ENSURE( pLooping, "Looping: Lost control" );
pLooping->Control( pPage );
}
@@ -294,7 +286,7 @@ void SwLayouter::LoopingLouieLight( const SwDoc& rDoc, const SwTxtFrm& rFrm )
if ( pLooping && pLooping->IsLoopingLouieLight() )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "Looping Louie (Light): Fixating fractious frame" )
+ OSL_ENSURE( false, "Looping Louie (Light): Fixating fractious frame" );
#endif
SwLayouter::InsertMovedFwdFrm( rDoc, rFrm, rFrm.FindPageFrm()->GetPhyPageNum() );
}
@@ -316,7 +308,7 @@ void SwLayouter::EndLoopControl()
void SwLayouter::CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect )
{
- ASSERT( pDoc, "No doc, no fun" );
+ OSL_ENSURE( pDoc, "No doc, no fun" );
if( !pDoc->GetLayouter() )
pDoc->SetLayouter( new SwLayouter() );
pDoc->GetLayouter()->_CollectEndnotes( pSect );
@@ -340,7 +332,7 @@ sal_Bool SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFt
sal_Bool SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage )
{
- ASSERT( pDoc, "No doc, no fun" );
+ OSL_ENSURE( pDoc, "No doc, no fun" );
if( !pDoc->GetLayouter() )
pDoc->SetLayouter( new SwLayouter() );
return !pDoc->GetLayouter()->pLooping &&
@@ -569,3 +561,5 @@ void SwLayouter::ClearMoveBwdLayoutInfo( const SwDoc& _rDoc )
const_cast<SwDoc&>(_rDoc).GetLayouter()->maMoveBwdLayoutInfo.clear();
}
// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
index 2b980612a98c..04802ae8710e 100644
--- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
+++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,3 +108,4 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm
}
// <--
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 9da088849559..0c6001c4f94a 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -366,7 +367,7 @@ void _FrmInit()
{
SwRootFrm::pVout = new SwLayVout();
SwCache *pNew = new SwCache( 100, 100
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, "static SwBorderAttrs::pCache"
#endif
);
@@ -377,13 +378,13 @@ void _FrmInit()
void _FrmFinit()
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// im Chache duerfen nur noch 0-Pointer stehen
for( sal_uInt16 n = SwFrm::GetCachePtr()->Count(); n; )
if( (*SwFrm::GetCachePtr())[ --n ] )
{
SwCacheObj* pObj = (*SwFrm::GetCachePtr())[ n ];
- ASSERT( !pObj, "Wer hat sich nicht ausgetragen?")
+ OSL_ENSURE( !pObj, "Wer hat sich nicht ausgetragen?");
}
#endif
delete SwRootFrm::pVout;
@@ -394,9 +395,6 @@ void _FrmFinit()
|*
|* RootFrm::Alles was so zur CurrShell gehoert
|*
-|* Ersterstellung MA 09. Sep. 98
-|* Letzte Aenderung MA 18. Feb. 99
-|*
|*************************************************************************/
typedef CurrShell* CurrShellPtr;
@@ -405,7 +403,7 @@ SV_IMPL_PTRARR_SORT(SwCurrShells,CurrShellPtr)
CurrShell::CurrShell( ViewShell *pNew )
{
- ASSERT( pNew, "0-Shell einsetzen?" );
+ OSL_ENSURE( pNew, "0-Shell einsetzen?" );
pRoot = pNew->GetLayout();
if ( pRoot )
{
@@ -474,8 +472,6 @@ void InitCurrShells( SwRootFrm *pRoot )
|* Der RootFrm laesst sich grundsaetzlich vom Dokument ein eigenes
|* FrmFmt geben. Dieses loescht er dann selbst im DTor.
|* Das eigene FrmFmt wird vom uebergebenen Format abgeleitet.
-|* Ersterstellung SS 05-Apr-1991
-|* Letzte Aenderung MA 12. Dec. 94
|*
|*************************************************************************/
@@ -596,9 +592,6 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
|*
|* SwRootFrm::~SwRootFrm()
|*
-|* Ersterstellung SS 05-Apr-1991
-|* Letzte Aenderung MA 12. Dec. 94
-|*
|*************************************************************************/
@@ -618,16 +611,13 @@ SwRootFrm::~SwRootFrm()
delete pCurrShells;
- ASSERT( 0==nAccessibleShells, "Some accessible shells are left" );
+ OSL_ENSURE( 0==nAccessibleShells, "Some accessible shells are left" );
}
/*************************************************************************
|*
|* SwRootFrm::RemoveMasterObjs()
|*
-|* Ersterstellung MA 19.10.95
-|* Letzte Aenderung MA 19.10.95
-|*
|*************************************************************************/
@@ -645,3 +635,4 @@ void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index 36b3c186d68a..3f4c2876dd44 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,7 @@
// =============================================================================
// helper class <SwPageNumAndTypeOfAnchors>
-// --> OD 2004-10-04 #i26945# - Additionally the type of the anchor text frame
+// --> #i26945# - Additionally the type of the anchor text frame
// is collected - by type is meant 'master' or 'follow'.
// =============================================================================
class SwPageNumAndTypeOfAnchors
@@ -78,7 +79,7 @@ class SwPageNumAndTypeOfAnchors
{
tEntry* pNewEntry = new tEntry();
pNewEntry->mpAnchoredObj = &_rAnchoredObj;
- // --> OD 2004-09-23 #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = _rAnchoredObj.FindPageFrmOfAnchor();
@@ -91,7 +92,7 @@ class SwPageNumAndTypeOfAnchors
pNewEntry->mnPageNumOfAnchor = 0;
}
// <--
- // --> OD 2004-10-04 #i26945# - collect type of anchor
+ // --> #i26945# - collect type of anchor
SwTxtFrm* pAnchorCharFrm = _rAnchoredObj.FindAnchorCharFrm();
if ( pAnchorCharFrm )
{
@@ -117,7 +118,7 @@ class SwPageNumAndTypeOfAnchors
return bRetObj;
}
- inline sal_uInt32 GetPageNum( sal_uInt32 _nIndex )
+ inline sal_uInt32 GetPageNum( sal_uInt32 _nIndex ) const
{
sal_uInt32 nRetPgNum = 0L;
@@ -129,7 +130,7 @@ class SwPageNumAndTypeOfAnchors
return nRetPgNum;
}
- // --> OD 2004-10-04 #i26945#
+ // --> #i26945#
inline bool AnchoredAtMaster( sal_uInt32 _nIndex )
{
bool bAnchoredAtMaster( true );
@@ -159,7 +160,7 @@ SwObjectFormatter::SwObjectFormatter( const SwPageFrm& _rPageFrm,
mbFormatOnlyAsCharAnchored( false ),
mbConsiderWrapOnObjPos( _rPageFrm.GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) ),
mpLayAction( _pLayAction ),
- // --> OD 2004-10-04 #i26945#
+ // --> #i26945#
mpPgNumAndTypeOfAnchors( _bCollectPgNumOfAnchors ? new SwPageNumAndTypeOfAnchors() : 0L )
// <--
{
@@ -190,7 +191,7 @@ SwObjectFormatter* SwObjectFormatter::CreateObjFormatter(
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatter::CreateObjFormatter(..)> - unexcepted type of anchor frame" );
}
@@ -232,11 +233,11 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj,
{
bool bSuccess( true );
- ASSERT( _pAnchorFrm || _rAnchoredObj.GetAnchorFrm(),
+ OSL_ENSURE( _pAnchorFrm || _rAnchoredObj.GetAnchorFrm(),
"<SwObjectFormatter::FormatObj(..)> - missing anchor frame" );
SwFrm& rAnchorFrm = _pAnchorFrm ? *(_pAnchorFrm) : *(_rAnchoredObj.AnchorFrm());
- ASSERT( _pPageFrm || rAnchorFrm.FindPageFrm(),
+ OSL_ENSURE( _pPageFrm || rAnchorFrm.FindPageFrm(),
"<SwObjectFormatter::FormatObj(..)> - missing page frame" );
const SwPageFrm& rPageFrm = _pPageFrm ? *(_pPageFrm) : *(rAnchorFrm.FindPageFrm());
@@ -247,7 +248,7 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj,
if ( pObjFormatter )
{
// format given floating screen object
- // --> OD 2005-01-10 #i40147# - check for moved forward anchor frame
+ // --> #i40147# - check for moved forward anchor frame
bSuccess = pObjFormatter->DoFormatObj( _rAnchoredObj, true );
// <--
}
@@ -259,7 +260,7 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj,
/** helper method for method <_FormatObj(..)> - performs the intrinsic format
of the layout of the given layout frame and all its lower layout frames.
- OD 2004-06-28 #i28701#
+ #i28701#
IMPORTANT NOTE:
Method corresponds to methods <SwLayAction::FormatLayoutFly(..)> and
<SwLayAction::FormatLayout(..)>. Thus, its code for the formatting have
@@ -285,7 +286,7 @@ void SwObjectFormatter::_FormatLayout( SwLayoutFrm& _rLayoutFrm )
/** helper method for method <_FormatObj(..)> - performs the intrinsic
format of the content of the given floating screen object.
- OD 2004-06-28 #i28701#
+ #i28701#
@author OD
*/
@@ -306,7 +307,7 @@ void SwObjectFormatter::_FormatObjCntnt( SwAnchoredObject& _rAnchoredObj )
pCntnt->OptCalc();
// format floating screen objects at content text frame
- // --> OD 2004-11-01 #i23129#, #i36347# - pass correct page frame to
+ // --> #i23129#, #i36347# - pass correct page frame to
// the object formatter
if ( pCntnt->IsTxtFrm() &&
!SwObjectFormatter::FormatObjsAtFrm( *pCntnt,
@@ -326,7 +327,7 @@ void SwObjectFormatter::_FormatObjCntnt( SwAnchoredObject& _rAnchoredObj )
/** performs the intrinsic format of a given floating screen object and its content.
- OD 2004-06-28 #i28701#
+ #i28701#
@author OD
*/
@@ -349,14 +350,14 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
if ( _rAnchoredObj.ISA(SwFlyFrm) )
{
SwFlyFrm& rFlyFrm = static_cast<SwFlyFrm&>(_rAnchoredObj);
- // --> OD 2004-11-15 #i34753# - reset flag, which prevents a positioning
+ // --> #i34753# - reset flag, which prevents a positioning
if ( rFlyFrm.IsFlyLayFrm() )
{
static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( false );
}
// <--
- // FME 2007-08-30 #i81146# new loop control
+ // #i81146# new loop control
sal_uInt16 nLoopControlRuns = 0;
const sal_uInt16 nLoopControlMax = 15;
@@ -364,7 +365,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
if ( mpLayAction )
{
mpLayAction->FormatLayoutFly( &rFlyFrm );
- // --> OD 2005-07-13 #124218# - consider, if the layout action
+ // --> consider, if the layout action
// has to be restarted due to a delete of a page frame.
if ( mpLayAction->IsAgain() )
{
@@ -376,14 +377,14 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
{
_FormatLayout( rFlyFrm );
}
- // --> OD 2004-11-15 #i34753# - prevent further positioning, if
+ // --> #i34753# - prevent further positioning, if
// to-page|to-fly anchored Writer fly frame is already clipped.
if ( rFlyFrm.IsFlyLayFrm() && rFlyFrm.IsClipped() )
{
static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( true );
}
// <--
- // --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame
+ // --> #i23129#, #i36347# - pass correct page frame
// to the object formatter
SwObjectFormatter::FormatObjsAtFrm( rFlyFrm,
*(rFlyFrm.FindPageFrm()),
@@ -392,7 +393,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
if ( mpLayAction )
{
mpLayAction->_FormatFlyCntnt( &rFlyFrm );
- // --> OD 2005-07-13 #124218# - consider, if the layout action
+ // --> consider, if the layout action
// has to be restarted due to a delete of a page frame.
if ( mpLayAction->IsAgain() )
{
@@ -408,13 +409,13 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
if ( ++nLoopControlRuns >= nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in SwObjectFormatter::_FormatObj: Stage 3!!!" );
+ OSL_ENSURE( false, "LoopControl in SwObjectFormatter::_FormatObj: Stage 3!!!" );
#endif
rFlyFrm.ValidateThisAndAllLowers( 2 );
nLoopControlRuns = 0;
}
- // --> OD 2006-02-02 #i57917#
+ // --> #i57917#
// stop formatting of anchored object, if restart of layout process is requested.
} while ( !rFlyFrm.IsValid() &&
!_rAnchoredObj.RestartLayoutProcess() &&
@@ -430,8 +431,8 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
/** invokes the intrinsic format method for all floating screen objects,
anchored at anchor frame on the given page frame
- OD 2004-06-28 #i28701#
- OD 2004-10-08 #i26945# - for format of floating screen objects for
+ #i28701#
+ #i26945# - for format of floating screen objects for
follow text frames, the 'master' text frame is passed to the method.
Thus, the objects, whose anchor character is inside the follow text
frame can be formatted.
@@ -440,7 +441,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
*/
bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
{
- // --> OD 2004-10-08 #i26945#
+ // --> #i26945#
SwFrm* pAnchorFrm( 0L );
if ( GetAnchorFrm().IsTxtFrm() &&
static_cast<SwTxtFrm&>(GetAnchorFrm()).IsFollow() &&
@@ -468,7 +469,7 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
// check, if object's anchor is on the given page frame or
// object is registered at the given page frame.
- // --> OD 2004-10-05 #i26945# - check, if the anchor character of the
+ // --> #i26945# - check, if the anchor character of the
// anchored object is located in a follow text frame. If this anchor
// follow text frame differs from the given anchor frame, the given
// anchor frame is a 'master' text frame of the anchor follow text frame.
@@ -486,13 +487,13 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
continue;
}
// <--
- // --> OD 2004-09-23 #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = pAnchoredObj->FindPageFrmOfAnchor();
- ASSERT( pPageFrmOfAnchor,
+ OSL_ENSURE( pPageFrmOfAnchor,
"<SwObjectFormatter::_FormatObjsAtFrm()> - missing page frame." );
- // --> OD 2004-10-08 #i26945#
+ // --> #i26945#
if ( pPageFrmOfAnchor && pPageFrmOfAnchor == &mrPageFrm )
// <--
{
@@ -533,7 +534,7 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
/** accessor to collected anchored object
- OD 2004-07-05 #i28701#
+ #i28701#
@author OD
*/
@@ -544,7 +545,7 @@ SwAnchoredObject* SwObjectFormatter::GetCollectedObj( const sal_uInt32 _nIndex )
/** accessor to 'anchor' page number of collected anchored object
- OD 2004-07-05 #i28701#
+ #i28701#
@author OD
*/
@@ -555,7 +556,7 @@ sal_uInt32 SwObjectFormatter::GetPgNumOfCollected( const sal_uInt32 _nIndex )
/** accessor to 'anchor' type of collected anchored object
- OD 2004-10-04 #i26945#
+ #i26945#
@author OD
*/
@@ -568,7 +569,7 @@ bool SwObjectFormatter::IsCollectedAnchoredAtMaster( const sal_uInt32 _nIndex )
/** accessor to total number of collected anchored objects
- OD 2004-07-05 #i28701#
+ #i28701#
@author OD
*/
@@ -576,3 +577,5 @@ sal_uInt32 SwObjectFormatter::CountOfCollected()
{
return mpPgNumAndTypeOfAnchors ? mpPgNumAndTypeOfAnchors->Count() : 0L;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx
index a0542793912c..b8c0086fb542 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@ SwObjectFormatterLayFrm* SwObjectFormatterLayFrm::CreateObjFormatter(
if ( !_rAnchorLayFrm.IsPageFrm() &&
!_rAnchorLayFrm.IsFlyFrm() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterLayFrm::CreateObjFormatter(..)> - unexcepted type of anchor frame " );
return 0L;
}
@@ -129,7 +130,7 @@ bool SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()
{
if ( !GetAnchorFrm().IsPageFrm() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()> - mis-usage of method, call only for anchor frames of type page frame" );
return true;
}
@@ -171,8 +172,8 @@ bool SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()
SwPageFrm* pPageFrmOfAnchor = pAnchoredObj->FindPageFrmOfAnchor();
// --> OD 2004-10-08 #i26945# - check, if the page frame of the
// object's anchor frame isn't the given page frame
- ASSERT( pPageFrmOfAnchor,
- "<SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()> - missing page frame" )
+ OSL_ENSURE( pPageFrmOfAnchor,
+ "<SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()> - missing page frame" );
if ( pPageFrmOfAnchor &&
// --> OD 2004-10-22 #i35911#
pPageFrmOfAnchor->GetPhyPageNum() < rPageFrm.GetPhyPageNum() )
@@ -213,3 +214,5 @@ bool SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()
return bSuccess;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformatterlayfrm.hxx b/sw/source/core/layout/objectformatterlayfrm.hxx
index f33cb9b4cd74..a2199030a61c 100644
--- a/sw/source/core/layout/objectformatterlayfrm.hxx
+++ b/sw/source/core/layout/objectformatterlayfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,5 @@ class SwObjectFormatterLayFrm : public SwObjectFormatter
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index dc23771c54ad..fee9741455c8 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,17 +39,14 @@
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <fmtwrapinfluenceonobjpos.hxx>
-// --> OD 2004-11-03 #114798#
#include <fmtfollowtextflow.hxx>
-// <--
#include <layact.hxx>
using namespace ::com::sun::star;
// =============================================================================
-// --> OD 2004-12-03 #115759# - little helper class to forbid follow formatting
-// for the given text frame
+// little helper class to forbid follow formatting for the given text frame
class SwForbidFollowFormat
{
private:
@@ -71,7 +69,6 @@ public:
}
}
};
-// <--
// =============================================================================
// implementation of class <SwObjectFormatterTxtFrm>
@@ -102,7 +99,7 @@ SwObjectFormatterTxtFrm* SwObjectFormatterTxtFrm::CreateObjFormatter(
if ( _rAnchorTxtFrm.IsFollow() )
{
pMasterOfAnchorFrm = _rAnchorTxtFrm.FindMaster();
- while ( pMasterOfAnchorFrm->IsFollow() )
+ while ( pMasterOfAnchorFrm && pMasterOfAnchorFrm->IsFollow() )
{
pMasterOfAnchorFrm = pMasterOfAnchorFrm->FindMaster();
}
@@ -126,7 +123,7 @@ SwFrm& SwObjectFormatterTxtFrm::GetAnchorFrm()
return mrAnchorTxtFrm;
}
-// --> OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>.
+// #i40147# - add parameter <_bCheckForMovedFwd>.
bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
const bool _bCheckForMovedFwd )
{
@@ -138,13 +135,12 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
return true;
}
- // --> OD 2005-07-13 #124218# - consider, if the layout action has to be
+ // consider, if the layout action has to be
// restarted due to a delete of a page frame.
if ( GetLayAction() && GetLayAction()->IsAgain() )
{
return false;
}
- // <--
bool bSuccess( true );
@@ -153,17 +149,17 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
_rAnchoredObj.SetRestartLayoutProcess( false );
_FormatObj( _rAnchoredObj );
- // --> OD 2005-07-13 #124218# - consider, if the layout action has to be
+ // consider, if the layout action has to be
// restarted due to a delete of a page frame.
if ( GetLayAction() && GetLayAction()->IsAgain() )
{
return false;
}
- // <--
// check, if layout process has to be restarted.
// if yes, perform needed invalidations.
- // --> OD 2004-11-03 #114798# - no restart of layout process,
+
+ // no restart of layout process,
// if anchored object is anchored inside a Writer fly frame,
// its position is already locked, and it follows the text flow.
const bool bRestart =
@@ -172,7 +168,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
_rAnchoredObj.GetAnchorFrm()->IsInFly() &&
_rAnchoredObj.GetFrmFmt().GetFollowTextFlow().GetValue() );
if ( bRestart )
- // <--
{
bSuccess = false;
_InvalidatePrevObjs( _rAnchoredObj );
@@ -181,38 +176,36 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
// format anchor text frame, if wrapping style influence of the object
// has to be considered and it's <NONE_SUCCESSIVE_POSITIONED>
- // --> OD 2004-08-25 #i3317# - consider also anchored objects, whose
+ // #i3317# - consider also anchored objects, whose
// wrapping style influence is temporarly considered.
- // --> OD 2005-01-10 #i40147# - consider also anchored objects, for
+ // #i40147# - consider also anchored objects, for
// whose the check of a moved forward anchor frame is requested.
- // --> OD 2006-07-24 #b6449874# - revise decision made for i3317:
+ // revise decision made for i3317:
// anchored objects, whose wrapping style influence is temporarly considered,
// have to be considered in method <SwObjectFormatterTxtFrm::DoFormatObjs()>
if ( bSuccess &&
_rAnchoredObj.ConsiderObjWrapInfluenceOnObjPos() &&
( _bCheckForMovedFwd ||
_rAnchoredObj.GetFrmFmt().GetWrapInfluenceOnObjPos().
- // --> OD 2004-10-18 #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
+ // #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
GetWrapInfluenceOnObjPos( true ) ==
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017# - constant name has changed
text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ) )
- // <--
{
- // --> OD 2004-10-11 #i26945# - check conditions for move forward of
+ // #i26945# - check conditions for move forward of
// anchor text frame
// determine, if anchor text frame has previous frame
const bool bDoesAnchorHadPrev = ( mrAnchorTxtFrm.GetIndPrev() != 0 );
- // --> OD 2005-01-11 #i40141# - use new method - it also formats the
+ // #i40141# - use new method - it also formats the
// section the anchor frame is in.
_FormatAnchorFrmForCheckMoveFwd();
- // <--
- // --> OD 2004-10-22 #i35911#
+ // #i35911#
if ( _rAnchoredObj.HasClearedEnvironment() )
{
_rAnchoredObj.SetClearedEnvironment( true );
- // --> OD 2005-03-08 #i44049# - consider, that anchor frame
+ // #i44049# - consider, that anchor frame
// could already been marked to move forward.
SwPageFrm* pAnchorPageFrm( mrAnchorTxtFrm.FindPageFrm() );
if ( pAnchorPageFrm != _rAnchoredObj.GetPageFrm() )
@@ -239,33 +232,30 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterTxtFrm::DoFormatObj(..)> - anchor frame not marked to move forward" );
}
}
- // <--
}
else if ( !mrAnchorTxtFrm.IsFollow() && bDoesAnchorHadPrev )
- // <--
{
// index of anchored object in collection of page numbers and
// anchor types
sal_uInt32 nIdx( CountOfCollected() );
- ASSERT( nIdx > 0,
+ OSL_ENSURE( nIdx > 0,
"<SwObjectFormatterTxtFrm::DoFormatObj(..)> - anchored object not collected!?" );
--nIdx;
sal_uInt32 nToPageNum( 0L );
- // --> OD 2005-03-30 #i43913#
+ // #i43913#
bool bDummy( false );
- // --> OD 2006-01-27 #i58182# - consider new method signature
+ // #i58182# - consider new method signature
if ( SwObjectFormatterTxtFrm::CheckMovedFwdCondition( *GetCollectedObj( nIdx ),
GetPgNumOfCollected( nIdx ),
IsCollectedAnchoredAtMaster( nIdx ),
nToPageNum, bDummy ) )
- // <--
{
- // --> OD 2005-06-01 #i49987# - consider, that anchor frame
+ // #i49987# - consider, that anchor frame
// could already been marked to move forward.
bool bInsert( true );
sal_uInt32 nMovedFwdToPageNum( 0L );
@@ -299,14 +289,12 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterTxtFrm::DoFormatObj(..)> - anchor frame not marked to move forward" );
}
- // <--
}
}
- // <--
- // --> OD 2005-01-12 #i40155# - mark anchor frame not to wrap around
+ // i40155# - mark anchor frame not to wrap around
// objects under the condition, that its follow contains all its text.
else if ( !mrAnchorTxtFrm.IsFollow() &&
mrAnchorTxtFrm.GetFollow() &&
@@ -319,7 +307,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
*(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
mrAnchorTxtFrm );
}
- // <--
}
}
@@ -340,7 +327,7 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
else
{
// the anchor text frame has to be valid, thus assert.
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterTxtFrm::DoFormatObjs()> called for invalidate anchor text frame." );
}
@@ -356,7 +343,7 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
// are registered at the 'master' anchor text frame.
// Thus, format the other floating screen objects through the 'master'
// anchor text frame
- ASSERT( mpMasterAnchorTxtFrm,
+ OSL_ENSURE( mpMasterAnchorTxtFrm,
"SwObjectFormatterTxtFrm::DoFormatObjs() - missing 'master' anchor text frame" );
bSuccess = _FormatObjsAtFrm( mpMasterAnchorTxtFrm );
@@ -372,14 +359,12 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
bSuccess = _FormatObjsAtFrm();
}
- // --> OD 2006-07-24 #b449874#
// consider anchored objects, whose wrapping style influence are temporarly
// considered.
if ( bSuccess &&
( ConsiderWrapOnObjPos() ||
( !mrAnchorTxtFrm.IsFollow() &&
_AtLeastOneObjIsTmpConsiderWrapInfluence() ) ) )
- // <--
{
const bool bDoesAnchorHadPrev = ( mrAnchorTxtFrm.GetIndPrev() != 0 );
@@ -388,36 +373,32 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
// previous frames of the anchor frame. The format of the previous
// frames is needed to get a correct result of format of the
// anchor frame for the following check for moved forward anchors
- // --> OD 2005-01-11 #i40141# - use new method - it also formats the
+ // #i40141# - use new method - it also formats the
// section the anchor frame is in.
_FormatAnchorFrmForCheckMoveFwd();
- // <--
sal_uInt32 nToPageNum( 0L );
- // --> OD 2005-03-30 #i43913#
+ // #i43913#
bool bInFollow( false );
- // <--
SwAnchoredObject* pObj = 0L;
if ( !mrAnchorTxtFrm.IsFollow() )
{
pObj = _GetFirstObjWithMovedFwdAnchor(
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017# - constant name has changed
text::WrapInfluenceOnPosition::ONCE_CONCURRENT,
- // <--
nToPageNum, bInFollow );
}
- // --> OD 2004-10-25 #i35911#
+ // #i35911#
if ( pObj && pObj->HasClearedEnvironment() )
{
pObj->SetClearedEnvironment( true );
- // --> OD 2005-03-08 #i44049# - consider, that anchor frame
+ // #i44049# - consider, that anchor frame
// could already been marked to move forward.
SwPageFrm* pAnchorPageFrm( mrAnchorTxtFrm.FindPageFrm() );
- // --> OD 2005-03-30 #i43913# - consider, that anchor frame
+ // #i43913# - consider, that anchor frame
// is a follow or is in a follow row, which will move forward.
if ( pAnchorPageFrm != pObj->GetPageFrm() ||
bInFollow )
- // <--
{
bool bInsert( true );
sal_uInt32 nTmpToPageNum( 0L );
@@ -441,17 +422,16 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterTxtFrm::DoFormatObjs(..)> - anchor frame not marked to move forward" );
}
}
}
else if ( pObj && bDoesAnchorHadPrev )
- // <--
{
// Object found, whose anchor is moved forward
- // --> OD 2005-06-01 #i49987# - consider, that anchor frame
+ // #i49987# - consider, that anchor frame
// could already been marked to move forward.
bool bInsert( true );
sal_uInt32 nMovedFwdToPageNum( 0L );
@@ -484,13 +464,11 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwObjectFormatterTxtFrm::DoFormatObjs(..)> - anchor frame not marked to move forward" );
}
- // <--
}
- // <--
- // --> OD 2005-01-12 #i40155# - mark anchor frame not to wrap around
+ // #i40155# - mark anchor frame not to wrap around
// objects under the condition, that its follow contains all its text.
else if ( !mrAnchorTxtFrm.IsFollow() &&
mrAnchorTxtFrm.GetFollow() &&
@@ -503,7 +481,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
*(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
mrAnchorTxtFrm );
}
- // <--
}
return bSuccess;
@@ -515,12 +492,10 @@ void SwObjectFormatterTxtFrm::_InvalidatePrevObjs( SwAnchoredObject& _rAnchoredO
// positioning is <NONE_CONCURRENT_POSIITIONED>.
// Note: list of objects at anchor frame is sorted by this property.
if ( _rAnchoredObj.GetFrmFmt().GetWrapInfluenceOnObjPos().
- // --> OD 2004-10-18 #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
+ // #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
GetWrapInfluenceOnObjPos( true ) ==
- // <--
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017# - constant name has changed
text::WrapInfluenceOnPosition::ONCE_CONCURRENT )
- // <--
{
const SwSortedObjs* pObjs = GetAnchorFrm().GetDrawObjs();
if ( pObjs )
@@ -531,12 +506,10 @@ void SwObjectFormatterTxtFrm::_InvalidatePrevObjs( SwAnchoredObject& _rAnchoredO
{
SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
if ( pAnchoredObj->GetFrmFmt().GetWrapInfluenceOnObjPos().
- // --> OD 2004-10-18 #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
+ // #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
GetWrapInfluenceOnObjPos( true ) ==
- // <--
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017# - constant name has changed
text::WrapInfluenceOnPosition::ONCE_CONCURRENT )
- // <--
{
pAnchoredObj->InvalidateObjPosForConsiderWrapInfluence( true );
}
@@ -571,11 +544,10 @@ SwAnchoredObject* SwObjectFormatterTxtFrm::_GetFirstObjWithMovedFwdAnchor(
sal_uInt32& _noToPageNum,
bool& _boInFollow )
{
- // --> OD 2004-10-18 #i35017# - constant names have changed
- ASSERT( _nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ||
+ // #i35017# - constant names have changed
+ OSL_ENSURE( _nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ||
_nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_CONCURRENT,
"<SwObjectFormatterTxtFrm::_GetFirstObjWithMovedFwdAnchor(..)> - invalid value for parameter <_nWrapInfluenceOnPosition>" );
- // <--
SwAnchoredObject* pRetAnchoredObj = 0L;
@@ -585,13 +557,12 @@ SwAnchoredObject* SwObjectFormatterTxtFrm::_GetFirstObjWithMovedFwdAnchor(
SwAnchoredObject* pAnchoredObj = GetCollectedObj(i);
if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() &&
pAnchoredObj->GetFrmFmt().GetWrapInfluenceOnObjPos().
- // --> OD 2004-10-18 #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
+ // #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
GetWrapInfluenceOnObjPos( true ) == _nWrapInfluenceOnPosition )
- // <--
{
- // --> OD 2004-10-11 #i26945# - use new method <_CheckMovedFwdCondition(..)>
- // --> OD 2005-03-30 #i43913#
- // --> OD 2006-01-27 #i58182# - consider new method signature
+ // #i26945# - use new method <_CheckMovedFwdCondition(..)>
+ // #i43913#
+ // #i58182# - consider new method signature
if ( SwObjectFormatterTxtFrm::CheckMovedFwdCondition( *GetCollectedObj( i ),
GetPgNumOfCollected( i ),
IsCollectedAnchoredAtMaster( i ),
@@ -600,14 +571,13 @@ SwAnchoredObject* SwObjectFormatterTxtFrm::_GetFirstObjWithMovedFwdAnchor(
pRetAnchoredObj = pAnchoredObj;
break;
}
- // <--
}
}
return pRetAnchoredObj;
}
-// --> OD 2006-01-27 #i58182#
+// #i58182#
// - replace private method by corresponding static public method
bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition(
SwAnchoredObject& _rAnchoredObj,
@@ -625,7 +595,6 @@ bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition(
if ( nPageNum > _nFromPageNum )
{
_noToPageNum = nPageNum;
- // --> OD 2006-06-28 #b6443897#
// Handling of special case:
// If anchor frame is move forward into a follow flow row,
// <_noToPageNum> is set to <_nFromPageNum + 1>, because it is
@@ -641,12 +610,10 @@ bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition(
_noToPageNum = _nFromPageNum + 1;
}
}
- // <--
bAnchorIsMovedForward = true;
}
}
- // <--
- // --> OD 2004-11-05 #i26945# - check, if an at-paragraph|at-character
+ // #i26945# - check, if an at-paragraph|at-character
// anchored object is now anchored at a follow text frame, which will be
// on the next page. Also check, if an at-character anchored object
// is now anchored at a text frame, which is in a follow flow row,
@@ -657,7 +624,7 @@ bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition(
(_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_PARA)))
{
SwFrm* pAnchorFrm = _rAnchoredObj.GetAnchorFrmContainingAnchPos();
- ASSERT( pAnchorFrm->IsTxtFrm(),
+ OSL_ENSURE( pAnchorFrm->IsTxtFrm(),
"<SwObjectFormatterTxtFrm::CheckMovedFwdCondition(..) - wrong type of anchor frame>" );
SwTxtFrm* pAnchorTxtFrm = static_cast<SwTxtFrm*>(pAnchorFrm);
bool bCheck( false );
@@ -687,33 +654,29 @@ bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition(
{
_noToPageNum = _nFromPageNum + 1;
bAnchorIsMovedForward = true;
- // --> OD 2005-03-30 #i43913#
+ // #i43913#
_boInFollow = true;
- // <--
}
}
}
- // <--
return bAnchorIsMovedForward;
}
-// <--
-// --> OD 2005-01-12 #i40140# - helper method to format layout frames used by
+// #i40140# - helper method to format layout frames used by
// method <SwObjectFormatterTxtFrm::_FormatAnchorFrmForCheckMoveFwd()>
-// --> OD 2005-03-04 #i44049# - format till a certain lower frame, if provided.
+// #i44049# - format till a certain lower frame, if provided.
void lcl_FormatCntntOfLayoutFrm( SwLayoutFrm* pLayFrm,
SwFrm* pLastLowerFrm = 0L )
{
SwFrm* pLowerFrm = pLayFrm->GetLower();
while ( pLowerFrm )
{
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
if ( pLastLowerFrm && pLowerFrm == pLastLowerFrm )
{
break;
}
- // <--
if ( pLowerFrm->IsLayoutFrm() )
lcl_FormatCntntOfLayoutFrm( static_cast<SwLayoutFrm*>(pLowerFrm),
pLastLowerFrm );
@@ -723,20 +686,18 @@ void lcl_FormatCntntOfLayoutFrm( SwLayoutFrm* pLayFrm,
pLowerFrm = pLowerFrm->GetNext();
}
}
-// <--
+
/** method to format given anchor text frame and its previous frames
- OD 2005-11-17 #i56300#
+ #i56300#
Usage: Needed to check, if the anchor text frame is moved forward
due to the positioning and wrapping of its anchored objects, and
to format the frames, which have become invalid due to the anchored
object formatting in the iterative object positioning algorithm
-
- @author OD
*/
void SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtFrm )
{
- // --> OD 2005-04-13 #i47014# - no format of section and previous columns
+ // #i47014# - no format of section and previous columns
// for follow text frames.
if ( !_rAnchorTxtFrm.IsFollow() )
{
@@ -756,15 +717,13 @@ void SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtF
}
if ( pSectFrm && pSectFrm->IsSctFrm() )
{
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
_rAnchorTxtFrm.LockJoin();
- // <--
SwFrm* pFrm = pSectFrm->GetUpper()->GetLower();
- // --> OD 2005-05-23 #i49605# - section frame could move forward
+ // #i49605# - section frame could move forward
// by the format of its previous frame.
// Thus, check for valid <pFrm>.
while ( pFrm && pFrm != pSectFrm )
- // <--
{
if ( pFrm->IsLayoutFrm() )
lcl_FormatCntntOfLayoutFrm( static_cast<SwLayoutFrm*>(pFrm) );
@@ -775,21 +734,19 @@ void SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtF
}
lcl_FormatCntntOfLayoutFrm( static_cast<SwLayoutFrm*>(pSectFrm),
&_rAnchorTxtFrm );
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
_rAnchorTxtFrm.UnlockJoin();
- // <--
}
}
- // --> OD 2005-01-12 #i40140# - if anchor frame is inside a column,
+ // #i40140# - if anchor frame is inside a column,
// format the content of the previous columns.
// Note: It's a very simple format without formatting objects.
SwFrm* pColFrmOfAnchor = _rAnchorTxtFrm.FindColFrm();
if ( pColFrmOfAnchor )
{
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
_rAnchorTxtFrm.LockJoin();
- // <--
SwFrm* pColFrm = pColFrmOfAnchor->GetUpper()->GetLower();
while ( pColFrm != pColFrmOfAnchor )
{
@@ -806,16 +763,13 @@ void SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtF
pColFrm = pColFrm->GetNext();
}
- // --> OD 2005-03-04 #i44049#
+ // #i44049#
_rAnchorTxtFrm.UnlockJoin();
- // <--
}
- // <--
}
- // <--
// format anchor frame - format of its follow not needed
- // --> OD 2005-04-08 #i43255# - forbid follow format, only if anchor text
+ // #i43255# - forbid follow format, only if anchor text
// frame is in table
if ( _rAnchorTxtFrm.IsInTab() )
{
@@ -830,9 +784,7 @@ void SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtF
/** method to format the anchor frame for checking of the move forward condition
- OD 2005-01-11 #i40141#
-
- @author OD
+ #i40141#
*/
void SwObjectFormatterTxtFrm::_FormatAnchorFrmForCheckMoveFwd()
{
@@ -841,10 +793,6 @@ void SwObjectFormatterTxtFrm::_FormatAnchorFrmForCheckMoveFwd()
/** method to determine if at least one anchored object has state
<temporarly consider wrapping style influence> set.
-
- OD 2006-07-24 #b6449874#
-
- @author OD
*/
bool SwObjectFormatterTxtFrm::_AtLeastOneObjIsTmpConsiderWrapInfluence()
{
@@ -868,3 +816,4 @@ bool SwObjectFormatterTxtFrm::_AtLeastOneObjIsTmpConsiderWrapInfluence()
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objectformattertxtfrm.hxx b/sw/source/core/layout/objectformattertxtfrm.hxx
index d408f0638f39..3d526f9dd214 100644
--- a/sw/source/core/layout/objectformattertxtfrm.hxx
+++ b/sw/source/core/layout/objectformattertxtfrm.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
class SwTxtFrm;
// -----------------------------------------------------------------------------
-// OD 2004-07-01 #i28701#
+// #i28701#
// Format floating screen objects, which are anchored at a given anchor text frame
// and registered at the given page frame.
// -----------------------------------------------------------------------------
@@ -51,18 +52,16 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
SwTxtFrm* _pMasterAnchorTxtFrm,
SwLayAction* _pLayAction );
- /* method to invalidate objects, anchored previous to given object at
+ /** method to invalidate objects, anchored previous to given object at
the anchor text frame
@param _rAnchoredObj
reference to anchored object - objects, anchored previous to
this one will be invalidated.
-
- @author OD
*/
void _InvalidatePrevObjs( SwAnchoredObject& _rAnchoredObj );
- /* method to invalidate objects, anchored after the given object at
+ /** method to invalidate objects, anchored after the given object at
the page frame
@param _rAnchoredObj
@@ -72,8 +71,6 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
@param _bInclObj
boolean indicates, if given anchored object <_rAnchoredObj> also have
to be invalidated.
-
- @author OD
*/
void _InvalidateFollowObjs( SwAnchoredObject& _rAnchoredObj,
const bool _bInclObj );
@@ -84,12 +81,12 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
'anchor (of an object) is moved forward', if the anchor frame
respectively the anchor character of the object isn't on the
proposed page frame. Instead its on a following page
- OD 2004-10-04 #i26945# - For at-character anchored objects,
+
+ #i26945# - For at-character anchored objects,
it has also to be checked, if the anchor character is in a follow
text frame, which would move to the next page.
- OD 2005-03-30 #i43913# - add output parameter <_boInFollow>
- @author OD
+ #i43913# - add output parameter <_boInFollow>
@param _nWrapInfluenceOnPosition
input parameter - only object with this given wrapping style
@@ -119,18 +116,12 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
/** method to format the anchor frame for checking of the move forward condition
- OD 2005-01-11 #i40141#
-
- @author OD
+ #i40141#
*/
void _FormatAnchorFrmForCheckMoveFwd();
/** method to determine if at least one anchored object has state
<temporarly consider wrapping style influence> set.
-
- OD 2006-07-24 #b6449874#
-
- @author OD
*/
bool _AtLeastOneObjIsTmpConsiderWrapInfluence();
@@ -141,16 +132,13 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
public:
virtual ~SwObjectFormatterTxtFrm();
- // --> OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>.
+ // #i40147# - add parameter <_bCheckForMovedFwd>.
virtual bool DoFormatObj( SwAnchoredObject& _rAnchoredObj,
const bool _bCheckForMovedFwd = false );
- // <--
virtual bool DoFormatObjs();
/** method to create an instance of <SwObjectFormatterTxtFrm> is
necessary.
-
- @author OD
*/
static SwObjectFormatterTxtFrm* CreateObjFormatter(
SwTxtFrm& _rAnchorTxtFrm,
@@ -159,14 +147,12 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
/** method to format given anchor text frame and its previous frames
- OD 2005-11-17 #i56300#
+ #i56300#
Usage: Needed to check, if the anchor text frame is moved forward
due to the positioning and wrapping of its anchored objects, and
to format the frames, which have become invalid due to the anchored
object formatting in the iterative object positioning algorithm
- @author OD
-
@param _rAnchorTxtFrm
input parameter - reference to anchor text frame, which has to be
formatted including its previous frames of the page.
@@ -175,13 +161,11 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
/** method to check the conditions, if 'anchor is moved forward'
- OD 2004-10-11 #i26945#
- OD 2005-03-30 #i43913# - add output parameter <_boInFollow>
- OD 2006-01-27 #i58182# - replace method by a corresponding static
+ #i26945#
+ #i43913# - add output parameter <_boInFollow>
+ #i58182# - replace method by a corresponding static
method, because it's needed for the iterative positioning algorithm.
- @author OD
-
@param _rAnchoredObj
input parameter - anchored object, for which the condition has to checked.
@@ -213,3 +197,5 @@ class SwObjectFormatterTxtFrm : public SwObjectFormatter
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
index 49df0c687c0c..1c32c9c75f26 100644
--- a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
+++ b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ void SwObjsMarkedAsTmpConsiderWrapInfluence::Clear()
maObjsTmpConsiderWrapInfl.pop_back();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.hxx b/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
index 90504c199edd..f5fd89b3b435 100644
--- a/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
+++ b/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,3 +46,5 @@ class SwObjsMarkedAsTmpConsiderWrapInfluence
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 9792fc09ed42..29c51dff0725 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,6 @@
#include "frmtool.hxx"
#include "fldbas.hxx"
#include "hints.hxx"
-#include "errhdl.hxx"
#include "swtable.hxx"
#include "ftnidx.hxx"
@@ -85,9 +85,6 @@ using namespace ::com::sun::star;
|*
|* SwBodyFrm::SwBodyFrm()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 01. Aug. 93
-|*
|*************************************************************************/
SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt ):
SwLayoutFrm( pFmt )
@@ -99,9 +96,6 @@ SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt ):
|*
|* SwBodyFrm::Format()
|*
-|* Ersterstellung MA 30. May. 94
-|* Letzte Aenderung MA 20. Jan. 99
-|*
|*************************************************************************/
void SwBodyFrm::Format( const SwBorderAttrs * )
{
@@ -189,13 +183,26 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
bValidSize = bValidPrtArea = sal_True;
}
+void SwBodyFrm::Paint( const SwRect& rRect, const SwPrintData* ) const
+{
+#if OSL_DEBUG_LAYOUT > 1
+ // Paint a red border around the SwBodyFrm in debug mode
+ ViewShell *pSh = GetShell();
+ OutputDevice* pOut = pSh->GetOut();
+ pOut->Push();
+ pOut->SetLineColor(Color(255, 0, 0));
+ pOut->SetFillColor(COL_TRANSPARENT);
+ SwRect aRect = Frm();
+ pOut->DrawRect(aRect.SVRect());
+ pOut->Pop();
+#endif
+ SwLayoutFrm::Paint(rRect);
+}
+
/*************************************************************************
|*
|* SwPageFrm::SwPageFrm(), ~SwPageFrm()
|*
-|* Ersterstellung MA 20. Oct. 92
-|* Letzte Aenderung MA 08. Dec. 97
-|*
|*************************************************************************/
SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
SwFtnBossFrm( pFmt ),
@@ -356,11 +363,6 @@ void SwPageFrm::CheckDirection( sal_Bool bVert )
else if(FRMDIR_VERT_TOP_LEFT==nDir)
bVertLR = 1;
}
-/*
- if( pDesc && pDesc->GetName().GetChar(0)=='x')
- bReverse = 1;
- else
- */
bReverse = 0;
bInvalidVert = 0;
}
@@ -380,8 +382,6 @@ void SwPageFrm::CheckDirection( sal_Bool bVert )
|*
|* Beschreibung Erzeugt die Spezifischen Flys zur Seite und formatiert
|* generischen Cntnt
-|* Ersterstellung MA 20. Oct. 92
-|* Letzte Aenderung MA 09. Nov. 95
|*
|*************************************************************************/
void MA_FASTCALL lcl_FormatLay( SwLayoutFrm *pLay )
@@ -429,7 +429,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
pSdrObj = 0;
if ( bSdrObj && 0 == (pSdrObj = pFmt->FindSdrObject()) )
{
- ASSERT( sal_False, "DrawObject not found." );
+ OSL_ENSURE( sal_False, "DrawObject not found." );
pFmt->GetDoc()->DelFrmFmt( pFmt );
--i;
continue;
@@ -537,9 +537,6 @@ void SwPageFrm::PreparePage( sal_Bool bFtn )
|*
|* SwPageFrm::Modify()
|*
-|* Ersterstellung MA 20. Oct. 92
-|* Letzte Aenderung MA 03. Mar. 96
-|*
|*************************************************************************/
void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
@@ -602,17 +599,17 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
//Abgesehen von den Grossenverhaeltnissen sind noch andere
//Dinge betroffen.
//1. Spaltigkeit.
- ASSERT( pOld && pNew, "FMT_CHG Missing Format." );
+ OSL_ENSURE( pOld && pNew, "FMT_CHG Missing Format." );
const SwFmt* pOldFmt = ((SwFmtChg*)pOld)->pChangedFmt;
const SwFmt* pNewFmt = ((SwFmtChg*)pNew)->pChangedFmt;
- ASSERT( pOldFmt && pNewFmt, "FMT_CHG Missing Format." );
+ OSL_ENSURE( pOldFmt && pNewFmt, "FMT_CHG Missing Format." );
const SwFmtCol &rOldCol = pOldFmt->GetCol();
const SwFmtCol &rNewCol = pNewFmt->GetCol();
if( rOldCol != rNewCol )
{
SwLayoutFrm *pB = FindBodyCont();
- ASSERT( pB, "Seite ohne Body." );
+ OSL_ENSURE( pB, "Seite ohne Body." );
pB->ChgColumns( rOldCol, rNewCol );
rInvFlags |= 0x20;
}
@@ -680,7 +677,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_COL:
{
SwLayoutFrm *pB = FindBodyCont();
- ASSERT( pB, "Seite ohne Body." );
+ OSL_ENSURE( pB, "Seite ohne Body." );
pB->ChgColumns( *(const SwFmtCol*)pOld, *(const SwFmtCol*)pNew );
rInvFlags |= 0x22;
}
@@ -733,8 +730,6 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
|* SwPageFrm::GetInfo()
|*
|* Beschreibung erfragt Informationen
-|* Ersterstellung JP 31.03.94
-|* Letzte Aenderung JP 31.03.94
|*
*************************************************************************/
// erfrage vom Modify Informationen
@@ -752,9 +747,6 @@ sal_Bool SwPageFrm::GetInfo( SfxPoolItem & rInfo ) const
|*
|* SwPageFrm::SetPageDesc()
|*
-|* Ersterstellung MA 02. Nov. 94
-|* Letzte Aenderung MA 02. Nov. 94
-|*
|*************************************************************************/
void SwPageFrm::SetPageDesc( SwPageDesc *pNew, SwFrmFmt *pFmt )
{
@@ -778,8 +770,6 @@ void SwPageFrm::SetPageDesc( SwPageDesc *pNew, SwFrmFmt *pFmt )
|* Dokument oder Standard (der 0-te) wenn der erste Absatz keinen
|* wuenscht.
|* (6. Im HTML-Mode ist der Pagedesc immer die HTML-Seitenvorlage.)
-|* Ersterstellung MA 15. Feb. 93
-|* Letzte Aenderung MA 17. Jun. 99
|*
|*************************************************************************/
SwPageDesc *SwPageFrm::FindPageDesc()
@@ -846,7 +836,7 @@ SwPageDesc *SwPageFrm::FindPageDesc()
->GetPageDesc( 0 ));
- ASSERT( pRet, "Kein Descriptor gefunden." );
+ OSL_ENSURE( pRet, "Kein Descriptor gefunden." );
return pRet;
}
@@ -878,9 +868,6 @@ inline void SetLastPage( SwPageFrm *pPage )
|*
|* SwPageFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 22. Jun. 95
-|*
|*************************************************************************/
void SwPageFrm::Cut()
{
@@ -952,17 +939,14 @@ void SwPageFrm::Cut()
|*
|* SwPageFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 07. Dec. 94
-|*
|*************************************************************************/
void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
{
- ASSERT( pParent->IsRootFrm(), "Parent ist keine Root." );
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetNext() && !GetUpper(),
+ OSL_ENSURE( pParent->IsRootFrm(), "Parent ist keine Root." );
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
//In den Baum einhaengen.
@@ -1002,9 +986,6 @@ void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|*
|* SwPageFrm::PrepareRegisterChg()
|*
-|* Ersterstellung AMA 22. Jul. 96
-|* Letzte Aenderung AMA 22. Jul. 96
-|*
|*************************************************************************/
void lcl_PrepFlyInCntRegister( SwCntntFrm *pFrm )
{
@@ -1069,13 +1050,10 @@ void SwPageFrm::PrepareRegisterChg()
|* aufgespuehrt werden, so wird versucht die Situation moeglichst
|* einfache zu bereinigen.
|*
-|* Ersterstellung MA 10. Feb. 93
-|* Letzte Aenderung MA 18. Apr. 96
-|*
|*************************************************************************/
void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
{
- ASSERT( pStart, "Keine Startpage." );
+ OSL_ENSURE( pStart, "Keine Startpage." );
ViewShell *pSh = pStart->GetShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
@@ -1202,10 +1180,10 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
if ( pPage->GetFmt() != pFmtWish )
pPage->SetFrmFmt( pFmtWish );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT( sal_False, "CheckPageDescs, missing solution" );
+ OSL_ENSURE( sal_False, "CheckPageDescs, missing solution" );
}
#endif
}
@@ -1245,7 +1223,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
pDoc->UpdatePageFlds( &aMsgHnt );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//Ein paar Pruefungen muessen schon erlaubt sein.
//1. Keine zwei EmptyPages hintereinander.
@@ -1258,7 +1236,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
{
if ( bEmpty )
{
- ASSERT( sal_False, "Doppelte Leerseiten." );
+ OSL_ENSURE( sal_False, "Doppelte Leerseiten." );
break; //Einmal reicht.
}
bEmpty = sal_True;
@@ -1270,7 +1248,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
//moeglich: Ein paar Seiten, auf der ersten 'erste Seite' anwenden,
//rechte als folge der ersten, linke als folge der rechten, rechte als
//folge der linken.
-// ASSERT( pPg->GetPageDesc() == pPg->FindPageDesc(),
+// OSL_ENSURE( pPg->GetPageDesc() == pPg->FindPageDesc(),
// "Seite mit falschem Descriptor." );
pPg = (SwPageFrm*)pPg->GetNext();
@@ -1282,10 +1260,6 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields )
|*
|* SwFrm::InsertPage()
|*
-|* Beschreibung
-|* Ersterstellung MA 10. Feb. 93
-|* Letzte Aenderung MA 27. Jul. 93
-|*
|*************************************************************************/
SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
{
@@ -1315,7 +1289,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
if ( !pDesc )
pDesc = pPrevPage->GetPageDesc()->GetFollow();
- ASSERT( pDesc, "Missing PageDesc" );
+ OSL_ENSURE( pDesc, "Missing PageDesc" );
if( !(bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt()) )
bWishedOdd = !bWishedOdd;
@@ -1346,7 +1320,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
bCheckPages = sal_True;
}
pFmt = bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
- ASSERT( pFmt, "Descriptor without format." );
+ OSL_ENSURE( pFmt, "Descriptor without format." );
SwPageFrm *pPage = new SwPageFrm( pFmt, pDesc );
pPage->Paste( pRoot, pSibling );
pPage->PreparePage( bFtn );
@@ -1421,9 +1395,6 @@ sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const
|*
|* SwRootFrm::GrowFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
SwTwips SwRootFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
@@ -1436,14 +1407,11 @@ SwTwips SwRootFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
|*
|* SwRootFrm::ShrinkFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
SwTwips SwRootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
{
- ASSERT( nDist >= 0, "nDist < 0." );
- ASSERT( nDist <= Frm().Height(), "nDist > als aktuelle Groesse." );
+ OSL_ENSURE( nDist >= 0, "nDist < 0." );
+ OSL_ENSURE( nDist <= Frm().Height(), "nDist > als aktuelle Groesse." );
if ( !bTst )
Frm().SSize().Height() -= nDist;
@@ -1465,9 +1433,6 @@ SwTwips SwRootFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
|* - einmal fuer die Endnotenseiten.
|* - und einmal fuer die Seiten des Bodytextes.
|*
-|* Ersterstellung MA 20. May. 92
-|* Letzte Aenderung MA 10. Jan. 95
-|*
|*************************************************************************/
void SwRootFrm::RemoveSuperfluous()
{
@@ -1529,7 +1494,7 @@ void SwRootFrm::RemoveSuperfluous()
while ( pPage->IsFtnPage() )
{
pPage = (SwPageFrm*)pPage->GetPrev();
- ASSERT( pPage, "Nur noch Endnotenseiten uebrig." );
+ OSL_ENSURE( pPage, "Nur noch Endnotenseiten uebrig." );
}
continue;
}
@@ -1566,9 +1531,6 @@ void SwRootFrm::RemoveSuperfluous()
|* sind, damit alle Seitengebundenen Rahmen und DrawObject
|* untergebracht sind.
|*
-|* Ersterstellung MA 27. Jul. 93
-|* Letzte Aenderung MA 24. Apr. 97
-|*
|*************************************************************************/
void SwRootFrm::AssertFlyPages()
{
@@ -1652,9 +1614,6 @@ void SwRootFrm::AssertFlyPages()
|* auf allen Seiten die Seitengebunden Objecte auf der richtigen
|* Seite (Seitennummer stehen).
|*
-|* Ersterstellung MA 02. Nov. 94
-|* Letzte Aenderung MA 10. Aug. 95
-|*
|*************************************************************************/
void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
{
@@ -1682,14 +1641,14 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
{
//Umhaengen kann er sich selbst, indem wir ihm
//einfach ein Modify mit seinem AnkerAttr schicken.
-#ifndef DBG_UTIL
- rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
-#else
+#if OSL_DEBUG_LEVEL > 1
const sal_uInt32 nCnt = pPage->GetSortedObjs()->Count();
rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
- ASSERT( !pPage->GetSortedObjs() ||
+ OSL_ENSURE( !pPage->GetSortedObjs() ||
nCnt != pPage->GetSortedObjs()->Count(),
"Kann das Obj nicht umhaengen." );
+#else
+ rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
#endif
--i;
}
@@ -1704,9 +1663,6 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
|*
|* SwRootFrm::ChgSize()
|*
-|* Ersterstellung MA 24. Jul. 92
-|* Letzte Aenderung MA 13. Aug. 93
-|*
|*************************************************************************/
Size SwRootFrm::ChgSize( const Size& aNewSize )
{
@@ -1720,9 +1676,6 @@ Size SwRootFrm::ChgSize( const Size& aNewSize )
|*
|* SwRootFrm::MakeAll()
|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 19. Apr. 93
-|*
|*************************************************************************/
void SwRootFrm::MakeAll()
{
@@ -1744,9 +1697,6 @@ void SwRootFrm::MakeAll()
|*
|* SwRootFrm::ImplInvalidateBrowseWidth()
|*
-|* Ersterstellung MA 08. Jun. 96
-|* Letzte Aenderung MA 08. Jun. 96
-|*
|*************************************************************************/
void SwRootFrm::ImplInvalidateBrowseWidth()
{
@@ -1763,13 +1713,10 @@ void SwRootFrm::ImplInvalidateBrowseWidth()
|*
|* SwRootFrm::ImplCalcBrowseWidth()
|*
-|* Ersterstellung MA 07. Jun. 96
-|* Letzte Aenderung MA 13. Jun. 96
-|*
|*************************************************************************/
void SwRootFrm::ImplCalcBrowseWidth()
{
- ASSERT( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE),
+ OSL_ENSURE( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE),
"CalcBrowseWidth and not in BrowseView" );
//Die (minimale) Breite wird von Rahmen, Tabellen und Zeichenobjekten
@@ -1898,9 +1845,6 @@ void SwRootFrm::ImplCalcBrowseWidth()
|*
|* SwRootFrm::StartAllAction()
|*
-|* Ersterstellung MA 08. Mar. 98
-|* Letzte Aenderung MA 08. Mar. 98
-|*
|*************************************************************************/
void SwRootFrm::StartAllAction()
@@ -2137,7 +2081,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
}
else
{
- ASSERT( pViewOpt, "CheckViewLayout required ViewOptions" )
+ OSL_ENSURE( pViewOpt, "CheckViewLayout required ViewOptions" );
const sal_uInt16 nColumns = pViewOpt->GetViewLayoutColumns();
const bool bBookMode = pViewOpt->IsViewLayoutBookMode();
@@ -2291,11 +2235,9 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
// first page in book mode is always special:
if ( bFirstRow && mbBookMode )
{
- // --> OD 2008-04-08 #i88036#
-// nCurrentRowWidth += pStartOfRow->Frm().Width() + nSidebarWidth;
+ // #i88036#
nCurrentRowWidth +=
pStartOfRow->GetFormatPage().Frm().Width() + nSidebarWidth;
- // <--
}
// center page if possible
@@ -2311,10 +2253,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
if ( bFirstRow && mbBookMode )
{
- // --> OD 2008-04-08 #i88036#
-// nX += pStartOfRow->Frm().Width() + nSidebarWidth;
+ // #i88036#
nX += pStartOfRow->GetFormatPage().Frm().Width() + nSidebarWidth;
- // <--
}
SwPageFrm* pEndOfRow = pPageFrm;
@@ -2465,16 +2405,6 @@ bool SwRootFrm::IsLeftToRightViewLayout() const
// <--
}
-/*const SwRect SwRootFrm::GetExtendedPageArea( sal_uInt16 nPageNumber ) const
-{
- SwRect aRet;
- ASSERT( nPageNumber < maPageRects.size(), "No extended page area available" )
- if ( nPageNumber < maPageRects.size() )
- aRet = maPageRects[ nPageNumber ];
- return aRet;
-}*/
-
-
const SwPageFrm& SwPageFrm::GetFormatPage() const
{
const SwPageFrm* pRet = this;
@@ -2499,10 +2429,11 @@ const SwPageFrm& SwPageFrm::GetFormatPage() const
pRet = static_cast<const SwPageFrm*>( GetNext() );
}
}
- ASSERT( pRet,
+ OSL_ENSURE( pRet,
"<SwPageFrm::GetFormatPage()> - inconsistent layout: empty page without previous and next page frame --> crash." );
// <--
}
return *pRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 71eaebf14893..aeebee1294db 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,9 +56,6 @@
|*
|* SwPageDesc::SwPageDesc()
|*
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung MA 16. Feb. 94
-|*
|*************************************************************************/
@@ -122,8 +120,6 @@ SwPageDesc::~SwPageDesc()
|*
|* Beschreibung Gespiegelt werden nur die Raender.
|* Attribute wie Umrandung und dergleichen werden 1:1 kopiert.
-|* Ersterstellung MA 25. Jan. 93
-|* Letzte Aenderung 01. Nov. 94
|*
|*************************************************************************/
@@ -167,8 +163,6 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
|* SwPageDesc::GetInfo()
|*
|* Beschreibung erfragt Informationen
-|* Ersterstellung JP 31.03.94
-|* Letzte Aenderung JP 31.03.94
|*
*************************************************************************/
@@ -176,14 +170,9 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
// erfrage vom Modify Informationen
sal_Bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
{
-// if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
-// {
- // dann weiter zum Format
- if( !aMaster.GetInfo( rInfo ) )
- return sal_False; // gefunden
- return aLeft.GetInfo( rInfo );
-// }
-// return sal_True; // weiter suchen
+ if( !aMaster.GetInfo( rInfo ) )
+ return sal_False; // found
+ return aLeft.GetInfo( rInfo );
}
/*************************************************************************
@@ -191,8 +180,6 @@ sal_Bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
|* SwPageDesc::SetRegisterFmtColl()
|*
|* Beschreibung setzt die Vorlage fuer die Registerhaltigkeit
-|* Ersterstellung AMA 22.07.96
-|* Letzte Aenderung AMA 22.07.96
|*
*************************************************************************/
@@ -215,8 +202,6 @@ void SwPageDesc::SetRegisterFmtColl( const SwTxtFmtColl* pFmt )
|* SwPageDesc::GetRegisterFmtColl()
|*
|* Beschreibung holt die Vorlage fuer die Registerhaltigkeit
-|* Ersterstellung AMA 22.07.96
-|* Letzte Aenderung AMA 22.07.96
|*
*************************************************************************/
@@ -232,8 +217,6 @@ const SwTxtFmtColl* SwPageDesc::GetRegisterFmtColl() const
|* SwPageDesc::RegisterChange()
|*
|* Beschreibung benachrichtigt alle betroffenen PageFrames
-|* Ersterstellung AMA 22.07.96
-|* Letzte Aenderung AMA 22.07.96
|*
*************************************************************************/
@@ -282,8 +265,6 @@ void SwPageDesc::RegisterChange()
|*
|* Beschreibung reagiert insbesondere auf Aenderungen
|* der Vorlage fuer die Registerhaltigkeit
-|* Ersterstellung AMA 22.07.96
-|* Letzte Aenderung AMA 22.07.96
|*
*************************************************************************/
@@ -343,13 +324,13 @@ const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
const SwPageDesc* pPd = bCheckForThisPgDc ? this :
((SwPageFrm*)pChkFrm)->GetPageDesc();
pRet = &pPd->GetMaster();
- ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd,
+ OSL_ENSURE( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd,
"Falcher Node fuers erkennen des Seitenformats" );
// an welchem Format haengt diese Seite?
if( pRet != pChkFrm->GetRegisteredIn() )
{
pRet = &pPd->GetLeft();
- ASSERT( pRet == pChkFrm->GetRegisteredIn(),
+ OSL_ENSURE( pRet == pChkFrm->GetRegisteredIn(),
"Falcher Node fuers erkennen des Seitenformats" );
}
}
@@ -378,9 +359,6 @@ sal_Bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
|*
|* SwPageFtnInfo::SwPageFtnInfo()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 24. Feb. 93
-|*
|*************************************************************************/
@@ -416,9 +394,6 @@ SwPageFtnInfo::SwPageFtnInfo( const SwPageFtnInfo &rCpy ) :
|*
|* SwPageFtnInfo::operator=
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 24. Feb. 93
-|*
|*************************************************************************/
@@ -438,9 +413,6 @@ SwPageFtnInfo &SwPageFtnInfo::operator=( const SwPageFtnInfo& rCpy )
|*
|* SwPageFtnInfo::operator==
|*
-|* Ersterstellung MA 01. Mar. 93
-|* Letzte Aenderung MA 01. Mar. 93
-|*
|*************************************************************************/
@@ -510,3 +482,5 @@ SwPageDescExt::operator SwPageDesc() const
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src
new file mode 100644
index 000000000000..83b80e4714f9
--- /dev/null
+++ b/sw/source/core/layout/pagefrm.src
@@ -0,0 +1,17 @@
+#include "pagefrm.hrc"
+
+Bitmap BMP_PAGE_RIGHT_SHADOW_MASK
+{
+ File = "page-right-shadow-mask.png";
+};
+
+Bitmap BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK
+{
+ File = "page-bottomright-shadow-mask.png";
+};
+
+Bitmap BMP_PAGE_BOTTOM_SHADOW_MASK
+{
+ File = "page-bottom-shadow-mask.png";
+};
+
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index e0f4914da529..483832ecd966 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,6 +107,10 @@
#define COL_NOTES_SIDEPANE_SCROLLAREA RGB_COLORDATA(230,230,220)
#include <vcl/svapp.hxx>
+#include <svtools/borderhelper.hxx>
+
+#include "pagefrm.hrc"
+
using namespace ::com::sun::star;
#define GETOBJSHELL() ((SfxObjectShell*)rSh.GetDoc()->GetDocShell())
@@ -147,15 +152,17 @@ using namespace ::com::sun::star;
class SwLineRect : public SwRect
{
const Color *pColor;
+ SvxBorderStyle nStyle;
const SwTabFrm *pTab;
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,
+ SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyle,
const SwTabFrm *pT , const sal_uInt8 nSCol );
const Color *GetColor() const { return pColor;}
+ SvxBorderStyle GetStyle() const { return nStyle; }
const SwTabFrm *GetTab() const { return pTab; }
void SetPainted() { bPainted = sal_True; }
void Lock( sal_Bool bLock ) { if ( bLock )
@@ -177,7 +184,7 @@ class SwLineRects : public SwLRects
sal_uInt16 nLastCount; //unuetze Durchlaeufe im PaintLines verhindern.
public:
SwLineRects() : nLastCount( 0 ) {}
- void AddLineRect( const SwRect& rRect, const Color *pColor,
+ void AddLineRect( const SwRect& rRect, const Color *pColor, const SvxBorderStyle nStyle,
const SwTabFrm *pTab, const sal_uInt8 nSCol );
void ConnectEdges( OutputDevice *pOut );
void PaintLines ( OutputDevice *pOut );
@@ -408,10 +415,11 @@ SwSavePaintStatics::~SwSavePaintStatics()
SV_IMPL_VARARR( SwLRects, SwLineRect );
-SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol,
+SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyl,
const SwTabFrm *pT, const sal_uInt8 nSCol ) :
SwRect( rRect ),
pColor( pCol ),
+ nStyle( nStyl ),
pTab( pT ),
nSubColor( nSCol ),
bPainted( sal_False ),
@@ -456,7 +464,7 @@ sal_Bool SwLineRect::MakeUnion( const SwRect &rRect )
return sal_False;
}
-void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol,
+void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyle,
const SwTabFrm *pTab, const sal_uInt8 nSCol )
{
//Rueckwaerts durch, weil Linien die zusammengefasst werden koennen i.d.R.
@@ -475,7 +483,7 @@ void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol,
return;
}
}
- Insert( SwLineRect( rRect, pCol, pTab, nSCol ), Count() );
+ Insert( SwLineRect( rRect, pCol, nStyle, pTab, nSCol ), Count() );
}
void SwLineRects::ConnectEdges( OutputDevice *pOut )
@@ -582,7 +590,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( !rL1.IsInside( aIns ) )
continue;
const sal_uInt16 nTmpFree = Free();
- Insert( SwLineRect( aIns, rL1.GetColor(),
+ Insert( SwLineRect( aIns, rL1.GetColor(), SOLID,
rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
{
@@ -623,7 +631,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
if ( !rL1.IsInside( aIns ) )
continue;
const sal_uInt16 nTmpFree = Free();
- Insert( SwLineRect( aIns, rL1.GetColor(),
+ Insert( SwLineRect( aIns, rL1.GetColor(), SOLID,
rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
{
@@ -653,7 +661,7 @@ inline void SwSubsRects::Ins( const SwRect &rRect, const sal_uInt8 nSCol )
//Linien die kuerzer als die breiteste Linienbreite sind werden
//nicht aufgenommen.
if ( rRect.Height() > DEF_LINE_WIDTH_4 || rRect.Width() > DEF_LINE_WIDTH_4 )
- Insert( SwLineRect( rRect, 0, 0, nSCol ), Count());
+ Insert( SwLineRect( rRect, 0, SOLID, 0, nSCol ), Count());
}
void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
@@ -694,12 +702,12 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
if ( rLine.IsLocked () )
continue;
- if ( (!bVerticalSubs == (rLine.Height() > rLine.Width())) ) //gleiche Ausrichtung?
+ if ( !bVerticalSubs == (rLine.Height() > rLine.Width()) ) // same direction?
continue;
if ( aSubsRect.IsOver( rLine ) )
{
- if ( bVerticalSubs ) //Vertikal?
+ if ( bVerticalSubs ) // Vertical?
{
if ( aSubsRect.Left() <= rLine.Right() &&
aSubsRect.Right() >= rLine.Left() )
@@ -709,7 +717,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Bottom( nTmp );
- Insert( SwLineRect( aNewSubsRect, 0, 0,
+ Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
aSubsLineRect.GetSubColor() ), Count());
}
nTmp = rLine.Bottom()+nPixelSzH+1;
@@ -717,7 +725,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Top( nTmp );
- Insert( SwLineRect( aNewSubsRect, 0, 0,
+ Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
aSubsLineRect.GetSubColor() ), Count());
}
Remove( i, 1 );
@@ -735,7 +743,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Right( nTmp );
- Insert( SwLineRect( aNewSubsRect, 0, 0,
+ Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
aSubsLineRect.GetSubColor() ), Count());
}
nTmp = rLine.Right()+nPixelSzW+1;
@@ -743,7 +751,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Left( nTmp );
- Insert( SwLineRect( aNewSubsRect, 0, 0,
+ Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
aSubsLineRect.GetSubColor() ), Count());
}
Remove( i, 1 );
@@ -762,6 +770,44 @@ void SwLineRects::LockLines( sal_Bool bLock )
operator[](i).Lock( bLock );
}
+void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect & rLRect )
+{
+ double nHalfLWidth = rLRect.Height( );
+ if ( nHalfLWidth > 1 )
+ {
+ nHalfLWidth = nHalfLWidth / 2;
+ }
+ else
+ {
+ nHalfLWidth = 1;
+ }
+
+ long startX = rLRect.Left( );
+ long startY = rLRect.Top( ) + nHalfLWidth;
+ long endX = rLRect.Left( ) + rLRect.Width( );
+ long endY = rLRect.Top( ) + nHalfLWidth;
+
+ if ( rLRect.Height( ) > rLRect.Width( ) )
+ {
+ nHalfLWidth = rLRect.Width( );
+ if ( nHalfLWidth > 1 )
+ {
+ nHalfLWidth = nHalfLWidth / 2;
+ }
+ else
+ {
+ nHalfLWidth = 1;
+ }
+ startX = rLRect.Left( ) + nHalfLWidth;
+ startY = rLRect.Top( );
+ endX = rLRect.Left( ) + nHalfLWidth;
+ endY = rLRect.Top( ) + rLRect.Height( );
+ }
+
+ svtools::DrawLine( *pOut, Point( startX, startY ), Point( endX, endY ),
+ sal_uInt32( nHalfLWidth * 2 ), rLRect.GetStyle( ) );
+}
+
void SwLineRects::PaintLines( OutputDevice *pOut )
{
//Painten der Umrandungen. Leider muessen wir zweimal durch.
@@ -775,6 +821,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
// OD 2004-04-23 #116347#
pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
+ pOut->SetFillColor();
pOut->SetLineColor();
ConnectEdges( pOut );
const Color *pLast = 0;
@@ -833,11 +880,12 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
pOut->SetDrawMode( 0 );
- pOut->SetFillColor( *pLast );
+ pOut->SetLineColor( *pLast );
pOut->SetDrawMode( nOldDrawMode );
}
+
if( !rLRect.IsEmpty() )
- pOut->DrawRect( rLRect.SVRect() );
+ lcl_DrawDashedRect( pOut, rLRect );
rLRect.SetPainted();
}
else
@@ -871,7 +919,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
pOut->SetDrawMode( nOldDrawMode );
}
if( !rLRect.IsEmpty() )
- pOut->DrawRect( rLRect.SVRect() );
+ lcl_DrawDashedRect( pOut, rLRect );
rLRect.SetPainted();
}
nLastCount = nMinCount;
@@ -899,7 +947,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
SwLineRect &rLk = operator[](k);
if ( rLi.SSize() == rLk.SSize() )
{
- if ( (bVerticalSubs == (rLk.Height() > rLk.Width())) )
+ if ( bVerticalSubs == (rLk.Height() > rLk.Width()) )
{
if ( bVerticalSubs )
{
@@ -1352,12 +1400,12 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
continue;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//Flys, die innerhalb des eigenen verankert sind, muessen eine
//groessere OrdNum haben oder Zeichengebunden sein.
if ( pSelfFly && bLowerOfSelf )
{
- ASSERT( pFly->IsFlyInCntFrm() ||
+ OSL_ENSURE( pFly->IsFlyInCntFrm() ||
pSdrObj->GetOrdNumDirect() > pSelfFly->GetVirtDrawObj()->GetOrdNumDirect(),
"Fly with wrong z-Order" );
}
@@ -1477,16 +1525,6 @@ void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
pRetoucheFly = 0;
}
-// --> OD 2008-05-16 #i84659# - no longer needed
-//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.
-// return rFrmRect.Top() > rRect.Bottom();
-// // PAGES01 || (rFrmRect.Left() > rRect.Right()) );
-//}
-// <--
-
//---------------- Ausgabe fuer das BrushItem ----------------
/** lcl_DrawGraphicBackgrd - local help method to draw a background for a graphic
@@ -1815,7 +1853,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
bDraw = sal_False;
break;
- default: ASSERT( !pOutDev, "new Graphic position?" );
+ default: OSL_ENSURE( !pOutDev, "new Graphic position?" );
}
/// OD 02.09.2002 #99657#
@@ -2036,39 +2074,37 @@ void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &aOut )
io_aSwRect = SwRect( aSizedRect );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
Rectangle aTestOrgPxRect = aOut.LogicToPixel( io_aSwRect.SVRect() );
Rectangle aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
- ASSERT( aTestOrgPxRect == aTestNewPxRect,
+ OSL_ENSURE( aTestOrgPxRect == aTestNewPxRect,
"Error in lcl_AlignRectToPixelSize(..): Adjusted rectangle has incorrect position or size");
-#if OSL_DEBUG_LEVEL > 1
Rectangle aTestNewRect( aSizedRect );
/// check Left()
--aSizedRect.Left();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
- ASSERT( aTestOrgPxRect.Left() >= (aTestNewPxRect.Left()+1),
+ OSL_ENSURE( aTestOrgPxRect.Left() >= (aTestNewPxRect.Left()+1),
"Error in lcl_AlignRectToPixelSize(..): Left() not correct adjusted");
++aSizedRect.Left();
/// check Right()
++aSizedRect.Right();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
- ASSERT( aTestOrgPxRect.Right() <= (aTestNewPxRect.Right()-1),
+ OSL_ENSURE( aTestOrgPxRect.Right() <= (aTestNewPxRect.Right()-1),
"Error in lcl_AlignRectToPixelSize(..): Right() not correct adjusted");
--aSizedRect.Right();
/// check Top()
--aSizedRect.Top();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
- ASSERT( aTestOrgPxRect.Top() >= (aTestNewPxRect.Top()+1),
+ OSL_ENSURE( aTestOrgPxRect.Top() >= (aTestNewPxRect.Top()+1),
"Error in lcl_AlignRectToPixelSize(..): Top() not correct adjusted");
++aSizedRect.Top();
/// check Bottom()
++aSizedRect.Bottom();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
- ASSERT( aTestOrgPxRect.Bottom() <= (aTestNewPxRect.Bottom()-1),
+ OSL_ENSURE( aTestOrgPxRect.Bottom() <= (aTestNewPxRect.Bottom()-1),
"Error in lcl_AlignRectToPixelSize(..): Bottom() not correct adjusted");
--aSizedRect.Bottom();
#endif
-#endif
}
@@ -2281,7 +2317,7 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons
break;
const SwLineEntrySet& rEntrySet = (*aIter).second;
- SwLineEntrySetIter aSetIter = rEntrySet.begin();
+ SwLineEntrySetConstIter aSetIter = rEntrySet.begin();
while ( aSetIter != rEntrySet.end() )
{
const SwLineEntry& rEntry = *aSetIter;
@@ -2457,7 +2493,7 @@ void SwTabFrmPainter::FindStylesForLine( const Point& rStartPoint,
// pStyles[ 6 ] = bHori ? aRFromB : BFromR,
SwLineEntryMapConstIter aMapIter = maVertLines.find( rStartPoint.X() );
- ASSERT( aMapIter != maVertLines.end(), "FindStylesForLine: Error" )
+ OSL_ENSURE( aMapIter != maVertLines.end(), "FindStylesForLine: Error" );
const SwLineEntrySet& rVertSet = (*aMapIter).second;
SwLineEntrySetConstIter aIter = rVertSet.begin();
@@ -2482,7 +2518,7 @@ void SwTabFrmPainter::FindStylesForLine( const Point& rStartPoint,
}
aMapIter = maHoriLines.find( rStartPoint.Y() );
- ASSERT( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" )
+ OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" );
const SwLineEntrySet& rHoriSet = (*aMapIter).second;
aIter = rHoriSet.begin();
@@ -2509,7 +2545,7 @@ void SwTabFrmPainter::FindStylesForLine( const Point& rStartPoint,
if ( bHori )
{
aMapIter = maVertLines.find( rEndPoint.X() );
- ASSERT( aMapIter != maVertLines.end(), "FindStylesForLine: Error" )
+ OSL_ENSURE( aMapIter != maVertLines.end(), "FindStylesForLine: Error" );
const SwLineEntrySet& rVertSet2 = (*aMapIter).second;
aIter = rVertSet2.begin();
@@ -2526,7 +2562,7 @@ void SwTabFrmPainter::FindStylesForLine( const Point& rStartPoint,
else
{
aMapIter = maHoriLines.find( rEndPoint.Y() );
- ASSERT( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" )
+ OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" );
const SwLineEntrySet& rHoriSet2 = (*aMapIter).second;
aIter = rHoriSet2.begin();
@@ -2632,7 +2668,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori )
if ( SwLineEntry::OVERLAP1 == nOverlapType )
{
- ASSERT( rNew.mnStartPos >= rOld.mnStartPos, "Overlap type 3? How this?" )
+ OSL_ENSURE( rNew.mnStartPos >= rOld.mnStartPos, "Overlap type 3? How this?" );
// new left segment
const SwLineEntry aLeft( nKey, rOld.mnStartPos, rNew.mnStartPos, rOldAttr );
@@ -2719,15 +2755,12 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori )
|* 3. Den Dokumentinhalt (Text) Painten.
|* 4. Den Drawlayer der ueber dem Dokuemnt liegt painten.
|*
-|* Ersterstellung MA 01. Jun. 92
-|* Letzte Aenderung MA 10. Oct. 97
-|*
|*************************************************************************/
void
SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
- ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." );
+ OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." );
PROTOCOL( this, PROT_FILE_INIT, 0, 0)
@@ -2766,8 +2799,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
// --> OD 2008-10-07 #i92745#
// Extend check on certain states of the 'current' <ViewShell> instance to
// all existing <ViewShell> instances.
-// if ( !pSh->IsInEndAction() && !pSh->IsPaintInProgress() &&
-// (!pSh->Imp()->IsAction() || !pSh->Imp()->GetLayAction().IsActionInProgress() ) )
bool bPerformLayoutAction( true );
{
ViewShell* pTmpViewShell = pSh;
@@ -2827,7 +2858,16 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
while ( pPage )
// <--
{
- const bool bPaintRightShadow = !bBookMode || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage());
+ // Paint right shadow in single page mode, or if we're on last page of
+ // the doc, or if ???Lower()??? or if we're on a page with no right
+ // sibling (OnRightPage should be renamed as OnEvenPage since it does
+ // not take reading direction into account)
+ const bool bPaintRightShadow = !bBookMode || (!pPage->GetNext()) || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage());
+ // Have a full bottom shadow on side by side pages.
+ // TODO Do not draw full shadow if our sibling hasn't the
+ // same orientation
+ const bool bFullBottomShadow = bBookMode && pPage->GetPrev() &&
+ ((!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage()));
const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT;
if ( !pPage->IsEmptyPage() )
@@ -2847,20 +2887,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
aPaintRect._Intersection( aRect );
- // --> OD 2007-11-14 #i82616#
- // Invalidate area for extra data (line numbers or change tracking
- // marks), if painting on a window and the paint is trigger by an
- // end action. The inefficient and simple enlargement of the
- // paint area is replaced by this invalidation.
- // if ( bExtraData )
- // {
- // //Ja, das ist grob, aber wie macht man es besser?
- // SWRECTFN( pPage )
- // (aPaintRect.*fnRect->fnSetLeftAndWidth)(
- // (pPage->Frm().*fnRect->fnGetLeft)(),
- // (pPage->Frm().*fnRect->fnGetWidth)() );
- // aPaintRect._Intersection( pSh->VisArea() );
- // }
if ( bExtraData &&
pSh->GetWin() && pSh->IsInEndAction() )
{
@@ -2947,7 +2973,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
// OD 12.02.2003 #i9719#, #105645# - use new method
// <SwPageFrm::PaintBorderAndShadow(..)>.
- SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bRightSidebar );
+ SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bFullBottomShadow, bRightSidebar );
SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar);
}
@@ -3039,7 +3065,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
// paint shadow and border for empty page
// OD 19.02.2003 #107369# - use new method to paint page border and
// shadow
- SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bPaintRightShadow, bRightSidebar );
+ SwPageFrm::PaintBorderAndShadow( aEmptyPageRect, pSh, bPaintRightShadow, bFullBottomShadow, bRightSidebar );
SwPageFrm::PaintNotesSidebar( aEmptyPageRect, pSh, pPage->GetPhyPageNum(), bRightSidebar);
{
@@ -3048,25 +3074,13 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
}
}
- ASSERT( !pPage->GetNext() || pPage->GetNext()->IsPageFrm(),
+ OSL_ENSURE( !pPage->GetNext() || pPage->GetNext()->IsPageFrm(),
"Nachbar von Seite keine Seite." );
pPage = (SwPageFrm*)pPage->GetNext();
}
DELETEZ( pLines );
-#ifdef FRANK_TEST
- if ( pSh->GetWin() )
- {
- Rectangle aRect( aFrm.SVRect() );
- pSh->GetWin()->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
- pSh->GetWin()->SetFillColor();
- pSh->GetWin()->SetLineColor( COL_LIGHTRED );
- pSh->GetWin()->DrawRect( aRect );
- pSh->GetWin()->Pop();
- }
-#endif
-
if ( bResetRootPaint )
SwRootFrm::bInPaint = sal_False;
if ( pStatics )
@@ -3080,49 +3094,10 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
((SwRootFrm*)this)->SetCallbackActionEnabled( bOldAction );
}
-#ifdef LONG_TABLE_HACK
-
-/*************************************************************************
-|*
-|* SwRootFrm::HackPrepareLongTblPaint()
-|*
-|* Ersterstellung MA 27. Sep. 96
-|* Letzte Aenderung MA 18. Nov. 97
-|*
-|*************************************************************************/
-
-void SwRootFrm::HackPrepareLongTblPaint( int nMode )
-{
- switch ( nMode )
- {
- case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" );
- pLines = new SwLineRects;
- ASSERT( !pGlobalShell, "old GlobalShell lost" );
- pGlobalShell = GetShell();
- bTableHack = sal_True;
- break;
- case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( sal_True ); break;
- case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() );
- break;
- case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( sal_False ); break;
- case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() );
- DELETEZ( pLines );
- pGlobalShell = 0;
- bTableHack = sal_False;
- break;
- }
-}
-
-#endif
-
-
/*************************************************************************
|*
|* SwLayoutFrm::Paint()
|*
-|* Ersterstellung MA 19. May. 92
-|* Letzte Aenderung MA 19. Apr. 95
-|*
|*************************************************************************/
void MA_FASTCALL lcl_EmergencyFormatFtnCont( SwFtnContFrm *pCont )
@@ -3373,9 +3348,6 @@ sal_Bool SwFlyFrm::IsShadowTransparent() const
|*
|* SwFlyFrm::IsPaint()
|*
-|* Ersterstellung MA 16. Jan. 97
-|* Letzte Aenderung MA 16. Jan. 97
-|*
|*************************************************************************/
sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
@@ -3451,7 +3423,7 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh )
// OD 02.07.2003 #108784# - debug assert
if ( !pObj->ISA(SdrObjGroup) )
{
- ASSERT( false, "<SwFlyFrm::IsPaint(..)> - paint of drawing object without anchor frame!?" );
+ OSL_ENSURE( false, "<SwFlyFrm::IsPaint(..)> - paint of drawing object without anchor frame!?" );
}
}
}
@@ -3482,9 +3454,6 @@ void SwCellFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|*
|* SwFlyFrm::Paint()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 16. Jan. 97
-|*
|*************************************************************************/
//Weiter unten definiert
@@ -3610,7 +3579,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// --> OD 2007-12-13 #i80822#
// suppress painting of background in printing area for
// non-transparent graphics.
-// if ( bPaintMarginOnly )
if ( bPaintMarginOnly ||
( pNoTxt && !bIsGraphicTransparent ) )
// <--
@@ -3628,7 +3596,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// used in <SwNoTxtFrm::Paint(..)> to set the clip region
// for painting the graphic/OLE. Thus, the clip region is
// also applied for the PDF export.
-// if ( !pOut->GetConnectMetaFile() || pOut->GetOutDevType() == OUTDEV_PRINTER )
ViewShell *pSh = GetShell();
if ( !pOut->GetConnectMetaFile() || !pSh->GetWin() )
// <--
@@ -3721,9 +3688,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|*
|* SwTabFrm::Paint()
|*
-|* Ersterstellung MA 11. May. 93
-|* Letzte Aenderung MA 23. Mar. 95
-|*
|*************************************************************************/
void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
@@ -3774,8 +3738,6 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|* Der Schatten wird immer an den auesseren Rand des OutRect gemalt.
|* Das OutRect wird ggf. so verkleinert, dass auf diesem das
|* malen der Umrandung stattfinden kann.
-|* Ersterstellung MA 21. Dec. 92
-|* Letzte Aenderung MA 29. May. 97
|*
|*************************************************************************/
/// OD 23.08.2002 #99657#
@@ -3934,7 +3896,7 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
}
break;
default:
- ASSERT( !this, "new ShadowLocation() ?" )
+ OSL_ENSURE( !this, "new ShadowLocation() ?" );
break;
}
@@ -3983,15 +3945,13 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
|*
|* SwFrm::PaintBorderLine()
|*
-|* Ersterstellung MA 22. Dec. 92
-|* Letzte Aenderung MA 22. Jan. 95
-|*
|*************************************************************************/
void SwFrm::PaintBorderLine( const SwRect& rRect,
const SwRect& rOutRect,
const SwPageFrm *pPage,
- const Color *pColor ) const
+ const Color *pColor,
+ const SvxBorderStyle nStyle ) const
{
if ( !rOutRect.IsOver( rRect ) )
return;
@@ -4014,10 +3974,10 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
SwRegionRects aRegion( aOut, 4, 1 );
::lcl_SubtractFlys( this, pPage, aOut, aRegion );
for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
- pLines->AddLineRect( aRegion[i], pColor, pTab, nSubCol );
+ pLines->AddLineRect( aRegion[i], pColor, nStyle, pTab, nSubCol );
}
else
- pLines->AddLineRect( aOut, pColor, pTab, nSubCol );
+ pLines->AddLineRect( aOut, pColor, nStyle, pTab, nSubCol );
}
/*************************************************************************
@@ -4025,8 +3985,6 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
|* SwFrm::PaintBorderLines()
|*
|* Beschreibung Nur alle Linien einfach oder alle Linien doppelt!!!!
-|* Ersterstellung MA 22. Dec. 92
-|* Letzte Aenderung MA 22. Mar. 95
|*
|*************************************************************************/
@@ -4308,7 +4266,8 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
(aPaintRect.*_rRectFn->fnAddRight)( 1 );
}
}
- _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pLeftRightBorder->GetColor() );
+ _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pLeftRightBorder->GetColor(),
+ pLeftRightBorder->GetStyle( ) );
}
if ( pLeftRightBorder->GetInWidth() )
@@ -4348,7 +4307,8 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
(aPaintRect.*_rRectFn->fnAddRight)( 1 );
}
}
- _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pLeftRightBorder->GetColor() );
+ _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pLeftRightBorder->GetColor(),
+ SOLID );
}
}
}
@@ -4412,7 +4372,8 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
(aPaintRect.*_rRectFn->fnAddBottom)( 1 );
}
}
- _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pTopBottomBorder->GetColor() );
+ _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pTopBottomBorder->GetColor(),
+ pTopBottomBorder->GetStyle( ) );
}
if ( pTopBottomBorder->GetInWidth() )
@@ -4451,7 +4412,8 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
(aPaintRect.*_rRectFn->fnAddBottom)( 1 );
}
}
- _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pTopBottomBorder->GetColor() );
+ _rFrm.PaintBorderLine( _rRect, aPaintRect, &_rPage, &pTopBottomBorder->GetColor(),
+ SOLID );
}
}
}
@@ -4467,8 +4429,8 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
const SwFrm* lcl_HasNextCell( const SwFrm& rFrm )
{
- ASSERT( rFrm.IsCellFrm(),
- "lcl_HasNextCell( const SwFrm& rFrm ) should be called with SwCellFrm" )
+ OSL_ENSURE( rFrm.IsCellFrm(),
+ "lcl_HasNextCell( const SwFrm& rFrm ) should be called with SwCellFrm" );
const SwFrm* pTmpFrm = &rFrm;
do
@@ -4489,8 +4451,6 @@ const SwFrm* lcl_HasNextCell( const SwFrm& rFrm )
|* SwFrm::PaintBorder()
|*
|* Beschreibung Malt Schatten und Umrandung
-|* Ersterstellung MA 23.01.92
-|* Letzte Aenderung MA 29. Jul. 96
|*
|*************************************************************************/
@@ -4521,7 +4481,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
const SwBorderAttrs& _rCellBorderAttrs,
const bool _bTop )
{
- ASSERT( _pCellFrm, "No cell frame available, dying soon" )
+ OSL_ENSURE( _pCellFrm, "No cell frame available, dying soon" );
// determine, if cell frame is at bottom/top border of a table frame and
// the table frame has/is a follow.
@@ -4550,7 +4510,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
}
}
}
- ASSERT( pTmpFrm && pTmpFrm->IsRowFrm(), "No RowFrm available" );
+ OSL_ENSURE( pTmpFrm && pTmpFrm->IsRowFrm(), "No RowFrm available" );
const SwLayoutFrm* pParentRowFrm = static_cast<const SwLayoutFrm*>(pTmpFrm);
const SwTabFrm* pParentTabFrm =
@@ -4616,7 +4576,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
{
pLowerCell = pLowerCell->GetLower();
}
- ASSERT( pLowerCell && pLowerCell->IsCellFrm(), "No CellFrm available" );
+ OSL_ENSURE( pLowerCell && pLowerCell->IsCellFrm(), "No CellFrm available" );
pRet = pLowerCell;
}
else if ( !_bTop && !_rCellBorderAttrs.GetBox().GetBottom() )
@@ -4648,7 +4608,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
}
pLowerCell = pLowerCell->GetLower();
}
- ASSERT( pLowerCell && pLowerCell->IsCellFrm(), "No CellFrm available" );
+ OSL_ENSURE( pLowerCell && pLowerCell->IsCellFrm(), "No CellFrm available" );
pRet = pLowerCell;
}
}
@@ -4661,7 +4621,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
const SwBorderAttrs &rAttrs ) const
{
//fuer (Row,Body,Ftn,Root,Column,NoTxt) gibt's hier nix zu tun
- if ( (GetType() & 0x90C5) || (Prt().SSize() == Frm().SSize()) )
+ if ( (GetType() & 0x90C5) )
return;
if ( (GetType() & 0x2000) && //Cell
@@ -4753,9 +4713,6 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
{
const SwFrm* pDirRefFrm = IsCellFrm() ? FindTabFrm() : this;
SWRECTFN( pDirRefFrm )
- // OD 19.05.2003 #109667# - use new method <lcl_PaintLeftRightLine(..)>
- //::lcl_PaintLeftLine ( this, pPage, aRect, rRect, rAttrs, fnRect );
- //::lcl_PaintRightLine ( this, pPage, aRect, rRect, rAttrs, fnRect );
::lcl_PaintLeftRightLine ( sal_True, *(this), *(pPage), aRect, rRect, rAttrs, fnRect );
::lcl_PaintLeftRightLine ( sal_False, *(this), *(pPage), aRect, rRect, rAttrs, fnRect );
if ( !IsCntntFrm() || rAttrs.GetTopLine( *(this) ) )
@@ -4768,14 +4725,10 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
SwBorderAttrAccess aAccess( SwFrm::GetCache(),
pCellFrmForTopBorderAttrs );
const SwBorderAttrs &rTopAttrs = *aAccess.Get();
- // OD 19.05.2003 #109667# - use new method <lcl_PaintTopBottomLine(..)>
- //::lcl_PaintTopLine( this, pPage, aRect, rRect, rTopAttrs, fnRect );
::lcl_PaintTopBottomLine( sal_True, *(this), *(pPage), aRect, rRect, rTopAttrs, fnRect );
}
else
{
- // OD 19.05.2003 #109667# - use new method <lcl_PaintTopBottomLine(..)>
- //::lcl_PaintTopLine( this, pPage, aRect, rRect, rAttrs, fnRect );
::lcl_PaintTopBottomLine( sal_True, *(this), *(pPage), aRect, rRect, rAttrs, fnRect );
}
}
@@ -4789,14 +4742,10 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
SwBorderAttrAccess aAccess( SwFrm::GetCache(),
pCellFrmForBottomBorderAttrs );
const SwBorderAttrs &rBottomAttrs = *aAccess.Get();
- // OD 19.05.2003 #109667# - use new method <lcl_PaintTopBottomLine(..)>
- //::lcl_PaintBottomLine(this, pPage, aRect, rRect, rBottomAttrs, fnRect);
::lcl_PaintTopBottomLine(sal_False, *(this), *(pPage), aRect, rRect, rBottomAttrs, fnRect);
}
else
{
- // OD 19.05.2003 #109667# - use new method <lcl_PaintTopBottomLine(..)>
- //::lcl_PaintBottomLine(this, pPage, aRect, rRect, rAttrs, fnRect);
::lcl_PaintTopBottomLine(sal_False, *(this), *(pPage), aRect, rRect, rAttrs, fnRect);
}
}
@@ -4811,8 +4760,6 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
|* Beschreibung Spezialimplementierung wg. der Fussnotenlinie.
|* Derzeit braucht nur der obere Rand beruecksichtigt werden.
|* Auf andere Linien und Schatten wird verzichtet.
-|* Ersterstellung MA 27. Feb. 93
-|* Letzte Aenderung MA 08. Sep. 93
|*
|*************************************************************************/
@@ -4831,8 +4778,6 @@ void SwFtnContFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
|* SwFtnContFrm::PaintLine()
|*
|* Beschreibung Fussnotenline malen.
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung MA 28. Mar. 94
|*
|*************************************************************************/
@@ -4862,7 +4807,7 @@ void SwFtnContFrm::PaintLine( const SwRect& rRect,
case FTNADJ_LEFT:
/* do nothing */; break;
default:
- ASSERT( !this, "Neues Adjustment fuer Fussnotenlinie?" );
+ OSL_ENSURE( !this, "Neues Adjustment fuer Fussnotenlinie?" );
}
SwTwips nLineWidth = rInf.GetLineWidth();
const SwRect aLineRect = bVert ?
@@ -4880,8 +4825,6 @@ void SwFtnContFrm::PaintLine( const SwRect& rRect,
|*
|* Beschreibung Painted die Trennlinien fuer die innenliegenden
|* Spalten.
-|* Ersterstellung MA 21. Jun. 93
-|* Letzte Aenderung MA 28. Mar. 94
|*
|*************************************************************************/
@@ -4910,7 +4853,7 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
case COLADJ_BOTTOM:
break;
default:
- ASSERT( !this, "Neues Adjustment fuer Spaltenlinie?" );
+ OSL_ENSURE( !this, "Neues Adjustment fuer Spaltenlinie?" );
}
if( nTop )
@@ -4932,7 +4875,7 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
(aLineRect.*fnRect->fnSetPosX)
( (pCol->Frm().*fnGetX)() - nPenHalf );
if ( aRect.IsOver( aLineRect ) )
- PaintBorderLine( aRect, aLineRect , pPage, &rFmtCol.GetLineColor());
+ PaintBorderLine( aRect, aLineRect , pPage, &rFmtCol.GetLineColor() );
pCol = pCol->GetNext();
}
}
@@ -5260,6 +5203,8 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
{
SwRect aPgRect = Frm();
aPgRect._Intersection( _rOutputRect );
+ if(aPgRect.Height() < 0 || aPgRect.Width() <= 0) // No intersection
+ return;
SwRegionRects aPgRegion( aPgRect );
aPgRegion -= aPgPrtRect;
const SwPageFrm* pPage = static_cast<const SwPageFrm*>(this);
@@ -5285,46 +5230,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
}
}
-// ----------------------------------------------------------------------
-//
-// const SwPageFrm::mnBorderPxWidth, const SwPageFrm::mnShadowPxWidth
-// SwPageFrm::GetBorderRect (..), SwPageFrm::GetRightShadowRect(..),
-// SwPageFrm::GetBottomShadowRect(..),
-// SwPageFrm::PaintBorderAndShadow(..),
-// SwPageFrm::GetBorderAndShadowBoundRect(..)
-//
-// OD 12.02.2003 for #i9719# and #105645#
-// ----------------------------------------------------------------------
-
-const sal_Int8 SwPageFrm::mnBorderPxWidth = 1;
-const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
-
-/** determine rectangle for page border
-
- OD 12.02.2003 for #i9719# and #105645#
-
- @author OD
-*/
-/*static*/ void SwPageFrm::GetBorderRect( const SwRect& _rPageRect,
- ViewShell* _pViewShell,
- SwRect& _orBorderRect,
- bool bRightSidebar )
-{
- SwRect aAlignedPageRect( _rPageRect );
- ::SwAlignRect( aAlignedPageRect, _pViewShell );
- Rectangle aBorderPxRect =
- _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
-
- aBorderPxRect.Left() = aBorderPxRect.Left() - mnBorderPxWidth;
- aBorderPxRect.Top() = aBorderPxRect.Top() - mnBorderPxWidth;
- aBorderPxRect.Right() = aBorderPxRect.Right() + mnBorderPxWidth;
- aBorderPxRect.Bottom() = aBorderPxRect.Bottom() + mnBorderPxWidth;
-
- AddSidebarBorders(aBorderPxRect,_pViewShell, bRightSidebar, true);
-
- _orBorderRect =
- SwRect( _pViewShell->GetOut()->PixelToLogic( aBorderPxRect ) );
-}
+const sal_Int8 SwPageFrm::mnShadowPxWidth = 10;
/** determine rectangle for right page shadow
@@ -5339,20 +5245,20 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
{
SwRect aAlignedPageRect( _rPageRect );
::SwAlignRect( aAlignedPageRect, _pViewShell );
- Rectangle aPagePxRect =
+ SwRect aPagePxRect =
_pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+ const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0;
- Rectangle aRightShadowPxRect(
- aPagePxRect.Right() + mnShadowPxWidth,
- aPagePxRect.Top() + 1,
- aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
- aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+ _orRightShadowRect.Chg(
+ Point( aPagePxRect.Right() + 1, aPagePxRect.Top() + mnShadowPxWidth + 1 ),
+ Size( mnShadowPxWidth, aPagePxRect.Height() - mnShadowPxWidth - 1 ) );
- if ( bRightSidebar )
- AddSidebarBorders(aRightShadowPxRect,_pViewShell, bRightSidebar, true);
+ if (bRightSidebar && pMgr && pMgr->ShowNotes() && pMgr->HasNotes())
+ {
+ _orRightShadowRect.Pos(_orRightShadowRect.Left() + pMgr->GetSidebarWidth(true)
+ + pMgr->GetSidebarBorderWidth(true), _orRightShadowRect.Top());
+ }
- _orRightShadowRect =
- SwRect( _pViewShell->GetOut()->PixelToLogic( aRightShadowPxRect ) );
}
/** determine rectangle for bottom page shadow
@@ -5364,23 +5270,31 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
/*static*/ void SwPageFrm::GetBottomShadowRect( const SwRect& _rPageRect,
ViewShell* _pViewShell,
SwRect& _orBottomShadowRect,
+ bool bFullBottomShadow,
bool bRightSidebar )
{
+ const SwPostItMgr *pMgr = _pViewShell ? _pViewShell->GetPostItMgr() : 0;
SwRect aAlignedPageRect( _rPageRect );
::SwAlignRect( aAlignedPageRect, _pViewShell );
- Rectangle aPagePxRect =
+ SwRect aPagePxRect =
_pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
- Rectangle aBottomShadowPxRect(
- aPagePxRect.Left() + 1,
- aPagePxRect.Bottom() + mnShadowPxWidth,
- aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
- aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+ // Shadow is shifted when not full
+ long lShadowAdjustment = (bFullBottomShadow ? 0 : 1 + mnShadowPxWidth);
- AddSidebarBorders(aBottomShadowPxRect,_pViewShell, bRightSidebar, true);
+ _orBottomShadowRect.Chg(
+ Point( aPagePxRect.Left() + lShadowAdjustment, aPagePxRect.Bottom() + 1 ),
+ Size( aPagePxRect.Width() - lShadowAdjustment, mnShadowPxWidth ) );
- _orBottomShadowRect =
- SwRect( _pViewShell->GetOut()->PixelToLogic( aBottomShadowPxRect ) );
+ if(pMgr && pMgr->ShowNotes() && pMgr->HasNotes())
+ {
+ // Notes are displayed, we've to extend borders
+ SwTwips aSidebarTotalWidth = pMgr->GetSidebarWidth(true) + pMgr->GetSidebarBorderWidth(true);
+ if(bRightSidebar)
+ _orBottomShadowRect.Right( _orBottomShadowRect.Right() + aSidebarTotalWidth );
+ else
+ _orBottomShadowRect.Left( _orBottomShadowRect.Left() - aSidebarTotalWidth );
+ }
}
/** paint page border and shadow
@@ -5393,40 +5307,70 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
/*static*/ void SwPageFrm::PaintBorderAndShadow( const SwRect& _rPageRect,
ViewShell* _pViewShell,
bool bPaintRightShadow,
+ bool bFullBottomShadow,
bool bRightSidebar )
{
+ // No shadow in prefs
+ if( !SwViewOption::IsShadow() ) return;
+
// --> FME 2004-06-24 #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
// <--
- // get color for page border and shadow paint
- const Color& rColor = SwViewOption::GetFontColor();
+ static BitmapEx aPageTopRightShadow;
+ static BitmapEx aPageBottomRightShadow;
+ static BitmapEx aPageBottomLeftShadow;
+ static BitmapEx aPageBottomShadowBase;
+ static BitmapEx aPageRightShadowBase;
+ static Color aShadowColor;
+
- // save current fill and line color of output device
- Color aFill( _pViewShell->GetOut()->GetFillColor() );
- Color aLine( _pViewShell->GetOut()->GetLineColor() );
+ if(aShadowColor != SwViewOption::GetShadowColor() ) {
+ aShadowColor = SwViewOption::GetShadowColor();
+ AlphaMask aMask( SW_RES( BMP_PAGE_BOTTOM_RIGHT_SHADOW_MASK ) );
+ Bitmap aFilledSquare( Size( mnShadowPxWidth, mnShadowPxWidth ), 24 );
+ aFilledSquare.Erase( aShadowColor );
+
+ aPageBottomRightShadow = BitmapEx( aFilledSquare, aMask );
+ aMask.Rotate( 900, 255 );
+ aPageTopRightShadow = BitmapEx( aFilledSquare, aMask );
+ aMask.Rotate( 1800, 255);
+ aPageBottomLeftShadow = BitmapEx( aFilledSquare, aMask );
+
+ aFilledSquare = Bitmap( Size( 1, mnShadowPxWidth ), 24 );
+ aFilledSquare.Erase( aShadowColor );
+ aMask = Bitmap( SW_RES( BMP_PAGE_BOTTOM_SHADOW_MASK ) );
+ aPageBottomShadowBase = BitmapEx( aFilledSquare, aMask );
+
+ aFilledSquare = Bitmap( Size( mnShadowPxWidth, 1 ), 24 );
+ aFilledSquare.Erase( aShadowColor );
+ aMask = Bitmap( SW_RES( BMP_PAGE_RIGHT_SHADOW_MASK ) );
+ aPageRightShadowBase = BitmapEx( aFilledSquare, aMask );
+ }
- // paint page border
- _pViewShell->GetOut()->SetFillColor(); // OD 20.02.2003 #107369# - no fill color
- _pViewShell->GetOut()->SetLineColor( rColor );
SwRect aPaintRect;
- SwPageFrm::GetBorderRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
- _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+ OutputDevice *pOut = _pViewShell->GetOut();
// paint right shadow
if ( bPaintRightShadow )
{
- _pViewShell->GetOut()->SetFillColor( rColor );
SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
- _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+ BitmapEx aPageRightShadow = aPageRightShadowBase;
+ aPageRightShadow.Scale( 1, aPaintRect.Height() );
+ pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageRightShadow );
+ pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left(), aPaintRect.Top() - mnShadowPxWidth ) ), aPageTopRightShadow );
+ pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.BottomLeft() ), aPageBottomRightShadow );
}
// paint bottom shadow
- SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bRightSidebar );
- _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
-
- _pViewShell->GetOut()->SetFillColor( aFill );
- _pViewShell->GetOut()->SetLineColor( aLine );
+ SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect, bFullBottomShadow, bRightSidebar );
+ if(!bFullBottomShadow)
+ {
+ pOut->DrawBitmapEx( pOut->PixelToLogic( Point( aPaintRect.Left() - mnShadowPxWidth, aPaintRect.Top() ) ), aPageBottomLeftShadow );
+ }
+ BitmapEx aPageBottomShadow = aPageBottomShadowBase;
+ aPageBottomShadow.Scale( aPaintRect.Width(), 1 );
+ pOut->DrawBitmapEx( pOut->PixelToLogic( aPaintRect.Pos() ), aPageBottomShadow);
}
//mod #i6193# paint sidebar for notes
@@ -5557,14 +5501,22 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
SwRect& _orBorderAndShadowBoundRect,
bool bRightSidebar )
{
+ SwRect aAlignedPageRect( _rPageRect );
+ ::SwAlignRect( aAlignedPageRect, _pViewShell );
+ SwRect aPagePxRect =
+ _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+
SwRect aTmpRect;
- SwPageFrm::GetBorderRect( _rPageRect, _pViewShell, _orBorderAndShadowBoundRect, bRightSidebar );
SwPageFrm::GetRightShadowRect( _rPageRect, _pViewShell, aTmpRect, bRightSidebar );
- _orBorderAndShadowBoundRect.Union( aTmpRect );
- SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aTmpRect, bRightSidebar );
- _orBorderAndShadowBoundRect.Union( aTmpRect );
- AddSidebarBorders(_orBorderAndShadowBoundRect, _pViewShell, bRightSidebar, false);
+ aPagePxRect.Right( aTmpRect.Right() );
+
+ // Always ask for full shadow
+ SwPageFrm::GetBottomShadowRect( _rPageRect, _pViewShell, aTmpRect, true, bRightSidebar );
+ aPagePxRect.Bottom( aTmpRect.Bottom() );
+ aPagePxRect.Left( aTmpRect.Left() );
+
+ _orBorderAndShadowBoundRect = _pViewShell->GetOut()->PixelToLogic( aPagePxRect.SVRect() );
}
/*static*/ void SwPageFrm::AddSidebarBorders(SwRect &aRect, ViewShell* _pViewShell, bool bRightSidebar, bool bPx)
@@ -5602,9 +5554,6 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 2;
|*
|* SwFrm::PaintBaBo()
|*
-|* Ersterstellung MA 22. Oct. 93
-|* Letzte Aenderung MA 19. Jun. 96
-|*
|*************************************************************************/
void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
@@ -5655,9 +5604,6 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
|*
|* SwFrm::PaintBackground()
|*
-|* Ersterstellung MA 04. Jan. 93
-|* Letzte Aenderung MA 06. Feb. 97
-|*
|*************************************************************************/
/// OD 05.09.2002 #102912#
/// Do not paint background for fly frames without a background brush by
@@ -5850,8 +5796,6 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
|* SwPageFrm::RefreshSubsidiary()
|*
|* Beschreibung Erneuert alle Hilfslinien der Seite.
-|* Ersterstellung MA 04. Nov. 92
-|* Letzte Aenderung MA 10. May. 95
|*
|*************************************************************************/
@@ -5896,9 +5840,6 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
|*
|* SwLayoutFrm::RefreshLaySubsidiary()
|*
-|* Ersterstellung MA 04. Nov. 92
-|* Letzte Aenderung MA 22. Jan. 95
-|*
|*************************************************************************/
void SwLayoutFrm::RefreshLaySubsidiary( const SwPageFrm *pPage,
const SwRect &rRect ) const
@@ -5974,8 +5915,6 @@ void SwLayoutFrm::RefreshLaySubsidiary( const SwPageFrm *pPage,
|*
|* Beschreibung Hilfslinien um die PrtAreas malen
|* Nur die LayoutFrm's die direkt Cntnt enthalten.
-|* Ersterstellung MA 21. May. 92
-|* Letzte Aenderung MA 22. Jan. 95
|*
|*************************************************************************/
@@ -5998,7 +5937,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
SwLineRects* _pSubsLines )
{
//In welche Richtung gehts? Kann nur Horizontal oder Vertikal sein.
- ASSERT( ((rP1.X() == rP2.X()) || (rP1.Y() == rP2.Y())),
+ OSL_ENSURE( ((rP1.X() == rP2.X()) || (rP1.Y() == rP2.Y())),
"Schraege Hilfslinien sind nicht erlaubt." );
const PointPtr pDirPt = rP1.X() == rP2.X() ? pY : pX;
const PointPtr pOthPt = pDirPt == pX ? pY : pX;
@@ -6080,7 +6019,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
SwRect aRect( aP1, aP2 );
// OD 18.11.2002 #99672# - use parameter <_pSubsLines> instead of
// global variable <pSubsLines>.
- _pSubsLines->AddLineRect( aRect, 0, 0, nSubColor );
+ _pSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
aP1 = aP2;
aP1.*pDirPt += 1;
@@ -6219,13 +6158,13 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
if ( aOriginal.Left() == aOut.Left() )
{
const SwRect aRect( aOut.Pos(), aLB );
- pUsedSubsLines->AddLineRect( aRect, 0, 0, nSubColor );
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
// OD 14.11.2002 #104821# - in vertical layout set page/column break at right
if ( aOriginal.Right() == nRight )
{
const SwRect aRect( aRT, aRB );
- pUsedSubsLines->AddLineRect( aRect, 0, 0,
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0,
(bBreak && bVert) ? SUBCOL_BREAK : nSubColor );
}
}
@@ -6236,13 +6175,13 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
{
// OD 14.11.2002 #104821# - in horizontal layout set page/column break at top
const SwRect aRect( aOut.Pos(), aRT );
- pUsedSubsLines->AddLineRect( aRect, 0, 0,
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0,
(bBreak && !bVert) ? SUBCOL_BREAK : nSubColor );
}
if ( aOriginal.Bottom() == nBottom )
{
const SwRect aRect( aLB, aRB );
- pUsedSubsLines->AddLineRect( aRect, 0, 0, nSubColor );
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
}
}
@@ -6255,8 +6194,6 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
|* Beschreibung Erneuert alle Extradaten (Zeilennummern usw) der Seite.
|* Grundsaetzlich sind nur diejenigen Objekte beruecksichtig,
|* die in die seitliche Ausdehnung des Rects ragen.
-|* Ersterstellung MA 20. Jan. 98
-|* Letzte Aenderung MA 18. Feb. 98
|*
|*************************************************************************/
@@ -6382,8 +6319,6 @@ const Font& SwPageFrm::GetEmptyPageFont()
|* Retouche wird nur dann durchgefuehrt, wenn der Frm der letzte seiner
|* Kette ist. Der Gesamte Bereich des Upper unterhalb des Frm wird
|* per PaintBackground gecleared.
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 25. Jul. 96
|*
|*************************************************************************/
@@ -6392,8 +6327,8 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
if ( bFlyMetafile )
return;
- ASSERT( GetUpper(), "Retoucheversuch ohne Upper." );
- ASSERT( GetShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
+ OSL_ENSURE( GetUpper(), "Retoucheversuch ohne Upper." );
+ OSL_ENSURE( GetShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
SwRect aRetouche( GetUpper()->PaintArea() );
aRetouche.Top( Frm().Top() + Frm().Height() );
@@ -6471,8 +6406,6 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
Upper vorgegeben, die erste Brush wird benutzt.
Ist fuer keinen Frm eine Brush angegeben, so wird sal_False zurueck-
geliefert.
- Ersterstellung MA 23. Dec. 92
- Letzte Aenderung MA 04. Feb. 97
@param rpBrush
output parameter - constant reference pointer the found background brush
@@ -6490,10 +6423,6 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
input parameter - boolean indicating, if background brush should *not* be
taken from parent.
- @author MA
- @change 20.08.2002 by OD
- @docdate 20.08.2002
-
@return true, if a background brush for the frame is found
*/
sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
@@ -6598,9 +6527,6 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
|*
|* SwFrmFmt::GetGraphic()
|*
-|* Ersterstellung MA 23. Jul. 96
-|* Letzte Aenderung MA 23. Jul. 96
-|*
|*************************************************************************/
void SetOutDevAndWin( ViewShell *pSh, OutputDevice *pO,
@@ -6632,7 +6558,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
SFX_ITEM_SET != GetAttrSet().GetItemState( RES_URL, sal_True );
if( bNoteURL )
{
- ASSERT( !pNoteURL, "MakeGraphic: pNoteURL already used? " );
+ OSL_ENSURE( !pNoteURL, "MakeGraphic: pNoteURL already used? " );
pNoteURL = new SwNoteURL;
}
SwFlyFrm *pFly = (SwFlyFrm*)pFirst;
@@ -6712,7 +6638,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
if( bNoteURL )
{
- ASSERT( pNoteURL, "MakeGraphic: Good Bye, NoteURL." );
+ OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." );
pNoteURL->FillImageMap( pMap, pFly->Frm().Pos(), aMap );
delete pNoteURL;
pNoteURL = NULL;
@@ -6740,3 +6666,4 @@ Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index da6ed20bf45d..5c5d97f66b02 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,9 +71,6 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
|*
|* SwSectionFrm::SwSectionFrm(), ~SwSectionFrm()
|*
-|* Ersterstellung AMA 26. Nov. 97
-|* Letzte Aenderung AMA 26. Nov. 97
-|*
|*************************************************************************/
SwSectionFrm::SwSectionFrm( SwSection &rSect ) :
SwLayoutFrm( rSect.GetFmt() ),
@@ -125,7 +123,7 @@ SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
// frame and its insert in the layout.
void SwSectionFrm::Init()
{
- ASSERT( GetUpper(), "SwSectionFrm::Init before insertion?!" );
+ OSL_ENSURE( GetUpper(), "SwSectionFrm::Init before insertion?!" );
SWRECTFN( this )
long nWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
(Frm().*fnRect->fnSetWidth)( nWidth );
@@ -182,15 +180,12 @@ SwSectionFrm::~SwSectionFrm()
|*
|* SwSectionFrm::DelEmpty()
|*
-|* Ersterstellung AMA 17. Dec. 97
-|* Letzte Aenderung AMA 17. Dec. 97
-|*
|*************************************************************************/
void SwSectionFrm::DelEmpty( sal_Bool bRemove )
{
if( IsColLocked() )
{
- ASSERT( !bRemove, "Don't delete locked SectionFrms" );
+ OSL_ENSURE( !bRemove, "Don't delete locked SectionFrms" );
return;
}
SwFrm* pUp = GetUpper();
@@ -250,9 +245,6 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
|*
|* SwSectionFrm::Cut()
|*
-|* Ersterstellung AMA 02. Dec. 97
-|* Letzte Aenderung AMA 02. Dec. 97
-|*
|*************************************************************************/
void SwSectionFrm::Cut()
{
@@ -261,7 +253,7 @@ void SwSectionFrm::Cut()
void SwSectionFrm::_Cut( sal_Bool bRemove )
{
- ASSERT( GetUpper(), "Cut ohne Upper()." );
+ OSL_ENSURE( GetUpper(), "Cut ohne Upper()." );
PROTOCOL( this, PROT_CUT, 0, GetUpper() )
@@ -339,18 +331,15 @@ void SwSectionFrm::_Cut( sal_Bool bRemove )
|*
|* SwSectionFrm::Paste()
|*
-|* Ersterstellung AMA 04. Dec. 97
-|* Letzte Aenderung AMA 04. Dec. 97
-|*
|*************************************************************************/
void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
{
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetUpper(),
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
PROTOCOL( this, PROT_PASTE, 0, GetUpper() )
@@ -455,9 +444,6 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|* Zunaechst werden uebergeordnete Bereiche immer aufgebrochen,
|* spaeter koennte man es einstellbar machen.
|*
-|* Ersterstellung AMA 12. Dec. 97
-|* Letzte Aenderung AMA 12. Dec. 97
-|*
|*************************************************************************/
sal_Bool SwSectionFrm::HasToBreak( const SwFrm* pFrm ) const
@@ -484,9 +470,6 @@ sal_Bool SwSectionFrm::HasToBreak( const SwFrm* pFrm ) const
|*
|* SwSectionFrm::MergeNext()
|*
-|* Ersterstellung AMA 04. Dec. 97
-|* Letzte Aenderung AMA 04. Dec. 97
-|*
|* Verschmilzt zwei SectionFrms, falls es sich um den
|* gleichen Bereich handelt.
|* Notwendig kann dies sein, wenn ein (Unter-)Bereich geloescht wird, der
@@ -533,9 +516,6 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
|*
|* SwSectionFrm::SplitSect()
|*
-|* Ersterstellung AMA 29. Apr. 99
-|* Letzte Aenderung AMA 29. Apr. 99
-|*
|* Zerteilt einen SectionFrm in zwei Teile, der zweite Teil beginnt mit dem
|* uebergebenen Frame.
|* Benoetigt wird dies beim Einfuegen eines inneren Bereichs, weil innerhalb
@@ -546,7 +526,7 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
sal_Bool SwSectionFrm::SplitSect( SwFrm* pFrm, sal_Bool bApres )
{
- ASSERT( pFrm, "SplitSect: Why?" );
+ OSL_ENSURE( pFrm, "SplitSect: Why?" );
SwFrm* pOther = bApres ? pFrm->FindNext() : pFrm->FindPrev();
if( !pOther )
return sal_False;
@@ -555,7 +535,7 @@ sal_Bool SwSectionFrm::SplitSect( SwFrm* pFrm, sal_Bool bApres )
return sal_False;
// Den Inhalt zur Seite stellen
SwFrm* pSav = ::SaveCntnt( this, bApres ? pOther : pFrm );
- ASSERT( pSav, "SplitSect: What's on?" );
+ OSL_ENSURE( pSav, "SplitSect: What's on?" );
if( pSav ) // Robust
{ // Einen neuen SctFrm anlegen, nicht als Follow/Master
SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection() );
@@ -589,9 +569,6 @@ sal_Bool SwSectionFrm::SplitSect( SwFrm* pFrm, sal_Bool bApres )
|*
|* SwSectionFrm::MoveCntntAndDelete()
|*
-|* Ersterstellung AMA 29. Jan 99
-|* Letzte Aenderung AMA 29. Jan 99
-|*
|* MoveCntnt wird zur Zerstoerung eines SectionFrms wg. Aufhebung oder
|* Verstecken des Bereichs gerufen, um den Inhalt umzuhaengen.
|* Wenn der SectionFrm keinen anderen aufbrach, so wird der Inhalt in
@@ -775,7 +752,7 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, sal_Bool bSave )
// jetzt koennen eventuell zwei Teile des uebergeordneten Bereich verschmelzen
if( pPrvSct && !pPrvSct->IsJoinLocked() )
{
- ASSERT( pNxtSct, "MoveCntnt: No Merge" );
+ OSL_ENSURE( pNxtSct, "MoveCntnt: No Merge" );
pPrvSct->MergeNext( pNxtSct );
}
}
@@ -786,7 +763,9 @@ void SwSectionFrm::MakeAll()
return;
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
+#endif
if( !bValidPos )
{
if( GetUpper() )
@@ -839,7 +818,7 @@ void SwSectionFrm::MakeAll()
sal_Bool SwSectionFrm::ShouldBwdMoved( SwLayoutFrm *, sal_Bool , sal_Bool & )
{
- ASSERT( sal_False, "Hups, wo ist meine Tarnkappe?" );
+ OSL_ENSURE( sal_False, "Hups, wo ist meine Tarnkappe?" );
return sal_False;
}
@@ -939,9 +918,6 @@ sal_Bool SwSectionFrm::CalcMinDiff( SwTwips& rMinDiff ) const
*
* SwSectionFrm::CollectEndnotes( )
*
- * Ersterstellung AMA 03. Nov 99
- * Letzte Aenderung AMA 03. Nov 99
- *
* CollectEndnotes looks for endnotes in the sectionfrm and his follows,
* the endnotes will cut off the layout and put into the array.
* If the first endnote is not a master-SwFtnFrm, the whole sectionfrm
@@ -956,7 +932,7 @@ SwFtnFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, sal_Bool &rbEmpty,
SwSectionFrm* pSect = rbEmpty ? rpSect->GetFollow() : rpSect;
while( pSect )
{
- ASSERT( (pSect->Lower() && pSect->Lower()->IsColumnFrm()) || pSect->GetUpper()->IsFtnFrm(),
+ OSL_ENSURE( (pSect->Lower() && pSect->Lower()->IsColumnFrm()) || pSect->GetUpper()->IsFtnFrm(),
"InsertEndnotes: Where's my column?" );
// i73332: Columned section in endnote
@@ -1025,9 +1001,9 @@ void lcl_ColumnRefresh( SwSectionFrm* pSect, sal_Bool bFollow )
void SwSectionFrm::CollectEndnotes( SwLayouter* pLayouter )
{
- ASSERT( IsColLocked(), "CollectEndnotes: You love the risk?" );
+ OSL_ENSURE( IsColLocked(), "CollectEndnotes: You love the risk?" );
// i73332: Section in footnode does not have columns!
- ASSERT( (Lower() && Lower()->IsColumnFrm()) || GetUpper()->IsFtnFrm(), "Where's my column?" );
+ OSL_ENSURE( (Lower() && Lower()->IsColumnFrm()) || GetUpper()->IsFtnFrm(), "Where's my column?" );
SwSectionFrm* pSect = this;
SwFtnFrm* pFtn;
@@ -1152,7 +1128,7 @@ void SwSectionFrm::SimpleFormat()
{
if ( IsJoinLocked() || IsColLocked() )
return;
- // ASSERT( pFollow, "SimpleFormat: Follow required" );
+ // OSL_ENSURE( pFollow, "SimpleFormat: Follow required" );
LockJoin();
SWRECTFN( this )
if( GetPrev() || GetUpper() )
@@ -1323,8 +1299,6 @@ class ExtraFormatToPositionObjs
|* SwSectionFrm::Format()
|*
|* Beschreibung: "Formatiert" den Frame; Frm und PrtArea.
-|* Ersterstellung AMA 03. Dec. 97
-|* Letzte Aenderung MA 09. Oct. 98
|*
|*************************************************************************/
@@ -1332,8 +1306,10 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ),
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ),
"SectionFrm without Section" );
+#endif
bValidSize = bValidPos = bValidPrtArea = sal_True;
return;
}
@@ -1554,8 +1530,6 @@ 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 sal_True ist.
-|* Ersterstellung AMA 07. Jan. 98
-|* Letzte Aenderung AMA 07. Jan. 98
|*
|*************************************************************************/
@@ -1583,7 +1557,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
// SwSectionFrm *pSect = GetUpper()->FindSctFrm();
SwSectionFrm *pSect = FindSctFrm();
sal_Bool bWrongPage = sal_False;
- ASSERT( pSect, "GetNextSctLeaf: Missing SectionFrm" );
+ OSL_ENSURE( pSect, "GetNextSctLeaf: Missing SectionFrm" );
// Hier eine Abkuerzung fuer Bereiche mit Follows,
// dieser kann akzeptiert werden, wenn keine Spalten oder Seiten (ausser Dummyseiten)
@@ -1752,7 +1726,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
pNxt = (SwSectionFrm*)pTmp;
else
{
- ASSERT( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" );
+ OSL_ENSURE( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" );
pNxt = (SwTabFrm*)pTmp;
}
while( !pNxtCntnt && 0 != ( pTmp = pTmp->GetNext() ) )
@@ -1791,8 +1765,6 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
|*
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|* Frame gemoved werden kann.
-|* Ersterstellung AMA 07. Jan. 98
-|* Letzte Aenderung AMA 07. Jan. 98
|*
|*************************************************************************/
@@ -1842,7 +1814,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
// nur ein Spaltenwechsel erfolgen, eine der oberen Abkuerzungen haette
// zuschlagen muessen, ebenso wenn der Bereich einen pPrev hat.
// Jetzt ziehen wir sogar eine leere Spalte in Betracht...
- ASSERT( FindSctFrm(), "GetNextSctLeaf: Missing SectionFrm" );
+ OSL_ENSURE( FindSctFrm(), "GetNextSctLeaf: Missing SectionFrm" );
if( ( IsInTab() && !IsTabFrm() ) || FindFooterOrHeader() )
return pCol;
@@ -2022,9 +1994,6 @@ sal_Bool SwSectionFrm::Growable() const
|*
|* SwSectionFrm::_Grow(), _Shrink()
|*
-|* Ersterstellung AMA 14. Jan. 98
-|* Letzte Aenderung AMA 14. Jan. 98
-|*
|*************************************************************************/
SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst )
@@ -2178,7 +2147,6 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
long nPrtHeight = (Prt().*fnRect->fnGetHeight)() - nDist;
(Prt().*fnRect->fnSetHeight)( nPrtHeight );
- SwTwips nReal = 0;
// We do not allow a section frame to shrink the its upper
// footer frame. This is because in the calculation of a
// footer frame, the content of the section frame is _not_
@@ -2194,7 +2162,7 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
// would cause the top of the section frame to overlap with the
// fly frame again, this would result in a perfect loop.
if( GetUpper() && !GetUpper()->IsFooterFrm() )
- nReal = GetUpper()->Shrink( nDist, bTst );
+ GetUpper()->Shrink( nDist, bTst );
if( Lower() && Lower()->IsColumnFrm() && Lower()->GetNext() )
{
@@ -2228,9 +2196,6 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
|*
|* SwSectionFrm::MoveAllowed()
|*
-|* Ersterstellung MA 08. Oct. 98
-|* Letzte Aenderung MA 08. Oct. 98
-|*
|* Wann sind Frms innerhalb eines SectionFrms moveable?
|* Wenn sie noch nicht in der letzten Spalte des SectionFrms sind,
|* wenn es einen Follow gibt,
@@ -2313,7 +2278,7 @@ SwFrm* SwFrm::_GetIndPrev() const
// could be an empty section frame. The caller has to assure, that the
// frame has no direct previous frame or only empty section frames as
// previous frames.
- ASSERT( /*!pPrev &&*/ IsInSct(), "Why?" );
+ OSL_ENSURE( /*!pPrev &&*/ IsInSct(), "Why?" );
// <--
const SwFrm* pSct = GetUpper();
if( !pSct )
@@ -2327,8 +2292,8 @@ SwFrm* SwFrm::_GetIndPrev() const
const SwFrm* pCol = GetUpper()->GetUpper()->GetPrev();
while( pCol )
{
- ASSERT( pCol->IsColumnFrm(), "GetIndPrev(): ColumnFrm expected" );
- ASSERT( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(),
+ OSL_ENSURE( pCol->IsColumnFrm(), "GetIndPrev(): ColumnFrm expected" );
+ OSL_ENSURE( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(),
"GetIndPrev(): Where's the body?");
if( ((SwLayoutFrm*)((SwLayoutFrm*)pCol)->Lower())->Lower() )
return NULL;
@@ -2345,7 +2310,7 @@ SwFrm* SwFrm::_GetIndPrev() const
SwFrm* SwFrm::_GetIndNext()
{
- ASSERT( !pNext && IsInSct(), "Why?" );
+ OSL_ENSURE( !pNext && IsInSct(), "Why?" );
SwFrm* pSct = GetUpper();
if( !pSct )
return NULL;
@@ -2357,8 +2322,8 @@ SwFrm* SwFrm::_GetIndNext()
SwFrm* pCol = GetUpper()->GetUpper()->GetNext();
while( pCol )
{
- ASSERT( pCol->IsColumnFrm(), "GetIndNext(): ColumnFrm expected" );
- ASSERT( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(),
+ OSL_ENSURE( pCol->IsColumnFrm(), "GetIndNext(): ColumnFrm expected" );
+ OSL_ENSURE( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(),
"GetIndNext(): Where's the body?");
if( ((SwLayoutFrm*)((SwLayoutFrm*)pCol)->Lower())->Lower() )
return NULL;
@@ -2430,9 +2395,6 @@ void SwSectionFrm::CalcEndAtEndFlag()
|*
|* SwSectionFrm::Modify()
|*
-|* Ersterstellung MA 08. Oct. 98
-|* Letzte Aenderung MA 08. Oct. 98
-|*
|*************************************************************************/
void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
@@ -2584,7 +2546,7 @@ void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
}
}
-/*-----------------09.06.99 14:58-------------------
+/*--------------------------------------------------
* SwSectionFrm::ToMaximize(..): A follow or a ftncontainer at the end of the
* page causes a maximal Size of the sectionframe.
* --------------------------------------------------*/
@@ -2617,7 +2579,7 @@ sal_Bool SwSectionFrm::ToMaximize( sal_Bool bCheckFollow ) const
return bRet;
}
-/*-----------------09.06.99 15:07-------------------
+/*--------------------------------------------------
* sal_Bool SwSectionFrm::ContainsFtnCont()
* checks every Column for FtnContFrms.
* --------------------------------------------------*/
@@ -2629,7 +2591,7 @@ SwFtnContFrm* SwSectionFrm::ContainsFtnCont( const SwFtnContFrm* pCont ) const
if( pCont )
{
pLay = pCont->FindFtnBossFrm( 0 );
- ASSERT( IsAnLower( pLay ), "ConatainsFtnCont: Wrong FtnContainer" );
+ OSL_ENSURE( IsAnLower( pLay ), "ConatainsFtnCont: Wrong FtnContainer" );
pLay = (SwLayoutFrm*)pLay->GetNext();
}
else if( Lower() && Lower()->IsColumnFrm() )
@@ -2640,11 +2602,11 @@ SwFtnContFrm* SwSectionFrm::ContainsFtnCont( const SwFtnContFrm* pCont ) const
{
if( pLay->Lower() && pLay->Lower()->GetNext() )
{
- ASSERT( pLay->Lower()->GetNext()->IsFtnContFrm(),
+ OSL_ENSURE( pLay->Lower()->GetNext()->IsFtnContFrm(),
"ToMaximize: Unexspected Frame" );
pRet = (SwFtnContFrm*)pLay->Lower()->GetNext();
}
- ASSERT( !pLay->GetNext() || pLay->GetNext()->IsLayoutFrm(),
+ OSL_ENSURE( !pLay->GetNext() || pLay->GetNext()->IsLayoutFrm(),
"ToMaximize: ColFrm exspected" );
pLay = (SwLayoutFrm*)pLay->GetNext();
}
@@ -2662,7 +2624,7 @@ void SwSectionFrm::InvalidateFtnPos()
}
}
-/*-----------------18.03.99 10:37-------------------
+/*--------------------------------------------------
* SwSectionFrm::Undersize() liefert den Betrag, um den der Bereich gern
* groesser waere, wenn in ihm Undersized TxtFrms liegen, ansonsten Null.
* Das Undersized-Flag wird ggf. korrigiert.
@@ -2716,7 +2678,7 @@ void SwSectionFrm::CalcFtnCntnt()
}
}
-/* -----------------09.02.99 14:26-------------------
+/* --------------------------------------------------
* Wenn ein SectionFrm leerlaeuft, z.B. weil sein Inhalt die Seite/Spalte wechselt,
* so wird er nicht sofort zerstoert (es koennte noch jemand auf dem Stack einen Pointer
* auf ihn halten), sondern er traegt sich in eine Liste am RootFrm ein, die spaeter
@@ -2740,12 +2702,12 @@ void SwRootFrm::InsertEmptySct( SwSectionFrm* pDel )
void SwRootFrm::_DeleteEmptySct()
{
- ASSERT( pDestroy, "Keine Liste, keine Kekse" );
+ OSL_ENSURE( pDestroy, "Keine Liste, keine Kekse" );
while( pDestroy->Count() )
{
SwSectionFrm* pSect = (*pDestroy)[0];
pDestroy->Remove( sal_uInt16(0) );
- ASSERT( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
+ OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
"DeleteEmptySct: Locked SectionFrm" );
if( !pSect->Frm().HasArea() && !pSect->ContainsCntnt() )
{
@@ -2765,20 +2727,20 @@ void SwRootFrm::_DeleteEmptySct()
}
}
else {
- ASSERT( pSect->GetSection(), "DeleteEmptySct: Halbtoter SectionFrm?!" );
+ OSL_ENSURE( pSect->GetSection(), "DeleteEmptySct: Halbtoter SectionFrm?!" );
}
}
}
void SwRootFrm::_RemoveFromList( SwSectionFrm* pSct )
{
- ASSERT( pDestroy, "Where's my list?" );
+ OSL_ENSURE( pDestroy, "Where's my list?" );
sal_uInt16 nPos;
if( pDestroy->Seek_Entry( pSct, &nPos ) )
pDestroy->Remove( nPos );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool SwRootFrm::IsInDelList( SwSectionFrm* pSct ) const
{
@@ -2798,3 +2760,4 @@ bool SwSectionFrm::IsBalancedSection() const
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx
index 898581d3d870..b55a7f43dd0a 100644
--- a/sw/source/core/layout/softpagebreak.cxx
+++ b/sw/source/core/layout/softpagebreak.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -154,3 +155,4 @@ bool SwTableLine::hasSoftPageBreak() const
return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/sortedobjs.cxx b/sw/source/core/layout/sortedobjs.cxx
index c1c002c3f414..e984d278f4e7 100644
--- a/sw/source/core/layout/sortedobjs.cxx
+++ b/sw/source/core/layout/sortedobjs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,5 @@ sal_uInt32 SwSortedObjs::ListPosOf( const SwAnchoredObject& _rAnchoredObj ) cons
{
return mpImpl->ListPosOf( _rAnchoredObj );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/sortedobjsimpl.cxx b/sw/source/core/layout/sortedobjsimpl.cxx
index f0dc3f719107..10ed749e840b 100644
--- a/sw/source/core/layout/sortedobjsimpl.cxx
+++ b/sw/source/core/layout/sortedobjsimpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,7 +67,7 @@ SwAnchoredObject* SwSortedObjsImpl::operator[]( sal_uInt32 _nIndex )
if ( _nIndex >= Count() )
{
- ASSERT( false, "<SwSortedObjsImpl::operator[]> - index out of range" );
+ OSL_ENSURE( false, "<SwSortedObjsImpl::operator[]> - index out of range" );
}
else
{
@@ -219,7 +220,7 @@ bool SwSortedObjsImpl::Insert( SwAnchoredObject& _rAnchoredObj )
{
// list already contains object
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwSortedObjsImpl::Insert()> - already contains object" );
#endif
return true;
@@ -249,7 +250,7 @@ bool SwSortedObjsImpl::Remove( SwAnchoredObject& _rAnchoredObj )
// object not found.
bRet = false;
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwSortedObjsImpl::Remove()> - object not found" );
#endif
}
@@ -274,7 +275,7 @@ bool SwSortedObjsImpl::Update( SwAnchoredObject& _rAnchoredObj )
if ( !Contains( _rAnchoredObj ) )
{
// given anchored object not found in list
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwSortedObjsImpl::Update(..) - sorted list doesn't contain given anchored object" );
return false;
}
@@ -311,3 +312,4 @@ sal_uInt32 SwSortedObjsImpl::ListPosOf( const SwAnchoredObject& _rAnchoredObj )
return nRetLstPos;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 512c45a67b41..56b65c7bfd48 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -216,7 +217,7 @@ void SwFrm::SetRightLeftMargins( long nRight, long nLeft)
const sal_uInt16 nMinVertCellHeight = 1135;
-/*-----------------11.9.2001 11:11------------------
+/*--------------------------------------------------
* SwFrm::CheckDirChange(..)
* checks the layout direction and
* invalidates the lower frames rekursivly, if necessary.
@@ -317,7 +318,7 @@ void SwFrm::CheckDirChange()
}
}
-/*-----------------13.9.2002 11:11------------------
+/*--------------------------------------------------
* SwFrm::GetFrmAnchorPos(..)
* returns the position for anchors based on frame direction
* --------------------------------------------------*/
@@ -363,9 +364,6 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
|*
|* SwFrm::~SwFrm()
|*
-|* Ersterstellung MA 02. Mar. 94
-|* Letzte Aenderung MA 25. Jun. 95
-|*
|*************************************************************************/
@@ -381,7 +379,7 @@ SwFrm::~SwFrm()
ViewShell *pVSh = pRootFrm->GetCurrShell();
if( pVSh && pVSh->Imp() )
{
- ASSERT( !GetLower(), "Lowers should be dispose already!" );
+ OSL_ENSURE( !GetLower(), "Lowers should be dispose already!" );
pVSh->Imp()->DisposeAccessibleFrm( this );
}
}
@@ -399,7 +397,7 @@ SwFrm::~SwFrm()
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
- ASSERT( pContact,
+ OSL_ENSURE( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
{
@@ -411,7 +409,7 @@ SwFrm::~SwFrm()
delete pDrawObjs;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// JP 15.10.2001: for detection of access to deleted frames
pDrawObjs = (SwSortedObjs*)0x33333333;
#endif
@@ -433,8 +431,6 @@ SwFrmFmt * SwLayoutFrm::GetFmt()
/*************************************************************************
|*
|* SwLayoutFrm::SetFrmFmt()
-|* Ersterstellung MA 22. Apr. 93
-|* Letzte Aenderung MA 02. Nov. 94
|*
|*************************************************************************/
@@ -506,9 +502,6 @@ SwCntntFrm::~SwCntntFrm()
|*
|* SwLayoutFrm::~SwLayoutFrm
|*
-|* Ersterstellung AK 28-Feb-1991
-|* Letzte Aenderung MA 11. Jan. 95
-|*
|*************************************************************************/
@@ -538,7 +531,7 @@ SwLayoutFrm::~SwLayoutFrm()
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
- ASSERT( pContact,
+ OSL_ENSURE( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
{
@@ -571,7 +564,7 @@ SwLayoutFrm::~SwLayoutFrm()
SdrObject* pSdrObj = pAnchoredObj->DrawObj();
SwDrawContact* pContact =
static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
- ASSERT( pContact,
+ OSL_ENSURE( pContact,
"<SwFrm::~SwFrm> - missing contact for drawing object" );
if ( pContact )
{
@@ -600,9 +593,6 @@ SwLayoutFrm::~SwLayoutFrm()
|*
|* SwFrm::PaintArea()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The paintarea is the area, in which the content of a frame is allowed
|* to be displayed. This region could be larger than the printarea (Prt())
|* of the upper, it includes e.g. often the margin of the page.
@@ -640,7 +630,7 @@ const SwRect SwFrm::PaintArea() const
else
nTmpRight = (pNxt->Frm().*fnRect->fnGetRight)();
}
- ASSERT( pTmp, "PaintArea lost in time and space" );
+ OSL_ENSURE( pTmp, "PaintArea lost in time and space" );
if( pTmp->IsPageFrm() || pTmp->IsFlyFrm() ||
pTmp->IsCellFrm() || pTmp->IsRowFrm() || //nobody leaves a table!
pTmp->IsRootFrm() )
@@ -704,9 +694,6 @@ const SwRect SwFrm::PaintArea() const
|*
|* SwFrm::UnionFrm()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The unionframe is the framearea (Frm()) of a frame expanded by the
|* printarea, if there's a negative margin at the left or right side.
|*
@@ -766,3 +753,4 @@ const SwRect SwFrm::UnionFrm( sal_Bool bBorder ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/swselectionlist.cxx b/sw/source/core/layout/swselectionlist.cxx
index 5fbaa2a02d75..e2997db0a6bc 100644
--- a/sw/source/core/layout/swselectionlist.cxx
+++ b/sw/source/core/layout/swselectionlist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,3 +93,4 @@ bool SwSelectionList::checkContext( const SwFrm* pCheck )
return pContext == pCheck;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 90a3656d1ab7..5ef74e797c23 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,9 +92,6 @@ using namespace ::com::sun::star;
|*
|* SwTabFrm::SwTabFrm(), ~SwTabFrm()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 30. May. 96
-|*
|*************************************************************************/
SwTabFrm::SwTabFrm( SwTable &rTab ):
SwLayoutFrm( rTab.GetFrmFmt() ),
@@ -124,7 +122,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ):
else
delete pNew;
}
- ASSERT( Lower() && Lower()->IsRowFrm(), "SwTabFrm::SwTabFrm: No rows." );
+ OSL_ENSURE( Lower() && Lower()->IsRowFrm(), "SwTabFrm::SwTabFrm: No rows." );
}
SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
@@ -175,9 +173,6 @@ SwTabFrm::~SwTabFrm()
|*
|* SwTabFrm::JoinAndDelFollows()
|*
-|* Ersterstellung MA 30. May. 96
-|* Letzte Aenderung MA 30. May. 96
-|*
|*************************************************************************/
void SwTabFrm::JoinAndDelFollows()
{
@@ -193,13 +188,10 @@ void SwTabFrm::JoinAndDelFollows()
|*
|* SwTabFrm::RegistFlys()
|*
-|* Ersterstellung MA 08. Jul. 93
-|* Letzte Aenderung MA 27. Jan. 99
-|*
|*************************************************************************/
void SwTabFrm::RegistFlys()
{
- ASSERT( Lower() && Lower()->IsRowFrm(), "Keine Zeilen." );
+ OSL_ENSURE( Lower() && Lower()->IsRowFrm(), "Keine Zeilen." );
SwPageFrm *pPage = FindPageFrm();
if ( pPage )
@@ -270,7 +262,7 @@ SwTwips lcl_GetHeightOfRows( const SwFrm* pStart, long nCount )
//
SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, bool bRowSpanLine )
{
- ASSERT( rTmpRow.IsRowFrm(), "No row frame to copy for FollowFlowLine" )
+ OSL_ENSURE( rTmpRow.IsRowFrm(), "No row frame to copy for FollowFlowLine" );
const SwRowFrm& rRow = (SwRowFrm&)rTmpRow;
rTab.SetFollowFlowLine( sal_True );
@@ -292,7 +284,7 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
if ( !_pPageFrm )
{
_pPageFrm = _rLayoutFrm.FindPageFrm();
- ASSERT( _pPageFrm,
+ OSL_ENSURE( _pPageFrm,
"<lcl_InvalidateLowerObjs(..)> - missing page frame -> no move of lower objects out of range" );
if ( !_pPageFrm )
{
@@ -459,7 +451,7 @@ void lcl_MoveRowContent( SwRowFrm& rSourceLine, SwRowFrm& rDestLine )
while ( pTmpDestRow->GetNext() )
pTmpDestRow = (SwRowFrm*)pTmpDestRow->GetNext();
- ASSERT( pTmpDestRow->GetFollowRow() == pTmpSourceRow, "Knoten in der Tabelle" )
+ OSL_ENSURE( pTmpDestRow->GetFollowRow() == pTmpSourceRow, "Knoten in der Tabelle" );
lcl_MoveRowContent( *pTmpSourceRow, *pTmpDestRow );
pTmpDestRow->SetFollowRow( pTmpSourceRow->GetFollowRow() );
@@ -649,7 +641,7 @@ void lcl_PostprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine )
if ( NULL != pRowFrm->GetPrev() && !pRowFrm->ContainsCntnt() )
{
- ASSERT( pRowFrm->GetFollowRow(), "Deleting row frame without follow" )
+ OSL_ENSURE( pRowFrm->GetFollowRow(), "Deleting row frame without follow" );
// The footnotes have to be moved:
lcl_MoveFootnotes( rTab, *rTab.GetFollow(), *pRowFrm );
@@ -733,32 +725,6 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
}
//
- // TODO: e.g., for i71806: What shall we do if the table already
- // exceeds its upper? I think we have to adjust the heights of the
- // table, rLastRow and all cells in rLastRow
- //
- /*SwTwips nDistanceToUpperPrtBottom =
- (rTab.Frm().*fnRect->fnBottomDist)( (rTab.GetUpper()->*fnRect->fnGetPrtBottom)());
-
- if ( nDistanceToUpperPrtBottom < 0 )
- {
- (rTab.Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
- (rTab.Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
- (rLastLine.Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
- (rLastLine.Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
- SwFrm* pTmpCell = rLastLine.Lower();
- while ( pTmpCell )
- {
- (pTmpCell->Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
- (pTmpCell->Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
- pTmpCell = pTmpCell->GetNext();
- }
- }*/
-
- //
// Do the recalculation
//
lcl_RecalcRow( rLastLine, LONG_MAX );
@@ -943,9 +909,9 @@ bool SwTabFrm::RemoveFollowFlowLine()
// find last row in master
SwFrm* pLastLine = GetLastLower();
- ASSERT( HasFollowFlowLine() &&
+ OSL_ENSURE( HasFollowFlowLine() &&
pFollowFlowLine &&
- pLastLine, "There should be a flowline in the follow" )
+ pLastLine, "There should be a flowline in the follow" );
// We have to reset the flag here, because lcl_MoveRowContent
// calls a GrowFrm(), which has a different bahavior if
@@ -962,7 +928,6 @@ bool SwTabFrm::RemoveFollowFlowLine()
// NEW TABLES
// If a row span follow flow line is removed, we want to move the whole span
// to the master:
- SwTwips nGrow = 0;
long nRowsToMove = lcl_GetMaximumLayoutRowSpan( *pFollowFlowLine );
if ( nRowsToMove > 1 )
@@ -970,6 +935,7 @@ bool SwTabFrm::RemoveFollowFlowLine()
SWRECTFN( this )
SwFrm* pRow = pFollowFlowLine->GetNext();
SwFrm* pInsertBehind = GetLastLower();
+ SwTwips nGrow = 0;
while ( pRow && nRowsToMove-- > 1 )
{
@@ -1043,18 +1009,12 @@ bool lcl_FindSectionsInRow( const SwRowFrm& rRow )
|*
|* SwTabFrm::Split(), Join()
|*
-|* Ersterstellung MA 03. Jun. 93
-|* Letzte Aenderung MA 03. Sep. 96
-|*
|*************************************************************************/
bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep )
{
bool bRet = true;
SWRECTFN( this )
- //ASSERT( bVert ? nCutPos >= Frm().Left() &&
- // nCutPos <= Frm().Left() + Frm().Width() :
- // nCutPos >= Frm().Top() && nCutPos <= Frm().Bottom(), "SplitLine out of table." );
// --> OD 2004-10-14 #i26745# - format row and cell frames of table
{
@@ -1131,7 +1091,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
// At least one more non-heading row has to stay in this table in
// order to avoid loops:
//
- ASSERT( !GetIndPrev(), "Table is supposed to be at beginning" )
+ OSL_ENSURE( !GetIndPrev(), "Table is supposed to be at beginning" );
bKeepNextRow = true;
}
else if ( !GetIndPrev() && nRepeat == nRowCount )
@@ -1409,10 +1369,9 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
bool SwTabFrm::Join()
{
- ASSERT( !HasFollowFlowLine(), "Joining follow flow line" )
+ OSL_ENSURE( !HasFollowFlowLine(), "Joining follow flow line" );
SwTabFrm *pFoll = GetFollow();
- SwTwips nHeight = 0; //Gesamthoehe der eingefuegten Zeilen als Return.
if ( !pFoll->IsJoinLocked() )
{
@@ -1425,6 +1384,7 @@ bool SwTabFrm::Join()
SwFrm* pPrv = GetLastLower();
+ SwTwips nHeight = 0; //Gesamthoehe der eingefuegten Zeilen als Return.
while ( pRow )
{
pNxt = pRow->GetNext();
@@ -1451,9 +1411,6 @@ bool SwTabFrm::Join()
|*
|* SwTabFrm::MakeAll()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 10. Apr. 97
-|*
|*************************************************************************/
void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
{
@@ -1591,7 +1548,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
// to format the floating screen objects
// --> OD 2005-05-03 #i46941# - frame has to be valid
// Note: frame could be invalid after calling its format, if it's locked.
- ASSERT( !pCnt->IsTxtFrm() ||
+ OSL_ENSURE( !pCnt->IsTxtFrm() ||
pCnt->IsValid() ||
static_cast<SwTxtFrm*>(pCnt)->IsJoinLocked(),
"<lcl_CalcLowers(..)> - text frame invalid and not locked." );
@@ -1619,7 +1576,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
}
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in lcl_CalcLowers" )
+ OSL_ENSURE( false, "LoopControl in lcl_CalcLowers" );
#endif
}
}
@@ -1709,9 +1666,9 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
if ( ++nLoopControlRuns_2 > nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( 0 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 1!" );
- ASSERT( 1 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 2!!" );
- ASSERT( 2 > nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 3!!!" );
+ OSL_ENSURE( 0 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 1!" );
+ OSL_ENSURE( 1 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 2!!" );
+ OSL_ENSURE( 2 > nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 3!!!" );
#endif
rRow.ValidateThisAndAllLowers( nLoopControlStage_2++ );
nLoopControlRuns_2 = 0;
@@ -1758,9 +1715,9 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
if ( ++nLoopControlRuns_1 > nLoopControlMax )
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( 0 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 1!" );
- ASSERT( 1 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 2!!" );
- ASSERT( 2 > nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 3!!!" );
+ OSL_ENSURE( 0 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 1!" );
+ OSL_ENSURE( 1 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 2!!" );
+ OSL_ENSURE( 2 > nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 3!!!" );
#endif
rRow.ValidateThisAndAllLowers( nLoopControlStage_1++ );
nLoopControlRuns_1 = 0;
@@ -1895,8 +1852,8 @@ void SwTabFrm::MakeAll()
if ( HasFollow() )
{
SwTabFrm* pFollowFrm = (SwTabFrm*)GetFollow();
- ASSERT( !pFollowFrm->IsJoinLocked() || !pFollowFrm->IsRebuildLastLine(),
- "SwTabFrm::MakeAll for master while follow is in RebuildLastLine()" )
+ OSL_ENSURE( !pFollowFrm->IsJoinLocked() || !pFollowFrm->IsRebuildLastLine(),
+ "SwTabFrm::MakeAll for master while follow is in RebuildLastLine()" );
if ( pFollowFrm->IsJoinLocked() && pFollowFrm->IsRebuildLastLine() )
return;
}
@@ -2074,6 +2031,11 @@ void SwTabFrm::MakeAll()
pPre->GetAttrSet()->GetKeep().GetValue()) )
{
bCalcLowers = sal_True;
+ // --> OD 2009-03-06 #i99267#
+ // reset <bSplit> after forward move to assure that follows
+ // can be joined, if further space is available.
+ bSplit = sal_False;
+ // <--
}
}
@@ -2103,7 +2065,6 @@ void SwTabFrm::MakeAll()
delete pAccess;
bCalcLowers |= pLayout->Resize(
pLayout->GetBrowseWidthByTabFrm( *this ), sal_False );
-// GetFmt()->GetDoc()->GetDocShell()->IsReadOnly() ? sal_False : sal_True );
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
@@ -2175,15 +2136,6 @@ void SwTabFrm::MakeAll()
// Thus, find next content, table or section
// and, if a section is found, get its first
// content.
-// SwFrm *pNxt = FindNextCnt();
-// if( pNxt && pNxt->IsInTab() )
-// pNxt = pNxt->FindTabFrm();
-// if ( pNxt )
-// {
-// pNxt->Calc();
-// if ( !GetNext() )
-// bValidPos = sal_False;
-// }
if ( 0 != lcl_FormatNextCntntForKeep( this ) && !GetNext() )
{
bValidPos = sal_False;
@@ -2442,9 +2394,8 @@ void SwTabFrm::MakeAll()
// We better avoid splitting of a row frame if we are inside a columned
// section which has a height of 0, because this is not growable and thus
// all kinds of unexpected things could happen.
- const SwSectionFrm* pTmpSct = 0;
if ( IsInSct() &&
- (pTmpSct = FindSctFrm())->Lower()->IsColumnFrm() &&
+ (FindSctFrm())->Lower()->IsColumnFrm() &&
0 == (GetUpper()->Frm().*fnRect->fnGetHeight)() )
{
bTryToSplit = false;
@@ -2533,7 +2484,7 @@ void SwTabFrm::MakeAll()
--nUnSplitted;
// --> FME 2004-06-09 #i29771# Two tries to split the table:
- // If an error occured during splitting. We start a second
+ // If an error occurred during splitting. We start a second
// try, this time without splitting of table rows.
if ( bSplitError )
{
@@ -2714,7 +2665,7 @@ void SwTabFrm::MakeAll()
#if OSL_DEBUG_LEVEL > 1
else
{
- ASSERT( false, "debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910" );
+ OSL_ENSURE( false, "debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910" );
}
#endif
// <--
@@ -2744,8 +2695,6 @@ void SwTabFrm::MakeAll()
|*
|* Beschreibung: Berechnet die Offsets, die durch FlyFrames
|* entstehen.
-|* Ersterstellung MA/MIB 14. Apr. 99
-|* Letzte Aenderung
|*
|*************************************************************************/
sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
@@ -2797,19 +2746,6 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
// E.g., it could happen, that the fly frame is still registered
// at the page frame, the table is on, but it's anchor character
// text frame has already changed its page.
- //if ( WEIT_WECH != (pFly->Frm().*fnRect->fnGetTop)() &&
- // pFly->IsFlyAtCntFrm() && aFlyRect.IsOver( aRect ) &&
- // // OD 25.02.2003 #i9040# - use '<=' instead of '<'
- // (*fnRect->fnYDiff)(
- // (pFly->GetAnchorFrm()->Frm().*fnRect->fnGetBottom)(),
- // (Frm().*fnRect->fnGetTop)() ) <= 0 &&
- // !IsAnLower( pFly ) && !pFly->IsAnLower( this ) &&
- // ( !pMyFly || pMyFly->IsAnLower( pFly ) ) &&
- // pPage->GetPhyPageNum() >=
- // pFly->GetAnchorFrm()->FindPageFrm()->GetPhyPageNum() &&
- // // anchor should be in same page body/header/footer
- // ( pFly->GetAnchorFrm()->FindFooterOrHeader() ==
- // FindFooterOrHeader() ) )
const SwTxtFrm* pAnchorCharFrm = pFly->FindAnchorCharFrm();
bool bConsiderFly =
// --> OD 2005-04-06 #i46807# - do not consider invalid
@@ -2904,13 +2840,11 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
|*
|* Beschreibung: "Formatiert" den Frame; Frm und PrtArea
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 18. Jun. 97
|*
|*************************************************************************/
void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
{
- ASSERT( pAttrs, "TabFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "TabFrm::Format, pAttrs ist 0." );
SWRECTFN( this )
if ( !bValidSize )
@@ -3084,11 +3018,6 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
// OD 10.03.2003 #i9040# - consider right line attribute.
nRightSpacing = Max( nRightSpacing, ( nRightOffset + nRightLine ) );
}
- // OD 10.03.2003 #i9040# - do not hold wished table width.
- /*
- if ( !pAttrs->GetLRSpace().GetRight() )
- nRight = Max( nRight, nMax - (nWish + nLeft + nRight));
- */
}
break;
case text::HoriOrientation::LEFT_AND_WIDTH:
@@ -3115,7 +3044,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
}
break;
default:
- ASSERT( sal_False, "Ungueltige orientation fuer Table." );
+ OSL_ENSURE( sal_False, "Ungueltige orientation fuer Table." );
}
// --> OD 2004-07-15 #i26250# - extend bottom printing area, if table
@@ -3177,9 +3106,6 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
|*
|* SwTabFrm::GrowFrm()
|*
-|* Ersterstellung MA 12. Mar. 93
-|* Letzte Aenderung MA 23. Sep. 96
-|*
|*************************************************************************/
SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
@@ -3205,10 +3131,9 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
pFrm = pFrm->GetNext();
}
- long nTmp = 0;
if ( nReal < nDist )
{
- nTmp = GetUpper()->Grow( nDist - ( nReal > 0 ? nReal : 0), bTst, bInfo );
+ long nTmp = GetUpper()->Grow( nDist - ( nReal > 0 ? nReal : 0), bTst, bInfo );
if ( IsRestrictTableGrowth() )
{
@@ -3264,9 +3189,6 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwTabFrm::Modify()
|*
-|* Ersterstellung MA 14. Mar. 93
-|* Letzte Aenderung MA 06. Dec. 96
-|*
|*************************************************************************/
void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
@@ -3299,8 +3221,6 @@ void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
SwPageFrm *pPage = FindPageFrm();
InvalidatePage( pPage );
-// if ( nInvFlags & 0x01 )
-// SetCompletePaint();
if ( nInvFlags & 0x02 )
_InvalidatePrt();
if ( nInvFlags & 0x40 )
@@ -3426,9 +3346,6 @@ void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
|*
|* SwTabFrm::GetInfo()
|*
-|* Ersterstellung MA 06. Dec. 96
-|* Letzte Aenderung MA 26. Jun. 98
-|*
|*************************************************************************/
sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
{
@@ -3460,9 +3377,6 @@ sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const
|*
|* SwTabFrm::FindLastCntnt()
|*
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 15. May. 98
-|*
|*************************************************************************/
SwCntntFrm *SwTabFrm::FindLastCntnt()
{
@@ -3490,10 +3404,10 @@ SwCntntFrm *SwTabFrm::FindLastCntnt()
// Spalten abklappern, dies erledigt SwSectionFrm::FindLastCntnt
if( pRet->IsColBodyFrm() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwSectionFrm* pSect = pRet->FindSctFrm();
- ASSERT( pSect, "Wo kommt denn die Spalte her?")
- ASSERT( IsAnLower( pSect ), "Gespaltene Zelle?" );
+ OSL_ENSURE( pSect, "Wo kommt denn die Spalte her?");
+ OSL_ENSURE( IsAnLower( pSect ), "Gespaltene Zelle?" );
#endif
return pRet->FindSctFrm()->FindLastCntnt();
}
@@ -3502,7 +3416,7 @@ SwCntntFrm *SwTabFrm::FindLastCntnt()
// pRet may be a cell frame without a lower (cell has been split).
// We have to find the last content the hard way:
//
- ASSERT( pRet->IsCellFrm(), "SwTabFrm::FindLastCntnt failed" )
+ OSL_ENSURE( pRet->IsCellFrm(), "SwTabFrm::FindLastCntnt failed" );
const SwFrm* pRow = pRet->GetUpper();
while ( pRow && !pRow->GetUpper()->IsTabFrm() )
pRow = pRow->GetUpper();
@@ -3538,9 +3452,6 @@ SwCntntFrm *SwTabFrm::FindLastCntnt()
|*
|* SwTabFrm::GetLeaf()
|*
-|* Ersterstellung MA 19. Mar. 93
-|* Letzte Aenderung MA 25. Apr. 95
-|*
|*************************************************************************/
SwLayoutFrm *SwTabFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
{
@@ -3563,8 +3474,6 @@ SwLayoutFrm *SwTabFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
|* SwTabFrm::ShouldBwdMoved()
|*
|* Beschreibung Returnwert sagt ob der Frm verschoben werden sollte
-|* Ersterstellung MA 10. Jul. 95
-|* Letzte Aenderung MA 04. Mar. 97
|*
|*************************************************************************/
sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &rReformat )
@@ -3673,13 +3582,10 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
|*
|* SwTabFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 09. Sep. 98
-|*
|*************************************************************************/
void SwTabFrm::Cut()
{
- ASSERT( GetUpper(), "Cut ohne Upper()." );
+ OSL_ENSURE( GetUpper(), "Cut ohne Upper()." );
SwPageFrm *pPage = FindPageFrm();
InvalidatePage( pPage );
@@ -3737,7 +3643,7 @@ void SwTabFrm::Cut()
Remove();
if ( pUp )
{
- ASSERT( !pUp->IsFtnFrm(), "Tabelle in Fussnote." );
+ OSL_ENSURE( !pUp->IsFtnFrm(), "Tabelle in Fussnote." );
SwSectionFrm *pSct = 0;
// --> OD 2006-01-04 #126020# - adjust check for empty section
// --> OD 2006-02-01 #130797# - correct fix #126020#
@@ -3768,17 +3674,14 @@ void SwTabFrm::Cut()
|*
|* SwTabFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 09. Sep. 98
-|*
|*************************************************************************/
void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
{
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetNext() && !GetUpper(),
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
//In den Baum einhaengen.
@@ -3839,9 +3742,6 @@ void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|*
|* SwTabFrm::Prepare()
|*
-|* Created AMA 01/10/02
-|* Last Change AMA 01/10/02
-|*
|*************************************************************************/
void SwTabFrm::Prepare( const PrepareHint eHint, const void *, sal_Bool )
{
@@ -3853,9 +3753,6 @@ void SwTabFrm::Prepare( const PrepareHint eHint, const void *, sal_Bool )
|*
|* SwRowFrm::SwRowFrm(), ~SwRowFrm()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 30. May. 96
-|*
|*************************************************************************/
SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ):
SwLayoutFrm( rLine.GetFrmFmt() ),
@@ -3900,9 +3797,6 @@ SwRowFrm::~SwRowFrm()
|*
|* SwRowFrm::RegistFlys()
|*
-|* Ersterstellung MA 08. Jul. 93
-|* Letzte Aenderung MA 08. Jul. 93
-|*
|*************************************************************************/
void SwRowFrm::RegistFlys( SwPageFrm *pPage )
{
@@ -3913,9 +3807,6 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage )
|*
|* SwRowFrm::Modify()
|*
-|* Ersterstellung MA 12. Nov. 97
-|* Letzte Aenderung MA 12. Nov. 97
-|*
|*************************************************************************/
void SwRowFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
@@ -3960,9 +3851,6 @@ void SwRowFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
|*
|* SwRowFrm::MakeAll()
|*
-|* Ersterstellung MA 01. Mar. 94
-|* Letzte Aenderung MA 01. Mar. 94
-|*
|*************************************************************************/
void SwRowFrm::MakeAll()
{
@@ -3975,9 +3863,6 @@ void SwRowFrm::MakeAll()
|*
|* SwRowFrm::Format()
|*
-|* Ersterstellung MA 13. Mar. 93
-|* Letzte Aenderung MA 20. Jun. 96
-|*
|*************************************************************************/
long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
{
@@ -4187,7 +4072,7 @@ SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm* _pRow,
if ( _pRow->HasFixSize() && !_pRow->IsRowSpanLine() )
{
- ASSERT( ATT_FIX_SIZE == rSz.GetHeightSizeType(), "pRow claims to have fixed size" )
+ OSL_ENSURE( ATT_FIX_SIZE == rSz.GetHeightSizeType(), "pRow claims to have fixed size" );
return rSz.GetHeight();
}
@@ -4331,7 +4216,7 @@ sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow )
void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
{
SWRECTFN( this )
- ASSERT( pAttrs, "SwRowFrm::Format ohne Attrs." );
+ OSL_ENSURE( pAttrs, "SwRowFrm::Format ohne Attrs." );
const sal_Bool bFix = bFixSize;
@@ -4401,8 +4286,8 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
SwClient* pLast;
for ( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsRowFrm(),
- "Non-row frame registered in table line" )
+ OSL_ENSURE( ((SwFrm*)pLast)->IsRowFrm(),
+ "Non-row frame registered in table line" );
SwRowFrm* pRow = (SwRowFrm*)pLast;
// --> OD 2004-11-23 #115759# - do *not* take repeated
// headlines, because during split of table it can be
@@ -4457,11 +4342,11 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
{
bValidSize = sal_True;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( HasFixSize() )
{
const SwFmtFrmSize &rFrmSize = GetFmt()->GetFrmSize();
- ASSERT( rFrmSize.GetSize().Height() > 0, "Hat ihn" );
+ OSL_ENSURE( rFrmSize.GetSize().Height() > 0, "Hat ihn" );
}
#endif
const SwTwips nDiff = (Frm().*fnRect->fnGetHeight)() -
@@ -4506,9 +4391,6 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
|*
|* SwRowFrm::AdjustCells()
|*
-|* Ersterstellung MA 10. Aug. 93
-|* Letzte Aenderung MA 16. Dec. 96
-|*
|*************************************************************************/
void SwRowFrm::AdjustCells( const SwTwips nHeight, const sal_Bool bHeight )
{
@@ -4610,9 +4492,6 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const sal_Bool bHeight )
|*
|* SwRowFrm::Cut()
|*
-|* Ersterstellung MA 12. Nov. 97
-|* Letzte Aenderung MA 12. Nov. 97
-|*
|*************************************************************************/
void SwRowFrm::Cut()
{
@@ -4634,7 +4513,7 @@ void SwRowFrm::Cut()
SwFrm* pCellFrm( GetLower() );
while ( pCellFrm )
{
- ASSERT( pCellFrm->IsCellFrm(),
+ OSL_ENSURE( pCellFrm->IsCellFrm(),
"<SwRowFrm::Cut()> - unexpected type of SwRowFrm lower." );
pVSh->Imp()->DisposeAccessibleFrm( pCellFrm );
@@ -4652,9 +4531,6 @@ void SwRowFrm::Cut()
|*
|* SwRowFrm::GrowFrm()
|*
-|* Ersterstellung MA 15. Mar. 93
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
@@ -4675,10 +4551,10 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
}
else
{
- ASSERT( GetUpper()->IsCellFrm(), "RowFrm->GetUpper neither table nor cell" )
+ OSL_ENSURE( GetUpper()->IsCellFrm(), "RowFrm->GetUpper neither table nor cell" );
bRestrictTableGrowth = GetFollowRow() && bHasFollowFlowLine;
- ASSERT( !bRestrictTableGrowth || !GetNext(),
- "GetFollowRow for row frame that has a Next" )
+ OSL_ENSURE( !bRestrictTableGrowth || !GetNext(),
+ "GetFollowRow for row frame that has a Next" );
//
// There may still be some space left in my direct upper:
@@ -4728,9 +4604,6 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwRowFrm::ShrinkFrm()
|*
-|* Ersterstellung MA 15. Mar. 93
-|* Letzte Aenderung MA 20. Jun. 96
-|*
|*************************************************************************/
SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
@@ -4759,7 +4632,7 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if( nMinHeight < (Frm().*fnRect->fnGetHeight)() )
{
// --> OD 2004-10-04 #i26945#
- ASSERT( FindTabFrm(), "<SwRowFrm::ShrinkFrm(..)> - no table frame -> crash." );
+ OSL_ENSURE( FindTabFrm(), "<SwRowFrm::ShrinkFrm(..)> - no table frame -> crash." );
const bool bConsiderObjs( FindTabFrm()->IsConsiderObjsForMinCellHeight() );
// <--
nMinHeight = lcl_CalcMinRowHeight( this, bConsiderObjs );
@@ -4835,7 +4708,7 @@ bool SwRowFrm::IsRowSplitAllowed() const
// Fixed size rows are never allowed to split:
if ( HasFixSize() )
{
- ASSERT( ATT_FIX_SIZE == GetFmt()->GetFrmSize().GetHeightSizeType(), "pRow claims to have fixed size" )
+ OSL_ENSURE( ATT_FIX_SIZE == GetFmt()->GetFrmSize().GetHeightSizeType(), "pRow claims to have fixed size" );
return false;
}
@@ -4873,9 +4746,6 @@ bool SwRowFrm::ShouldRowKeepWithNext() const
|*
|* SwCellFrm::SwCellFrm(), ~SwCellFrm()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 30. May. 96
-|*
|*************************************************************************/
SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) :
SwLayoutFrm( rBox.GetFrmFmt() ),
@@ -4931,9 +4801,6 @@ SwCellFrm::~SwCellFrm()
|*
|* SwCellFrm::Format()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 29. Jan. 98
-|*
|*************************************************************************/
sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
{
@@ -5132,7 +4999,7 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<lcl_ArrangeLowers(..)> - unknown type of anchored object!" );
}
}
@@ -5170,7 +5037,7 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
{
- ASSERT( pAttrs, "CellFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "CellFrm::Format, pAttrs ist 0." );
const SwTabFrm* pTab = FindTabFrm();
SWRECTFN( pTab )
@@ -5229,9 +5096,9 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
const SwTwips nWish = pTab->GetFmt()->GetFrmSize().GetWidth();
nWidth = pAttrs->GetSize().Width();
- ASSERT( nWish, "Tabelle ohne Breite?" );
- ASSERT( nWidth <= nWish, "Zelle breiter als Tabelle." );
- ASSERT( nWidth > 0, "Box without width" );
+ OSL_ENSURE( nWish, "Tabelle ohne Breite?" );
+ OSL_ENSURE( nWidth <= nWish, "Zelle breiter als Tabelle." );
+ OSL_ENSURE( nWidth > 0, "Box without width" );
const long nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)();
if ( nWish != nPrtWidth )
@@ -5283,7 +5150,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
}
else
{
- ASSERT( pAttrs->GetSize().Width() > 0, "Box without width" );
+ OSL_ENSURE( pAttrs->GetSize().Width() > 0, "Box without width" );
nWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
SwFrm *pPre = GetUpper()->Lower();
while ( pPre != this )
@@ -5340,8 +5207,8 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
{
if ( !Lower()->IsCntntFrm() && !Lower()->IsSctFrm() && !Lower()->IsTabFrm() )
{
- //ASSERT fuer HTML-Import!
- ASSERT( !this, "VAlign an Zelle ohne Inhalt" );
+ // OSL_ENSURE(fuer HTML-Import!
+ OSL_ENSURE( !this, "VAlign an Zelle ohne Inhalt" );
return;
}
sal_Bool bVertDir = sal_True;
@@ -5399,10 +5266,10 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if( ( bVertDir && ( nRemaining -= lcl_CalcTopAndBottomMargin( *this, *pAttrs ) ) < nPrtHeight ) ||
(Lower()->Frm().*fnRect->fnGetTop)() != (this->*fnRect->fnGetPrtTop)() )
{
- long lTopOfst = 0,
- nDiff = (Prt().*fnRect->fnGetHeight)() - nRemaining;
+ long nDiff = (Prt().*fnRect->fnGetHeight)() - nRemaining;
if ( nDiff >= 0 )
{
+ long lTopOfst = 0;
if ( bVertDir )
{
switch ( rOri.GetVertOrient() )
@@ -5434,9 +5301,6 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
|*
|* SwCellFrm::Modify()
|*
-|* Ersterstellung MA 20. Dec. 96
-|* Letzte Aenderung MA 20. Dec. 96
-|*
|*************************************************************************/
void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
@@ -5555,8 +5419,8 @@ void SwCellFrm::Cut()
*/
bool SwTabFrm::IsInHeadline( const SwFrm& rFrm ) const
{
- ASSERT( IsAnLower( &rFrm ) && rFrm.IsInTab(),
- "SwTabFrm::IsInHeadline called for frame not lower of table" )
+ OSL_ENSURE( IsAnLower( &rFrm ) && rFrm.IsInTab(),
+ "SwTabFrm::IsInHeadline called for frame not lower of table" );
const SwFrm* pTmp = &rFrm;
while ( !pTmp->GetUpper()->IsTabFrm() )
@@ -5619,10 +5483,10 @@ bool SwTabFrm::IsLayoutSplitAllowed() const
sal_uInt16 SwTabFrm::GetBottomLineSize() const
{
- ASSERT( IsCollapsingBorders(),
- "BottomLineSize only required for collapsing borders" )
+ OSL_ENSURE( IsCollapsingBorders(),
+ "BottomLineSize only required for collapsing borders" );
- ASSERT( Lower(), "Warning! Trying to prevent a crash, please inform FME" )
+ OSL_ENSURE( Lower(), "Warning! Trying to prevent a crash, please inform FME" );
const SwFrm* pTmp = GetLastLower();
@@ -5808,7 +5672,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
SwTwips nTmpHeight = 0;
pFirstRow = GetFirstNonHeadlineRow();
- ASSERT( !IsFollow() || pFirstRow, "FollowTable without Lower" )
+ OSL_ENSURE( !IsFollow() || pFirstRow, "FollowTable without Lower" );
// NEW TABLES
if ( pFirstRow && pFirstRow->IsRowSpanLine() && pFirstRow->GetNext() )
@@ -5942,3 +5806,4 @@ bool SwFrm::IsInCoveredCell() const
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index c04b13e3c3e5..b83bab70c8c4 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,8 +109,6 @@ static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
|*
|* Beschreibung: Sucht denjenigen CntntFrm, innerhalb dessen
|* PrtArea der Point liegt.
-|* Ersterstellung MA 20. Jul. 92
-|* Letzte Aenderung MA 23. May. 95
|*
|*************************************************************************/
sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
@@ -145,8 +144,6 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|*
|* Beschreibung: Sucht die Seite, innerhalb der der gesuchte Point
|* liegt.
-|* Ersterstellung MA 20. Jul. 92
-|* Letzte Aenderung MA 18. Jul. 96
|*
|*************************************************************************/
@@ -210,7 +207,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
if ( pCMS && pCMS->bStop )
return sal_False;
- ASSERT( pCnt, "Crsr is gone to a Black hole" );
+ OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
bRet = pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
else
@@ -295,8 +292,6 @@ 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 sal_False zurueckgegeben.
-|* Ersterstellung MA 01. Jun. 92
-|* Letzte Aenderung MA 30. Nov. 94
|*
|*************************************************************************/
sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
@@ -304,7 +299,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
sal_Bool bOldAction = IsCallbackActionEnabled();
((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
- ASSERT( (Lower() && Lower()->IsPageFrm()), "Keinen PageFrm gefunden." );
+ OSL_ENSURE( (Lower() && Lower()->IsPageFrm()), "Keinen PageFrm gefunden." );
if( pCMS && pCMS->pFill )
((SwCrsrMoveState*)pCMS)->bFillRet = sal_False;
Point aOldPoint = rPoint;
@@ -350,8 +345,6 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|* der Crsr notfalls mit Gewalt in einen der CntntFrms
|* gesetzt.
|* In geschuetzte Zellen gibt es hier keinen Eingang.
-|* Ersterstellung MA 04. Jun. 93
-|* Letzte Aenderung MA 23. May. 95
|*
|*************************************************************************/
sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
@@ -420,9 +413,6 @@ sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|*
|* SwFlyFrm::GetCrsrOfst()
|*
-|* Ersterstellung MA 15. Dec. 92
-|* Letzte Aenderung MA 23. May. 95
-|*
|*************************************************************************/
//Problem: Wenn zwei Flys genau gleich gross sind und auf derselben
//Position stehen, so liegt jeder innerhalb des anderen.
@@ -515,8 +505,6 @@ sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
/*************************************************************************
|*
|* Beschreibung Layoutabhaengiges Cursortravelling
-|* Ersterstellung MA 23. Jul. 92
-|* Letzte Aenderung MA 06. Sep. 93
|*
|*************************************************************************/
sal_Bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
@@ -579,10 +567,10 @@ const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
while ( pCell && !pCell->IsCellFrm() )
pCell = pCell->GetUpper();
if ( !pCell ||
- ( ( bInReadOnly || !pCell->GetFmt()->GetProtect().IsCntntProtected() ) &&
+ (( ( bInReadOnly || !pCell->GetFmt()->GetProtect().IsCntntProtected() ) &&
( !bMissHeadline || !lcl_IsInRepeatedHeadline( pCell ) ) &&
( !bMissFollowFlowLine || !pCell->IsInFollowFlowRow() ) &&
- !pCell->IsCoveredCell() ) )
+ !pCell->IsCoveredCell()) ) )
bProtect = sal_False;
else
pCnt = (*fnNxtPrv)( pCnt );
@@ -598,7 +586,7 @@ const SwCntntFrm * MA_FASTCALL lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
sal_Bool MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
GetNxtPrvCnt fnNxtPrv, sal_Bool bInReadOnly )
{
- ASSERT( pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
+ OSL_ENSURE( pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
"lcl_UpDown arbeitet nicht fuer andere." );
const SwCntntFrm *pCnt = 0;
@@ -677,7 +665,7 @@ sal_Bool MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
const SwFrm *pCell = pStart->GetUpper();
while ( pCell && !pCell->IsCellFrm() )
pCell = pCell->GetUpper();
- ASSERT( pCell, "Zelle nicht gefunden." );
+ OSL_ENSURE( pCell, "Zelle nicht gefunden." );
nX = (pCell->Frm().*fnRect->fnGetLeft)() +
(pCell->Frm().*fnRect->fnGetWidth)() / 2;
@@ -701,14 +689,14 @@ sal_Bool MA_FASTCALL lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
const long nPrtLeft = bRTL ?
(pTable->*fnRect->fnGetPrtRight)() :
(pTable->*fnRect->fnGetPrtLeft)();
- if ( (bRTL != (nX < nPrtLeft)) )
+ if ( bRTL != (nX < nPrtLeft) )
nX = nPrtLeft;
else
{
const long nPrtRight = bRTL ?
(pTable->*fnRect->fnGetPrtLeft)() :
(pTable->*fnRect->fnGetPrtRight)();
- if ( (bRTL != (nX > nPrtRight)) )
+ if ( bRTL != (nX > nPrtRight) )
nX = nPrtRight;
}
}
@@ -885,13 +873,11 @@ sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly
|* diejenige in der der PaM sitzt. Anderfalls ist die aktuelle
|* Seite die erste Seite innerhalb der VisibleArea.
|* Es wird nur auf den vorhandenen Seiten gearbeitet!
-|* Ersterstellung MA 20. May. 92
-|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{
- ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" );
+ OSL_ENSURE( pActualCrsr, "Welche Seite soll's denn sein?" );
SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode().
GetCntntNode()->GetFrm( 0,
pActualCrsr->GetPoint(),
@@ -909,13 +895,11 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
|* Liefert Null, wenn die Operation nicht moeglich ist.
|* Der PaM sitzt in der letzten Seite, wenn die Seitenzahl zu gross
|* gewaehlt wurde.
-|* Ersterstellung MA 20. May. 92
-|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
{
- ASSERT( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
+ OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
SwPageFrm *pPage = (SwPageFrm*)Lower();
sal_Bool bEnd =sal_False;
@@ -981,8 +965,6 @@ sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
|* andere Anfang/Ende.
|* Fuer die Bestimmung der Seite und des Cntnt (Anfang/Ende) werden
|* die im folgenden definierten Funktionen benutzt.
-|* Ersterstellung MA 15. Oct. 92
-|* Letzte Aenderung MA 28. Feb. 93
|*
|*************************************************************************/
SwCntntFrm *GetFirstSub( const SwLayoutFrm *pLayout )
@@ -1097,8 +1079,6 @@ sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
* erweitert bis einer gefunden wird.
|* Zurueckgegeben wird die 'Semantisch richtige' Position
|* innerhalb der PrtArea des gefundenen CntntFrm
-|* Ersterstellung MA 15. Jul. 92
-|* Letzte Aenderung MA 09. Jan. 97
|*
|*************************************************************************/
sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 )
@@ -1283,10 +1263,10 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
break;
}
-#ifdef DBG_UTIL
- ASSERT( pActual, "Keinen Cntnt gefunden." );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pActual, "Keinen Cntnt gefunden." );
if ( bBodyOnly )
- ASSERT( pActual->IsInDocBody(), "Cnt nicht im Body." );
+ OSL_ENSURE( pActual->IsInDocBody(), "Cnt nicht im Body." );
#endif
//Spezialfall fuer das selektieren von Tabellen, nicht in wiederholte
@@ -1352,9 +1332,6 @@ const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
|* Beschreibung Analog zu SwLayoutFrm::GetCntntPos().
|* Spezialisiert fuer Felder in Rahmen.
|*
-|* Ersterstellung MA 22. Mar. 95
-|* Letzte Aenderung MA 07. Nov. 95
-|*
|*************************************************************************/
void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
{
@@ -1432,7 +1409,7 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
{
// CntntFrm nicht formatiert -> immer auf Node-Anfang
SwCntntNode* pCNd = (SwCntntNode*)pAct->GetNode();
- ASSERT( pCNd, "Wo ist mein CntntNode?" );
+ OSL_ENSURE( pCNd, "Wo ist mein CntntNode?" );
rPos.nNode = *pCNd;
rPos.nContent.Assign( pCNd, 0 );
}
@@ -1449,8 +1426,6 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
|*
|* Beschreibung Es wird der naechstliegende Cntnt zum uebergebenen
|* Point gesucht. Es wird nur im BodyText gesucht.
-|* Ersterstellung MA 15. Jul. 92
-|* Letzte Aenderung JP 11.10.2001
|*
|*************************************************************************/
@@ -1571,13 +1546,11 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) cons
|* Liefert Null, wenn die Operation nicht moeglich ist.
|* Die Pos ist die der letzten Seite, wenn die Seitenzahl zu gross
|* gewaehlt wurde.
-|* Ersterstellung MA 01. Jun. 92
-|* Letzte Aenderung MA 09. Oct. 97
|*
|*************************************************************************/
Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const
{
- ASSERT( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
+ OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Keine Seite vorhanden." );
const SwPageFrm *pPage = (const SwPageFrm*)Lower();
while ( sal_True )
@@ -1640,8 +1613,6 @@ sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const
|* geschuetzt?
|* Auch Fly in Fly in ... und Fussnoten
|*
-|* Ersterstellung MA 28. Jul. 93
-|* Letzte Aenderung MA 06. Nov. 97
|*
|*************************************************************************/
sal_Bool SwFrm::IsProtected() const
@@ -1705,8 +1676,6 @@ sal_Bool SwFrm::IsProtected() const
|* SwFrm::GetPhyPageNum()
|* Beschreibung: Liefert die physikalische Seitennummer
|*
-|* Ersterstellung OK 06.07.93 08:35
-|* Letzte Aenderung MA 30. Nov. 94
|*
|*************************************************************************/
sal_uInt16 SwFrm::GetPhyPageNum() const
@@ -1715,7 +1684,7 @@ sal_uInt16 SwFrm::GetPhyPageNum() const
return pPage ? pPage->GetPhyPageNum() : 0;
}
-/*-----------------26.02.01 11:25-------------------
+/*--------------------------------------------------
* SwFrm::WannaRightPage()
* decides if the page want to be a rightpage or not.
* If the first content of the page has a page descriptor,
@@ -1763,7 +1732,7 @@ sal_Bool SwFrm::WannaRightPage() const
pDesc = (SwPageDesc*)&pDoc->GetPageDesc( 0 );
}
}
- ASSERT( pDesc, "No pagedescriptor" );
+ OSL_ENSURE( pDesc, "No pagedescriptor" );
sal_Bool bOdd;
if( nPgNum )
bOdd = nPgNum % 2 ? sal_True : sal_False;
@@ -1788,9 +1757,6 @@ sal_Bool SwFrm::WannaRightPage() const
|* SwFrm::GetVirtPageNum()
|* Beschreibung: Liefert die virtuelle Seitennummer mit Offset
|*
-|* Ersterstellung OK 06.07.93 08:35
-|* Letzte Aenderung MA 30. Nov. 94
-|*
|*************************************************************************/
sal_uInt16 SwFrm::GetVirtPageNum() const
{
@@ -1844,9 +1810,6 @@ sal_uInt16 SwFrm::GetVirtPageNum() const
|*
|* SwRootFrm::MakeTblCrsrs()
|*
-|* Ersterstellung MA 14. May. 93
-|* Letzte Aenderung MA 02. Feb. 94
-|*
|*************************************************************************/
//Ermitteln und einstellen derjenigen Zellen die von der Selektion
//eingeschlossen sind.
@@ -1854,7 +1817,7 @@ sal_uInt16 SwFrm::GetVirtPageNum() const
bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
{
//Union-Rects und Tabellen (Follows) der Selektion besorgen.
- ASSERT( rTblCrsr.GetCntntNode() && rTblCrsr.GetCntntNode( sal_False ),
+ OSL_ENSURE( rTblCrsr.GetCntntNode() && rTblCrsr.GetCntntNode( sal_False ),
"Tabselection nicht auf Cnt." );
bool bRet = false;
@@ -1884,7 +1847,7 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0;
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
- ASSERT( pStart && pEnd, "MakeTblCrsrs: Good to have the code robust here!" )
+ OSL_ENSURE( pStart && pEnd, "MakeTblCrsrs: Good to have the code robust here!" );
// <--
/* #109590# Only change table boxes if the frames are
@@ -1917,7 +1880,7 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
while ( pCell && pRow->IsAnLower( pCell ) )
{
- ASSERT( pCell->IsCellFrm(), "Frame ohne Celle" );
+ OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( IsFrmInTblSel( pUnion->GetUnion(), pCell ) &&
(bReadOnlyAvailable ||
!pCell->GetFmt()->GetProtect().IsCntntProtected()))
@@ -1945,7 +1908,7 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
while( !pCell->IsCellFrm() )
{
pCell = pCell->GetUpper();
- ASSERT( pCell, "Where's my cell?" );
+ OSL_ENSURE( pCell, "Where's my cell?" );
}
}
}
@@ -1967,9 +1930,6 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
|*
|* SwRootFrm::CalcFrmRects
|*
-|* Ersterstellung MA 24. Aug. 92
-|* Letzte Aenderung MA 24. Aug. 93
-|*
|*************************************************************************/
/*
@@ -2028,19 +1988,6 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
( !pEndPos->nNode.GetNode().IsCntntNode() ||
!pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) )
{
- /* For SelectAll we will need something like this later on...
- const SwFrm* pPageFrm = GetLower();
- while( pPageFrm )
- {
- SwRect aTmp( pPageFrm->Prt() );
- aTmp.Pos() += pPageFrm->Frm().Pos();
- Sub( aRegion, aTmp );
- pPageFrm = pPageFrm->GetNext();
- }
- aRegion.Invert();
- rCrsr.Remove( 0, rCrsr.Count() );
- rCrsr.Insert( &aRegion, 0 );
- */
return;
}
@@ -2052,7 +1999,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode().
GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos );
- ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
+ OSL_ENSURE( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
//Damit die FlyFrms, in denen selektierte Frames stecken, nicht
//abgezogen werden
@@ -2060,9 +2007,11 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
if ( pStartFrm->IsInFly() )
{
const SwAnchoredObject* pObj = pStartFrm->FindFlyFrm();
- aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
+ OSL_ENSURE( pObj, "No Start Object." );
+ if (pObj) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
const SwAnchoredObject* pObj2 = pEndFrm->FindFlyFrm();
- aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) );
+ OSL_ENSURE( pObj2, "No Start Object." );
+ if (pObj2) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) );
}
//Fall 4: Tabellenselection
@@ -2096,7 +2045,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
if( !pEndLFrm )
break;
- ASSERT( pEndLFrm->GetType() == pSttLFrm->GetType(),
+ OSL_ENSURE( pEndLFrm->GetType() == pSttLFrm->GetType(),
"Selection ueber unterschiedliche Inhalte" );
switch( pSttLFrm->GetType() )
{
@@ -2513,7 +2462,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
// --> OD 2006-01-24 #123908# - introduce robust code:
// The stacktrace issue reveals that <pCntnt> could be NULL.
// One root cause found by AMA - see #130650#
- ASSERT( pCntnt,
+ OSL_ENSURE( pCntnt,
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
while ( pCntnt && pCntnt != pEndFrm )
// <--
@@ -2554,7 +2503,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
}
pCntnt = pCntnt->GetNextCntntFrm();
// --> OD 2006-01-24 #123908#
- ASSERT( pCntnt,
+ OSL_ENSURE( pCntnt,
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
// <--
}
@@ -2620,7 +2569,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
const sal_uInt32 nPos = pObj->GetOrdNum();
for ( sal_uInt16 k = 0; bSub && k < aSortObjs.Count(); ++k )
{
- ASSERT( aSortObjs[k]->ISA(SwFlyFrm),
+ OSL_ENSURE( aSortObjs[k]->ISA(SwFlyFrm),
"<SwRootFrm::CalcFrmRects(..)> - object in <aSortObjs> of unexcepted type" );
const SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(aSortObjs[k]);
do
@@ -2659,3 +2608,4 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index 1f6bd97479bd..8d01e2477993 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,52 +32,51 @@
#include "rootfrm.hxx"
#include "cntfrm.hxx"
#include "flyfrm.hxx"
-#include "errhdl.hxx"
void SwFrm::Format( const SwBorderAttrs * )
{
- ASSERT( sal_False, "Format() der Basisklasse gerufen." );
+ OSL_ENSURE( sal_False, "Format() der Basisklasse gerufen." );
}
void SwFrm::Paint(SwRect const&, SwPrintData const*const) const
{
- ASSERT( sal_False, "Paint() der Basisklasse gerufen." );
+ OSL_ENSURE( sal_False, "Paint() der Basisklasse gerufen." );
}
sal_Bool SwCntntFrm::WouldFit( SwTwips &, sal_Bool&, sal_Bool )
{
- ASSERT( sal_False, "WouldFit des CntntFrm gerufen." );
+ OSL_ENSURE( sal_False, "WouldFit des CntntFrm gerufen." );
return sal_False;
}
bool SwFrm::FillSelection( SwSelectionList& , const SwRect& ) const
{
- ASSERT( false, "Don't call this function at the base class!" );
+ OSL_ENSURE( false, "Don't call this function at the base class!" );
return false;
}
sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* ) const
{
- ASSERT( sal_False, "GetCrsrOfst der Basisklasse, hi!" );
+ OSL_ENSURE( sal_False, "GetCrsrOfst der Basisklasse, hi!" );
return sal_False;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwRootFrm::Cut()
{
- ASSERT( sal_False, "Cut() des RootFrm gerufen." );
+ OSL_ENSURE( sal_False, "Cut() des RootFrm gerufen." );
}
void SwRootFrm::Paste( SwFrm *, SwFrm * )
{
- ASSERT( sal_False, "Paste() des RootFrm gerufen." );
+ OSL_ENSURE( sal_False, "Paste() des RootFrm gerufen." );
}
void SwFlyFrm::Paste( SwFrm *, SwFrm * )
{
- ASSERT( sal_False, "Paste() des FlyFrm gerufen." );
+ OSL_ENSURE( sal_False, "Paste() des FlyFrm gerufen." );
}
#endif
@@ -84,8 +84,9 @@ void SwFlyFrm::Paste( SwFrm *, SwFrm * )
sal_Bool SwFrm::GetCharRect( SwRect&, const SwPosition&,
SwCrsrMoveState* ) const
{
- ASSERT( sal_False, "GetCharRect() der Basis gerufen." );
+ OSL_ENSURE( sal_False, "GetCharRect() der Basis gerufen." );
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index f1d909fd2f83..d769f3c4987a 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
// OD 12.11.2002 #96272# - include declaration for <SetMappingForVirtDev>
#include "setmapvirtdev.hxx"
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* class DbgRect
@@ -183,7 +184,7 @@ void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn )
{
Flush();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( pShell->GetViewOptions()->IsTest3() )
{
++nCount;
@@ -209,7 +210,7 @@ void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn )
aTmp.SSize().Height()+= aPixSz.Height()/2 + 1;
Rectangle aTmpRect( pO->LogicToPixel( aTmp.SVRect() ) );
- ASSERT( !pSh->GetWin()->IsReallyVisible() ||
+ OSL_ENSURE( !pSh->GetWin()->IsReallyVisible() ||
aTmpRect.GetWidth() <= pSh->GetWin()->GetOutputSizePixel().Width() + 2,
"Paintwidth bigger than visarea?" );
// Passt das Rechteck in unseren Buffer ?
@@ -245,7 +246,7 @@ void SwLayVout::Enter( ViewShell *pShell, SwRect &rRect, sal_Bool bOn )
void SwLayVout::_Flush()
{
- ASSERT( pVirDev, "SwLayVout::DrawOut: nothing left Toulouse" );
+ OSL_ENSURE( pVirDev, "SwLayVout::DrawOut: nothing left Toulouse" );
Rectangle aTmp( aRect.SVRect() );
pOut->DrawOutDev( aRect.Pos(), aRect.SSize(),
aRect.Pos(), aRect.SSize(), *pVirDev );
@@ -254,3 +255,4 @@ void SwLayVout::_Flush()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx
index deb2b20538a1..f3f27a184150 100644
--- a/sw/source/core/layout/virtoutp.hxx
+++ b/sw/source/core/layout/virtoutp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 4ebca620e4e2..9497890b8979 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <hints.hxx>
#include <tools/pstm.hxx>
@@ -82,9 +82,6 @@ using namespace ::com::sun::star;
|*
|* SwFrm::SwFrm()
|*
-|* Ersterstellung AK 12-Feb-1991
-|* Letzte Aenderung MA 05. Apr. 94
-|*
|*************************************************************************/
SwFrm::SwFrm( SwModify *pMod ) :
@@ -102,11 +99,11 @@ SwFrm::SwFrm( SwModify *pMod ) :
, bInfFtn ( sal_False )
, bInfSct ( sal_False )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
bFlag01 = bFlag02 = bFlag03 = bFlag04 = bFlag05 = 0;
#endif
- ASSERT( pMod, "Kein Frameformat uebergeben." );
+ OSL_ENSURE( pMod, "Kein Frameformat uebergeben." );
bInvalidR2L = bInvalidVert = 1;
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = bVertLR = 0;
@@ -243,9 +240,6 @@ void SwTxtFrm::CheckDirection( sal_Bool bVert )
|*
|* SwFrm::Modify()
|*
-|* Ersterstellung AK 01-Mar-1991
-|* Letzte Aenderung MA 20. Jun. 96
-|*
|*************************************************************************/
void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
@@ -348,7 +342,7 @@ void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew,
break;
}
case RES_COL:
- ASSERT( sal_False, "Spalten fuer neuen FrmTyp?" );
+ OSL_ENSURE( sal_False, "Spalten fuer neuen FrmTyp?" );
break;
default:
@@ -359,8 +353,6 @@ void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew,
/*************************************************************************
|*
|* SwFrm::Prepare()
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 26. Jun. 96
|*
|*************************************************************************/
void SwFrm::Prepare( const PrepareHint, const void *, sal_Bool )
@@ -374,8 +366,6 @@ void SwFrm::Prepare( const PrepareHint, const void *, sal_Bool )
|* Beschreibung: Invalidiert die Seite, in der der Frm gerade steht.
|* Je nachdem ob es ein Layout, Cntnt oder FlyFrm ist wird die Seite
|* entsprechend Invalidiert.
-|* Ersterstellung MA 22. Jul. 92
-|* Letzte Aenderung MA 14. Oct. 94
|*
|*************************************************************************/
void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
@@ -492,9 +482,6 @@ void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
|*
|* SwFrm::ChgSize()
|*
-|* Ersterstellung AK 15-Feb-1991
-|* Letzte Aenderung MA 18. Nov. 98
-|*
|*************************************************************************/
Size SwFrm::ChgSize( const Size& aNewSize )
{
@@ -577,13 +564,12 @@ Size SwFrm::ChgSize( const Size& aNewSize )
|* Eingefuegt wird unterhalb des Parent und entweder
|* vor pBehind oder am Ende der Kette wenn pBehind
|* leer ist.
-|* Letzte Aenderung MA 06. Aug. 99
|*
|*************************************************************************/
void SwFrm::InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind )
{
- ASSERT( pParent, "Kein Parent fuer Insert." );
- ASSERT( (!pBehind || (pBehind && pParent == pBehind->GetUpper())),
+ OSL_ENSURE( pParent, "Kein Parent fuer Insert." );
+ OSL_ENSURE( (!pBehind || (pBehind && pParent == pBehind->GetUpper())),
"Framebaum inkonsistent." );
pUpper = pParent;
@@ -618,13 +604,12 @@ void SwFrm::InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind )
|* Eingefuegt wird unterhalb des Parent und entweder
|* hinter pBefore oder am Anfang der Kette wenn pBefore
|* leer ist.
-|* Letzte Aenderung MA 06. Aug. 99
|*
|*************************************************************************/
void SwFrm::InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore )
{
- ASSERT( pParent, "Kein Parent fuer Insert." );
- ASSERT( (!pBefore || (pBefore && pParent == pBefore->GetUpper())),
+ OSL_ENSURE( pParent, "Kein Parent fuer Insert." );
+ OSL_ENSURE( (!pBefore || (pBefore && pParent == pBefore->GetUpper())),
"Framebaum inkonsistent." );
pUpper = pParent;
@@ -652,7 +637,6 @@ void SwFrm::InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore )
|*
|* Beschreibung Eine Kette von SwFrms wird in eine bestehende Struktur
|* eingefuegt
-|* Letzte Aenderung AMA 9. Dec. 97
|*
|* Bisher wird dies genutzt, um einen SectionFrame, der ggf. schon Geschwister
|* mit sich bringt, in eine bestehende Struktur einzufuegen.
@@ -672,9 +656,9 @@ void SwFrm::InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore )
|*************************************************************************/
void SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct )
{
- ASSERT( pParent, "Kein Parent fuer Insert." );
- ASSERT( (!pBehind || (pBehind && ( pParent == pBehind->GetUpper())
- || ( pParent->IsSctFrm() && pBehind->GetUpper()->IsColBodyFrm() ) ) ),
+ OSL_ENSURE( pParent, "Kein Parent fuer Insert." );
+ OSL_ENSURE( (!pBehind || ( (pBehind && (pParent == pBehind->GetUpper()))
+ || ((pParent->IsSctFrm() && pBehind->GetUpper()->IsColBodyFrm())) ) ),
"Framebaum inkonsistent." );
if( pSct )
{
@@ -716,9 +700,9 @@ void SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct )
SwLayoutFrm* pTmp = (SwLayoutFrm*)pSct;
if( pTmp->Lower() )
{
- ASSERT( pTmp->Lower()->IsColumnFrm(), "InsertGrp: Used SectionFrm" );
+ OSL_ENSURE( pTmp->Lower()->IsColumnFrm(), "InsertGrp: Used SectionFrm" );
pTmp = (SwLayoutFrm*)((SwLayoutFrm*)pTmp->Lower())->Lower();
- ASSERT( pTmp, "InsertGrp: Missing ColBody" );
+ OSL_ENSURE( pTmp, "InsertGrp: Missing ColBody" );
}
pBehind->pUpper = pTmp;
pBehind->GetUpper()->pLower = pBehind;
@@ -731,7 +715,7 @@ void SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct )
}
else
{
- ASSERT( pSct->IsSctFrm(), "InsertGroup: For SectionFrms only" );
+ OSL_ENSURE( pSct->IsSctFrm(), "InsertGroup: For SectionFrms only" );
delete ((SwSectionFrm*)pSct);
}
}
@@ -772,20 +756,17 @@ void SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct )
|*
|* SwFrm::Remove()
|*
-|* Ersterstellung AK 01-Mar-1991
-|* Letzte Aenderung MA 07. Dec. 95
-|*
|*************************************************************************/
void SwFrm::Remove()
{
- ASSERT( pUpper, "Removen ohne Upper?" );
+ OSL_ENSURE( pUpper, "Removen ohne Upper?" );
if( pPrev )
// einer aus der Mitte wird removed
pPrev->pNext = pNext;
else
{ // der erste in einer Folge wird removed
- ASSERT( pUpper->pLower == this, "Layout inkonsistent." );
+ OSL_ENSURE( pUpper->pLower == this, "Layout inkonsistent." );
pUpper->pLower = pNext;
}
if( pNext )
@@ -799,20 +780,17 @@ void SwFrm::Remove()
|*
|* SwCntntFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 09. Sep. 98
-|*
|*************************************************************************/
void SwCntntFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
{
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetNext() && !GetUpper(),
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
- ASSERT( !pSibling || pSibling->IsFlowFrm(),
- "<SwCntntFrm::Paste(..)> - sibling not of expected type." )
+ OSL_ENSURE( !pSibling || pSibling->IsFlowFrm(),
+ "<SwCntntFrm::Paste(..)> - sibling not of expected type." );
//In den Baum einhaengen.
InsertBefore( (SwLayoutFrm*)pParent, pSibling );
@@ -907,13 +885,10 @@ void SwCntntFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
|*
|* SwCntntFrm::Cut()
|*
-|* Ersterstellung AK 14-Feb-1991
-|* Letzte Aenderung MA 09. Sep. 98
-|*
|*************************************************************************/
void SwCntntFrm::Cut()
{
- ASSERT( GetUpper(), "Cut ohne Upper()." );
+ OSL_ENSURE( GetUpper(), "Cut ohne Upper()." );
SwPageFrm *pPage = FindPageFrm();
InvalidatePage( pPage );
@@ -1051,7 +1026,6 @@ void SwCntntFrm::Cut()
{
// --> OD 2006-09-25 #b6448963#
// prevent delete of <ColLocked> footnote frame
-// if( pUp->IsFtnFrm() )
if ( pUp->IsFtnFrm() && !pUp->IsColLocked())
// <--
{
@@ -1067,7 +1041,6 @@ void SwCntntFrm::Cut()
else
{
// --> OD 2006-09-25 #b6448963#
-// if ( pSct->IsColLocked() || !pSct->IsInFtn() )
if ( pSct->IsColLocked() || !pSct->IsInFtn() ||
( pUp->IsFtnFrm() && pUp->IsColLocked() ) )
// <--
@@ -1100,17 +1073,14 @@ void SwCntntFrm::Cut()
|*
|* SwLayoutFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
{
- ASSERT( pParent, "Kein Parent fuer Paste." );
- ASSERT( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- ASSERT( pParent != this, "Bin selbst der Parent." );
- ASSERT( pSibling != this, "Bin mein eigener Nachbar." );
- ASSERT( !GetPrev() && !GetNext() && !GetUpper(),
+ OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
+ OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
+ OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
"Bin noch irgendwo angemeldet." );
//In den Baum einhaengen.
@@ -1208,9 +1178,6 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
|*
|* SwLayoutFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
void SwLayoutFrm::Cut()
{
@@ -1273,13 +1240,10 @@ void SwLayoutFrm::Cut()
|*
|* SwFrm::Grow()
|*
-|* Ersterstellung AK 19-Feb-1991
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
SwTwips SwFrm::Grow( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
- ASSERT( nDist >= 0, "Negatives Wachstum?" );
+ OSL_ENSURE( nDist >= 0, "Negatives Wachstum?" );
PROTOCOL_ENTER( this, bTst ? PROT_GROW_TST : PROT_GROW, 0, &nDist )
@@ -1325,13 +1289,10 @@ SwTwips SwFrm::Grow( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwFrm::Shrink()
|*
-|* Ersterstellung AK 14-Feb-1991
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
SwTwips SwFrm::Shrink( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
- ASSERT( nDist >= 0, "Negative Verkleinerung?" );
+ OSL_ENSURE( nDist >= 0, "Negative Verkleinerung?" );
PROTOCOL_ENTER( this, bTst ? PROT_SHRINK_TST : PROT_SHRINK, 0, &nDist )
@@ -1396,9 +1357,6 @@ SwTwips SwFrm::Shrink( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* Parameter: nDiff ist der Betrag, um den Platz geschaffen werden muss
|*
-|* Ersterstellung MA 07. May. 92
-|* Letzte Aenderung AMA 02. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
{
@@ -1667,14 +1625,14 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
if( ( IsHeaderFrm() || IsFooterFrm() ) && pBoss->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pBoss->GetDrawObjs();
- ASSERT( pBoss->IsPageFrm(), "Header/Footer out of page?" );
+ OSL_ENSURE( pBoss->IsPageFrm(), "Header/Footer out of page?" );
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = rObjs[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
{
SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
- ASSERT( !pFly->IsFlyInCntFrm(), "FlyInCnt at Page?" );
+ OSL_ENSURE( !pFly->IsFlyInCntFrm(), "FlyInCnt at Page?" );
const SwFmtVertOrient &rVert =
pFly->GetFmt()->GetVertOrient();
// Wann muss invalidiert werden?
@@ -1703,9 +1661,6 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst )
|* SwFrm::ImplInvalidateSize(), ImplInvalidatePrt(), ImplInvalidatePos(),
|* ImplInvalidateLineNum()
|*
-|* Ersterstellung MA 15. Oct. 92
-|* Letzte Aenderung MA 24. Mar. 94
-|*
|*************************************************************************/
/** method to perform additional actions on an invalidation
@@ -1784,7 +1739,7 @@ void SwFrm::ImplInvalidateLineNum()
if ( _InvalidationAllowed( INVALID_LINENUM ) )
{
bValidLineNum = sal_False;
- ASSERT( IsTxtFrm(), "line numbers are implemented for text only" );
+ OSL_ENSURE( IsTxtFrm(), "line numbers are implemented for text only" );
InvalidatePage();
// OD 2004-05-19 #i28701#
@@ -1796,9 +1751,6 @@ void SwFrm::ImplInvalidateLineNum()
|*
|* SwFrm::ReinitializeFrmSizeAttrFlags
|*
-|* Ersterstellung MA 15. Oct. 96
-|* Letzte Aenderung MA 15. Oct. 96
-|*
|*************************************************************************/
void SwFrm::ReinitializeFrmSizeAttrFlags()
{
@@ -1893,9 +1845,6 @@ void SwFrm::ValidateThisAndAllLowers( const sal_uInt16 nStage )
|*
|* SwCntntFrm::GrowFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 25. Mar. 99
-|*
|*************************************************************************/
SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
@@ -2007,15 +1956,12 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwCntntFrm::ShrinkFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 05. May. 94
-|*
|*************************************************************************/
SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
SWRECTFN( this )
- ASSERT( nDist >= 0, "nDist < 0" );
- ASSERT( nDist <= (Frm().*fnRect->fnGetHeight)(),
+ OSL_ENSURE( nDist >= 0, "nDist < 0" );
+ OSL_ENSURE( nDist <= (Frm().*fnRect->fnGetHeight)(),
"nDist > als aktuelle Grosse." );
if ( !bTst )
@@ -2130,10 +2076,6 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwCntntFrm::Modify()
|*
-|* Beschreibung
-|* Ersterstellung AK 05-Mar-1991
-|* Letzte Aenderung MA 13. Oct. 95
-|*
|*************************************************************************/
void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
@@ -2363,9 +2305,6 @@ void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
|*
|* SwLayoutFrm::SwLayoutFrm()
|*
-|* Ersterstellung AK 14-Feb-1991
-|* Letzte Aenderung MA 12. May. 95
-|*
|*************************************************************************/
SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt ):
SwFrm( pFmt ),
@@ -2379,7 +2318,7 @@ SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt ):
// --> OD 2004-06-29 #i28701#
TYPEINIT1(SwLayoutFrm,SwFrm);
// <--
-/*-----------------10.06.99 09:42-------------------
+/*--------------------------------------------------
* SwLayoutFrm::InnerHeight()
* --------------------------------------------------*/
@@ -2425,9 +2364,6 @@ SwTwips SwLayoutFrm::InnerHeight() const
|*
|* SwLayoutFrm::GrowFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 23. Sep. 96
-|*
|*************************************************************************/
SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
@@ -2593,9 +2529,6 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|*
|* SwLayoutFrm::ShrinkFrm()
|*
-|* Ersterstellung MA 30. Jul. 92
-|* Letzte Aenderung MA 25. Mar. 99
-|*
|*************************************************************************/
SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
@@ -2604,7 +2537,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
- ASSERT( nDist >= 0, "nDist < 0" );
+ OSL_ENSURE( nDist >= 0, "nDist < 0" );
SWRECTFN( this )
SwTwips nFrmHeight = (Frm().*fnRect->fnGetHeight)();
if ( nDist > nFrmHeight )
@@ -2662,7 +2595,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nRealDist - nReal;
- ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
+ OSL_ENSURE( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
}
}
}
@@ -2676,7 +2609,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if( bChgPos && !IsVertLR() )
Frm().Pos().X() += nTmp - nReal;
- ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
+ OSL_ENSURE( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" );
nReal = nTmp;
}
}
@@ -2774,8 +2707,6 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|* PrtArea des Frm's.
|* Die Variablen Frm's werden auch proportional angepasst; sie werden
|* sich schon wieder zurechtwachsen/-schrumpfen.
-|* Ersterstellung MA 11.03.92
-|* Letzte Aenderung AMA 2. Nov. 98
|*
|*************************************************************************/
void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
@@ -3065,7 +2996,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
( IsColumnFrm() && IsInSct() )
)
{
- ASSERT( pLowerFrm->IsBodyFrm() || pLowerFrm->IsFtnContFrm(),
+ OSL_ENSURE( pLowerFrm->IsBodyFrm() || pLowerFrm->IsFtnContFrm(),
"ChgLowersProp - only for body or foot note container" );
if ( pLowerFrm->IsBodyFrm() || pLowerFrm->IsFtnContFrm() )
{
@@ -3077,7 +3008,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
if ( nNewHeight < 0)
{
// OD 01.04.2003 #108446# - adjust assertion condition and text
- ASSERT( !( IsPageFrm() &&
+ OSL_ENSURE( !( IsPageFrm() &&
(pLowerFrm->Frm().Height()>0) &&
(pLowerFrm->IsValid()) ),
"ChgLowersProg - negative height for lower.");
@@ -3157,12 +3088,12 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
const SwFmtCol* pColAttr = NULL;
if ( IsPageBodyFrm() )
{
- ASSERT( GetUpper()->IsPageFrm(), "Upper is not page frame" )
+ OSL_ENSURE( GetUpper()->IsPageFrm(), "Upper is not page frame" );
pColAttr = &GetUpper()->GetFmt()->GetCol();
}
else
{
- ASSERT( IsFlyFrm() || IsSctFrm(), "Columns not in fly or section" )
+ OSL_ENSURE( IsFlyFrm() || IsSctFrm(), "Columns not in fly or section" );
pColAttr = &GetFmt()->GetCol();
}
@@ -3177,13 +3108,11 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
|*
|* Beschreibung: "Formatiert" den Frame; Frm und PrtArea.
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 28. Jul. 92
-|* Letzte Aenderung MA 21. Mar. 95
|*
|*************************************************************************/
void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
{
- ASSERT( pAttrs, "LayoutFrm::Format, pAttrs ist 0." );
+ OSL_ENSURE( pAttrs, "LayoutFrm::Format, pAttrs ist 0." );
if ( bValidPrtArea && bValidSize )
return;
@@ -3270,13 +3199,10 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
|*
|* SwLayoutFrm::InvalidatePercentLowers()
|*
-|* Ersterstellung MA 13. Jun. 96
-|* Letzte Aenderung MA 13. Jun. 96
-|*
|*************************************************************************/
static void InvaPercentFlys( SwFrm *pFrm, SwTwips nDiff )
{
- ASSERT( pFrm->GetDrawObjs(), "Can't find any Objects" );
+ OSL_ENSURE( pFrm->GetDrawObjs(), "Can't find any Objects" );
for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
@@ -3322,7 +3248,7 @@ void SwLayoutFrm::InvaPercentLowers( SwTwips nDiff )
if ( pFrm->IsInTab() && !IsTabFrm() )
{
SwFrm *pTmp = pFrm->FindTabFrm();
- ASSERT( pTmp, "Where's my TabFrm?" );
+ OSL_ENSURE( pTmp, "Where's my TabFrm?" );
if( IsAnLower( pTmp ) )
pFrm = pTmp;
}
@@ -3343,9 +3269,6 @@ void SwLayoutFrm::InvaPercentLowers( SwTwips nDiff )
|*
|* SwLayoutFrm::CalcRel()
|*
-|* Ersterstellung MA 13. Jun. 96
-|* Letzte Aenderung MA 10. Oct. 96
-|*
|*************************************************************************/
long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const
{
@@ -3379,7 +3302,7 @@ long MA_FASTCALL lcl_CalcMinColDiff( SwLayoutFrm *pLayFrm )
{
long nDiff = 0, nFirstDiff = 0;
SwLayoutFrm *pCol = (SwLayoutFrm*)pLayFrm->Lower();
- ASSERT( pCol, "Where's the columnframe?" );
+ OSL_ENSURE( pCol, "Where's the columnframe?" );
SwFrm *pFrm = pCol->Lower();
do
{
@@ -3594,7 +3517,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
::CalcCntnt( this );
pCol = (SwLayoutFrm*)Lower();
- ASSERT( pCol && pCol->GetNext(), ":-( Spalten auf Urlaub?");
+ OSL_ENSURE( pCol && pCol->GetNext(), ":-( Spalten auf Urlaub?");
// bMinDiff wird gesetzt, wenn es keine leere Spalte gibt
sal_Bool bMinDiff = sal_True;
// OD 28.03.2003 #108446# - check for all column content and all columns
@@ -3628,7 +3551,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
{
bFoundLower = sal_True;
pLay = (SwLayoutFrm*)pLay->GetNext();
- ASSERT( pLay->IsFtnContFrm(),"FtnContainer exspected" );
+ OSL_ENSURE( pLay->IsFtnContFrm(),"FtnContainer exspected" );
nInnerHeight += pLay->InnerHeight();
nInnerHeight += (pLay->Frm().*fnRect->fnGetHeight)() -
(pLay->Prt().*fnRect->fnGetHeight)();
@@ -3811,9 +3734,6 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
|*
|* SwRootFrm::InvalidateAllCntnt()
|*
-|* Ersterstellung MA 13. Feb. 98
-|* Letzte Aenderung MA 12. Aug. 00
-|*
|*************************************************************************/
SwCntntFrm* lcl_InvalidateSection( SwFrm *pCnt, sal_uInt8 nInv )
@@ -3870,9 +3790,9 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv )
if( pLastSctCnt == pCnt )
pLastSctCnt = NULL;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !pLastSctCnt, "Where's the last SctCntnt?" );
+ OSL_ENSURE( !pLastSctCnt, "Where's the last SctCntnt?" );
#endif
}
if( nInv & INV_TABLE )
@@ -3898,9 +3818,9 @@ void lcl_InvalidateCntnt( SwCntntFrm *pCnt, sal_uInt8 nInv )
pLastSctCnt = NULL;
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- ASSERT( !pLastTabCnt, "Where's the last TabCntnt?" );
+ OSL_ENSURE( !pLastTabCnt, "Where's the last TabCntnt?" );
#endif
}
@@ -4024,3 +3944,4 @@ void SwRootFrm::InvalidateAllObjPos()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index dc8fe3ad9fdd..a537bd10e515 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,16 +37,13 @@
#include <txtfrm.hxx>
#include <pagefrm.hxx>
#include <frmtool.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <dflyobj.hxx>
#include <dcontact.hxx>
#include <frmfmt.hxx>
#include <fmtornt.hxx>
-// --> OD 2006-03-15 #i62875#
+// #i62875#
#include <fmtfollowtextflow.hxx>
-// <--
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <ndtxt.hxx>
@@ -63,10 +61,9 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj )
mpAnchoredObj( 0 ),
mpAnchorFrm( 0 ),
mpContact( 0 ),
- // --> OD 2006-03-15 #i62875#
+ // #i62875#
mbFollowTextFlow( false ),
mbDoNotCaptureAnchoredObj( false )
- // <--
{
#if OSL_DEBUG_LEVEL > 1
// assert, if object isn't of excepted type
@@ -76,7 +73,7 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj )
( !mrDrawObj.ISA(SdrVirtObj) && // 'master' drawing object
!mrDrawObj.ISA(SwFlyDrawObj) ); // - indirectly checked
(void) bObjOfExceptedType;
- ASSERT( bObjOfExceptedType,
+ OSL_ENSURE( bObjOfExceptedType,
"SwAnchoredObjectPosition(..) - object of unexcepted type!" );
#endif
@@ -85,7 +82,6 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj )
/** determine information about object
- OD 30.07.2003 #110978#
members <mbIsObjFly>, <mpFrmOfObj>, <mpAnchorFrm>, <mpContact>,
<mbFollowTextFlow> and <mbDoNotCaptureAnchoredObj> are set
@@ -101,36 +97,35 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj()
// determine contact object
{
mpContact = static_cast<SwContact*>(GetUserCall( &mrDrawObj ));
- ASSERT( mpContact,
+ OSL_ENSURE( mpContact,
"SwAnchoredObjectPosition::_GetInfoAboutObj() - missing SwContact-object." );
}
// determine anchored object, the object belongs to
{
- // OD 2004-03-30 #i26791#
+ // #i26791#
mpAnchoredObj = mpContact->GetAnchoredObj( &mrDrawObj );
- ASSERT( mpAnchoredObj,
+ OSL_ENSURE( mpAnchoredObj,
"SwAnchoredObjectPosition::_GetInfoAboutObj() - missing anchored object." );
}
// determine frame, the object is anchored at
{
- // OD 2004-03-23 #i26791#
+ // #i26791#
mpAnchorFrm = mpAnchoredObj->AnchorFrm();
- ASSERT( mpAnchorFrm,
+ OSL_ENSURE( mpAnchorFrm,
"SwAnchoredObjectPosition::_GetInfoAboutObj() - missing anchor frame." );
}
// determine format the object belongs to
{
- // --> OD 2004-07-01 #i28701#
+ // #i28701#
mpFrmFmt = &mpAnchoredObj->GetFrmFmt();
- ASSERT( mpFrmFmt,
+ OSL_ENSURE( mpFrmFmt,
"<SwAnchoredObjectPosition::_GetInfoAboutObj() - missing frame format." );
}
- // --> OD 2006-03-15 #i62875#
- // determine attribute value of <Follow-Text-Flow>
+ // #i62875# - determine attribute value of <Follow-Text-Flow>
{
mbFollowTextFlow = mpFrmFmt->GetFollowTextFlow().GetValue();
}
@@ -144,7 +139,6 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj()
mbDoNotCaptureAnchoredObj = !mbIsObjFly && !mbFollowTextFlow &&
mpFrmFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE);
}
- // <--
}
SwAnchoredObjectPosition::~SwAnchoredObjectPosition()
@@ -165,7 +159,7 @@ const SwRect* SwAnchoredObjectPosition::ToCharRect() const
return NULL;
}
-// OD 12.11.2003 #i22341#
+// #i22341#
SwTwips SwAnchoredObjectPosition::ToCharTopOfLine() const
{
return 0L;
@@ -174,7 +168,7 @@ SwTwips SwAnchoredObjectPosition::ToCharTopOfLine() const
/** helper method to determine top of a frame for the vertical
object positioning
- OD 2004-03-11 #i11860#
+ #i11860#
@author OD
*/
@@ -212,9 +206,9 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
SwTwips nHeight = 0;
SwTwips nOffset = 0;
SWRECTFN( (&_rVertOrientFrm) )
- // OD 2004-03-11 #i11860# - top of <_rVertOrientFrm> for object positioning
+ // #i11860# - top of <_rVertOrientFrm> for object positioning
const SwTwips nVertOrientTop = _GetTopForObjPos( _rVertOrientFrm, fnRect, bVert );
- // OD 2004-03-11 #i11860# - upper space amount of <_rVertOrientFrm> considered
+ // #i11860# - upper space amount of <_rVertOrientFrm> considered
// for previous frame
const SwTwips nVertOrientUpperSpaceForPrevFrmAndPageGrid =
_rVertOrientFrm.IsTxtFrm()
@@ -225,7 +219,7 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
{
case text::RelOrientation::FRAME:
{
- // OD 2004-03-11 #i11860# - consider upper space of previous frame
+ // #i11860# - consider upper space of previous frame
nHeight = (_rVertOrientFrm.Frm().*fnRect->fnGetHeight)() -
nVertOrientUpperSpaceForPrevFrmAndPageGrid;
nOffset = 0;
@@ -234,7 +228,7 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
case text::RelOrientation::PRINT_AREA:
{
nHeight = (_rVertOrientFrm.Prt().*fnRect->fnGetHeight)();
- // OD 2004-03-11 #i11860# - consider upper space of previous frame
+ // #i11860# - consider upper space of previous frame
nOffset = (_rVertOrientFrm.*fnRect->fnGetTopMargin)() -
nVertOrientUpperSpaceForPrevFrmAndPageGrid;
// if aligned to page in horizontal layout, consider header and
@@ -296,7 +290,7 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
}
}
break;
- // OD 12.11.2003 #i22341# - vertical alignment at top of line
+ // #i22341# - vertical alignment at top of line
case text::RelOrientation::TEXT_LINE:
{
if ( IsAnchoredToChar() )
@@ -306,7 +300,7 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObjectPosition::_GetVertAlignmentValues(..)> - invalid relative alignment" );
}
}
@@ -321,19 +315,15 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObjectPosition::_GetVertAlignmentValues(..)> - invalid relative alignment" );
}
}
break;
// no break here, because text::RelOrientation::CHAR is invalid, if !mbAnchorToChar
default:
- //case text::RelOrientation::PAGE_LEFT: not valid for vertical alignment
- //case text::RelOrientation::PAGE_RIGHT: not valid for vertical alignment
- //case text::RelOrientation::FRAME_LEFT: not valid for vertical alignment
- //case text::RelOrientation::FRAME_RIGHT: not valid for vertical alignment
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObjectPosition::_GetVertAlignmentValues(..)> - invalid relative alignment" );
}
}
@@ -342,7 +332,7 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues(
_orAlignAreaOffset = nOffset;
}
-// --> OD 2004-06-17 #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos>
+// #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos>
SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
const SwFrm& _rVertOrientFrm,
const SwFrm& _rPageAlignLayFrm,
@@ -401,12 +391,12 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObjectPosition::_GetVertRelPos(..) - invalid vertical positioning" );
}
}
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
_roVertOffsetToFrmAnchorPos = nAlignAreaOffset;
return nRelPosY;
@@ -415,10 +405,10 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos(
/** adjust calculated vertical in order to keep object inside
'page' alignment layout frame.
- OD 2004-07-01 #i28701# - parameter <nTopOfAnch> and <bVert> added
- OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
- OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
- OD 2006-03-15 #i62875# - method now private and renamed.
+ #i28701# - parameter <_nTopOfAnch> and <_bVert> added
+ #i31805# - add parameter <_bCheckBottom>
+ #i26945# - add parameter <_bFollowTextFlow>
+ #i62875# - method now private and renamed.
OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
@author OD
@@ -437,7 +427,7 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
// determine the area of 'page' alignment frame, to which the vertical
// position is restricted.
- // --> OD 2004-07-06 #i28701# - Extend restricted area for the vertical
+ // #i28701# - Extend restricted area for the vertical
// position to area of the page frame, if wrapping style influence is
// considered on object positioning. Needed to avoid layout loops in the
// object positioning algorithm considering the wrapping style influence
@@ -445,7 +435,7 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
// to its environment (e.g. page header/footer).
SwRect aPgAlignArea;
{
- // --> OD 2004-10-08 #i26945# - no extension of restricted area, if
+ // #i26945# - no extension of restricted area, if
// object's attribute follow text flow is set and its inside a table
if ( GetFrmFmt().getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) &&
( !bFollowTextFlow ||
@@ -461,7 +451,7 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
if ( bVert )
{
- // --> OD 2009-09-01 #mongolianlayout#
+ // #i31805# - consider value of <_bCheckBottom>
if ( !bVertL2R )
// <--
{
@@ -473,12 +463,12 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
nTopOfAnch -
aObjSize.Width();
}
+ // #i32964# - correction
if ( nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() )
{
nAdjustedRelPosY = nTopOfAnch - aPgAlignArea.Right();
}
}
- // --> OD 2009-09-01 #mongolianlayout#
else
{
if ( bCheckBottom &&
@@ -494,10 +484,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
nAdjustedRelPosY = aPgAlignArea.Left() - nTopOfAnch;
}
}
- // <--
}
else
{
+ // #i31805# - consider value of <bCheckBottom>
if ( bCheckBottom &&
nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() >
aPgAlignArea.Top() + aPgAlignArea.Height() )
@@ -518,7 +508,7 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
/** adjust calculated horizontal in order to keep object inside
'page' alignment layout frame.
- OD 2006-03-15 #i62875# - method now private and renamed.
+ #i62875# - method now private and renamed.
@author OD
*/
@@ -647,10 +637,8 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie
case text::RelOrientation::FRAME_RIGHT:
{
// align at right border of anchor frame
- // OD 19.08.2003 #110978# - unify and simplify
+ // Unify and simplify
nWidth = (_rHoriOrientFrm.*fnRect->fnGetRightMargin)();
- //nOffset = (_rHoriOrientFrm.Frm().*fnRect->fnGetWidth)() -
- // nWidth;
nOffset = (_rHoriOrientFrm.Prt().*fnRect->fnGetRight)();
}
break;
@@ -707,7 +695,6 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie
break;
}
default:
- // case text::RelOrientation::FRAME:
{
nWidth = (_rHoriOrientFrm.Frm().*fnRect->fnGetWidth)();
nOffset = _rHoriOrientFrm.IsTxtFrm() ?
@@ -834,7 +821,7 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX(
}
else if ( bToggle || ( !_rHoriOrient.IsPosToggle() && bR2L ) )
{
- // OD 04.08.2003 #110978# - correction: consider <nOffset> also for
+ // Correction: consider <nOffset> also for
// toggling from left to right.
nRelPosX += nWidth - nObjWidth - _rHoriOrient.GetPos();
}
@@ -861,40 +848,6 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX(
nRelPosX += (*fnRect->fnXDiff)( nLeftOrient, nLeftAnchor );
}
- // OD 2004-05-21 #i28701# - deactivate follow code
-// // adjust relative horizontal position, if object is manual horizontal
-// // positioned (not 'page' aligned) and orients not at the anchor frame,
-// // but it overlaps anchor frame.
-// if ( _rHoriOrient.GetHoriOrient() == text::HoriOrientation::NONE && !bAlignedRelToPage &&
-// &rAnchorFrm != &_rHoriOrientFrm )
-// {
-// // E.g.: consider a columned page/section with an horizontal
-// // negative positioned object.
-// // OD 2004-03-23 #i26791#
-// const SwRect& rObjRect = GetAnchoredObj().GetObjRect();
-// if( bVert )
-// {
-// if( _rHoriOrientFrm.Frm().Top() > rAnchorFrm.Frm().Bottom() &&
-// rObjRect.Right() > rAnchorFrm.Frm().Left() )
-// {
-// const SwTwips nProposedPosX = nRelPosX + rAnchorFrm.Frm().Top();
-// if ( nProposedPosX < rAnchorFrm.Frm().Bottom() )
-// nRelPosX = rAnchorFrm.Frm().Height() + 1;
-// }
-// }
-// else
-// {
-// if( _rHoriOrientFrm.Frm().Left() > rAnchorFrm.Frm().Right() &&
-// rObjRect.Top() < rAnchorFrm.Frm().Bottom() )
-// {
-// // OD 04.08.2003 #110978# - correction: use <nRelPosX>
-// // instead of <aRelPos.X()>
-// const SwTwips nProposedPosX = nRelPosX + rAnchorFrm.Frm().Left();
-// if ( nProposedPosX < rAnchorFrm.Frm().Right() )
-// nRelPosX = rAnchorFrm.Frm().Width() + 1;
-// }
-// }
-// }
// adjust calculated relative horizontal position, in order to
// keep object inside 'page' alignment layout frame
const SwFrm& rEnvironmentLayFrm =
@@ -917,7 +870,7 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX(
bEvenPage );
}
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
_roHoriOffsetToFrmAnchorPos = nOffset;
return nRelPosX;
@@ -943,17 +896,17 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(
const bool _bEvenPage
) const
{
- // OD 2004-03-23 #i26791#
+ // #i26791#
if ( !GetAnchorFrm().ISA(SwTxtFrm) ||
!GetAnchoredObj().ISA(SwFlyAtCntFrm) )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(..) - usage for wrong anchor type" );
return _nProposedRelPosX;
}
const SwTxtFrm& rAnchorTxtFrm = static_cast<const SwTxtFrm&>(GetAnchorFrm());
- // OD 2004-03-23 #i26791#
+ // #i26791#
const SwFlyAtCntFrm& rFlyAtCntFrm =
static_cast<const SwFlyAtCntFrm&>(GetAnchoredObj());
const SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() );
@@ -1133,11 +1086,11 @@ bool SwAnchoredObjectPosition::_Minor( sal_Int16 _eRelOrient1,
// draw aside order for left horizontal position
//! one array entry for each value in text::RelOrientation
- static sal_uInt16 __READONLY_DATA aLeft[ 10 ] =
+ static sal_uInt16 const 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 sal_uInt16 __READONLY_DATA aRight[ 10 ] =
+ static sal_uInt16 const 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
@@ -1148,3 +1101,5 @@ bool SwAnchoredObjectPosition::_Minor( sal_Int16 _eRelOrient1,
return bRetVal;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index 7c8118dbe3e2..a5facaf474b9 100644
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <frame.hxx>
#include <txtfrm.hxx>
#include <flyfrms.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <dcontact.hxx>
#include <frmfmt.hxx>
#include <frmatr.hxx>
@@ -85,7 +84,7 @@ SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition()
*/
const SwTxtFrm& SwAsCharAnchoredObjectPosition::GetAnchorTxtFrm() const
{
- ASSERT( GetAnchorFrm().ISA(SwTxtFrm),
+ OSL_ENSURE( GetAnchorFrm().ISA(SwTxtFrm),
"SwAsCharAnchoredObjectPosition::GetAnchorTxtFrm() - wrong anchor frame type" );
return static_cast<const SwTxtFrm&>(GetAnchorFrm());
@@ -290,7 +289,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
rAnchorFrm.SwitchHorizontalToVertical( aAnchorPos );
// --> OD 2005-03-09 #i44347# - keep last object rectangle at anchored object
- ASSERT ( GetAnchoredObj().ISA(SwAnchoredDrawObject),
+ OSL_ENSURE( GetAnchoredObj().ISA(SwAnchoredDrawObject),
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong type of anchored object." );
SwAnchoredDrawObject& rAnchoredDrawObj =
static_cast<SwAnchoredDrawObject&>( GetAnchoredObj() );
@@ -318,7 +317,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
aRelAttr = Point( 0, nRelPos );
// OD 2004-03-23 #i26791#
- ASSERT( GetAnchoredObj().ISA(SwFlyInCntFrm),
+ OSL_ENSURE( GetAnchoredObj().ISA(SwFlyInCntFrm),
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong anchored object." );
const SwFlyInCntFrm& rFlyInCntFrm =
static_cast<const SwFlyInCntFrm&>(GetAnchoredObj());
@@ -339,7 +338,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
aObjBoundRect.Height( aObjBoundRect.Height() + rULSpace.GetLower() );
}
}
- ASSERT( (rFlyInCntFrm.Frm().*fnRect->fnGetHeight)(),
+ OSL_ENSURE( (rFlyInCntFrm.Frm().*fnRect->fnGetHeight)(),
"SwAnchoredObjectPosition::CalcPosition(..) - fly frame has an invalid height" );
}
@@ -456,3 +455,4 @@ sal_uInt8 SwAsCharAnchoredObjectPosition::GetLineAlignment() const
return mnLineAlignment;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
index 8bf87bc6ea92..80122c27905c 100644
--- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
+++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,8 +47,6 @@ SwEnvironmentOfAnchoredObject::~SwEnvironmentOfAnchoredObject()
/** determine environment layout frame for possible horizontal object positions
- OD 05.11.2003
-
@author OD
*/
const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(
@@ -57,10 +56,9 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(
if ( !mbFollowTextFlow )
{
- // --> OD 2005-01-20 #118546# - no exception any more for page alignment.
+ // No exception any more for page alignment.
// the page frame determines the horizontal layout environment.
pHoriEnvironmentLayFrm = _rHoriOrientFrm.FindPageFrm();
- // <--
}
else
{
@@ -69,22 +67,18 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(
!pHoriEnvironmentLayFrm->IsPageFrm() )
{
pHoriEnvironmentLayFrm = pHoriEnvironmentLayFrm->GetUpper();
- ASSERT( pHoriEnvironmentLayFrm,
+ OSL_ENSURE( pHoriEnvironmentLayFrm,
"SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(..) - no page|fly|cell frame found" );
}
}
- ASSERT( pHoriEnvironmentLayFrm->ISA(SwLayoutFrm),
+ OSL_ENSURE( pHoriEnvironmentLayFrm->ISA(SwLayoutFrm),
"SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(..) - found frame isn't a layout frame" );
return static_cast<const SwLayoutFrm&>(*pHoriEnvironmentLayFrm);
}
/** determine environment layout frame for possible vertical object positions
-
- OD 05.11.2003
-
- @author OD
*/
const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(
const SwFrm& _rVertOrientFrm ) const
@@ -93,10 +87,9 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(
if ( !mbFollowTextFlow )
{
- // --> OD 2005-01-20 #118546# - no exception any more for page alignment.
+ // No exception any more for page alignment.
// the page frame determines the vertical layout environment.
pVertEnvironmentLayFrm = _rVertOrientFrm.FindPageFrm();
- // <--
}
else
{
@@ -109,13 +102,15 @@ const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(
!pVertEnvironmentLayFrm->IsPageFrm() )
{
pVertEnvironmentLayFrm = pVertEnvironmentLayFrm->GetUpper();
- ASSERT( pVertEnvironmentLayFrm,
+ OSL_ENSURE( pVertEnvironmentLayFrm,
"SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(..) - proposed frame not found" );
}
}
- ASSERT( pVertEnvironmentLayFrm->ISA(SwLayoutFrm),
+ OSL_ENSURE( pVertEnvironmentLayFrm->ISA(SwLayoutFrm),
"SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(..) - found frame isn't a layout frame" );
return static_cast<const SwLayoutFrm&>(*pVertEnvironmentLayFrm);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 71e85c9d94fa..b4795dbd947a 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,8 @@
#include <txtfrm.hxx>
#include <pagefrm.hxx>
#include <sectfrm.hxx>
-// --> OD 2004-10-15 #i26945#
+// #i26945#
#include <tabfrm.hxx>
-// <--
#include <frmfmt.hxx>
#include <IDocumentSettingAccess.hxx>
#include <fmtsrnd.hxx>
@@ -58,12 +58,12 @@ using namespace ::com::sun::star;
SwToCntntAnchoredObjectPosition::SwToCntntAnchoredObjectPosition( SdrObject& _rDrawObj )
: SwAnchoredObjectPosition ( _rDrawObj ),
mpVertPosOrientFrm( 0 ),
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
maOffsetToFrmAnchorPos( Point() ),
mbAnchorToChar ( false ),
mpToCharOrientFrm( 0 ),
mpToCharRect( 0 ),
- // OD 12.11.2003 #i22341#
+ // #i22341#
mnToCharTopOfLine( 0 )
{}
@@ -85,7 +85,7 @@ const SwRect* SwToCntntAnchoredObjectPosition::ToCharRect() const
return mpToCharRect;
}
-// OD 12.11.2003 #i22341#
+// #i22341#
SwTwips SwToCntntAnchoredObjectPosition::ToCharTopOfLine() const
{
return mnToCharTopOfLine;
@@ -93,13 +93,13 @@ SwTwips SwToCntntAnchoredObjectPosition::ToCharTopOfLine() const
SwTxtFrm& SwToCntntAnchoredObjectPosition::GetAnchorTxtFrm() const
{
- ASSERT( GetAnchorFrm().ISA(SwTxtFrm),
+ OSL_ENSURE( GetAnchorFrm().ISA(SwTxtFrm),
"SwToCntntAnchoredObjectPosition::GetAnchorTxtFrm() - wrong anchor frame type" );
return static_cast<SwTxtFrm&>(GetAnchorFrm());
}
-// --> OD 2004-07-20 #i23512#
+// #i23512#
bool lcl_DoesVertPosFits( const SwTwips _nRelPosY,
const SwTwips _nAvail,
const SwLayoutFrm* _pUpperOfOrientFrm,
@@ -132,19 +132,17 @@ bool lcl_DoesVertPosFits( const SwTwips _nRelPosY,
}
else if ( _pUpperOfOrientFrm->IsInTab() && _bGrowInTable )
{
- // --> OD 2005-06-08 #i45085# - check, if upper frame would grow the
+ // #i45085# - check, if upper frame would grow the
// excepted amount of twips.
const SwTwips nTwipsGrown = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm)->
Grow( _nRelPosY - _nAvail, sal_True ) > 0;
bVertPosFits = ( nTwipsGrown == ( _nRelPosY - _nAvail ) );
- // <--
if ( bVertPosFits )
_orpLayoutFrmToGrow = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm);
}
return bVertPosFits;
}
-// <--
void SwToCntntAnchoredObjectPosition::CalcPosition()
{
@@ -173,10 +171,10 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const bool bNoSurround = rSurround.GetSurround() == SURROUND_NONE;
const bool bWrapThrough = rSurround.GetSurround() == SURROUND_THROUGHT;
- // OD 29.10.2003 #110978# - new class <SwEnvironmentOfAnchoredObject>
+ // new class <SwEnvironmentOfAnchoredObject>
SwEnvironmentOfAnchoredObject aEnvOfObj( DoesObjFollowsTextFlow() );
- // OD 30.09.2003 #i18732# - grow only, if object has to follow the text flow
+ // #i18732# - grow only, if object has to follow the text flow
const bool bGrow = DoesObjFollowsTextFlow() &&
( !GetAnchorFrm().IsInTab() ||
!rFrmFmt.GetFrmSize().GetHeightPercent() );
@@ -189,7 +187,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// local variable keeping the calculated relative position; initialized with
// current relative position.
- // OD 2004-03-24 #i26791# - use new object instance of <SwAnchoredObject>
+ // #i26791# - use new object instance of <SwAnchoredObject>
Point aRelPos( GetAnchoredObj().GetCurrRelPos() );
SwTwips nRelDiff = 0;
@@ -206,37 +204,34 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
if ( mbAnchorToChar )
{
const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor();
- // OD 2004-03-24 #i26791# - use new object instance of <SwAnchoredObject>
- // OD 2005-01-12 - Due to table break algorithm the character
+ // #i26791# - use new object instance of <SwAnchoredObject>
+ // Due to table break algorithm the character
// rectangle can have no height. Thus, check also the width
if ( ( !GetAnchoredObj().GetLastCharRect().Height() &&
!GetAnchoredObj().GetLastCharRect().Width() ) ||
!GetAnchoredObj().GetLastTopOfLine() )
{
- // --> OD 2010-07-02 #i111886#
+ // #i111886#
// Check existence of paragraph portion information in order
// to avoid formatting which could cause deletion of follow frames.
GetAnchoredObj().CheckCharRectAndTopOfLine();
- // <--
- // OD 2005-01-12 - Due to table break algorithm the character
+
+ // Due to table break algorithm the character
// rectangle can have no height. Thus, check also the width
if ( ( !GetAnchoredObj().GetLastCharRect().Height() &&
!GetAnchoredObj().GetLastCharRect().Width() ) ||
!GetAnchoredObj().GetLastTopOfLine() )
{
- // --> OD 2005-01-12 - get default for <mpVertPosOrientFrm>,
- // if it's not set.
+ // Get default for <mpVertPosOrientFrm>, if it's not set.
if ( !mpVertPosOrientFrm )
{
mpVertPosOrientFrm = rAnchorTxtFrm.GetUpper();
}
- // <--
return;
}
}
mpToCharRect = &(GetAnchoredObj().GetLastCharRect());
- // OD 12.11.2003 #i22341# - get top of line, in which the anchor
- // character is.
+ // #i22341# - get top of line, in which the anchor character is.
mnToCharTopOfLine = GetAnchoredObj().GetLastTopOfLine();
pOrientFrm = &(const_cast<SwTxtFrm&>(rAnchorTxtFrm).GetFrmAtOfst(
rAnch.GetCntntAnchor()->nContent.GetIndex() ) );
@@ -251,14 +246,14 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// determine vertical positioning and alignment attributes
SwFmtVertOrient aVert( rFrmFmt.GetVertOrient() );
- // OD 22.09.2003 #i18732# - determine layout frame for vertical
+ // #i18732# - determine layout frame for vertical
// positions aligned to 'page areas'.
const SwLayoutFrm& rPageAlignLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pOrientFrm );
if ( aVert.GetVertOrient() != text::VertOrientation::NONE )
{
- // OD 22.09.2003 #i18732# - adjustments for follow text flow or not
+ // #i18732# - adjustments for follow text flow or not
// AND vertical alignment at 'page areas'.
SwTwips nAlignAreaHeight;
SwTwips nAlignAreaOffset;
@@ -301,7 +296,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// no break here
case text::VertOrientation::TOP:
{
- // OD 12.11.2003 #i22341# - special case for vertical
+ // #i22341# - special case for vertical
// alignment at top of line
if ( mbAnchorToChar &&
aVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
@@ -314,7 +309,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
}
break;
- // OD 14.11.2003 #i22341#
+ // #i22341#
case text::VertOrientation::LINE_TOP:
{
if ( mbAnchorToChar &&
@@ -324,7 +319,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwToCntntAnchoredObjectPosition::CalcPosition()> - unknown combination of vertical position and vertical alignment." );
}
}
@@ -334,7 +329,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nRelPosY += (nAlignAreaHeight / 2) - (nObjHeight / 2);
}
break;
- // OD 14.11.2003 #i22341#
+ // #i22341#
case text::VertOrientation::LINE_CENTER:
{
if ( mbAnchorToChar &&
@@ -344,7 +339,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwToCntntAnchoredObjectPosition::CalcPosition()> - unknown combination of vertical position and vertical alignment." );
}
}
@@ -360,7 +355,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- // OD 12.11.2003 #i22341# - special case for vertical
+ // #i22341# - special case for vertical
// alignment at top of line
if ( mbAnchorToChar &&
aVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
@@ -375,7 +370,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
}
break;
- // OD 14.11.2003 #i22341#
+ // #i22341#
case text::VertOrientation::LINE_BOTTOM:
{
if ( mbAnchorToChar &&
@@ -385,7 +380,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwToCntntAnchoredObjectPosition::CalcPosition()> - unknown combination of vertical position and vertical alignment." );
}
}
@@ -396,18 +391,18 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// adjust relative position by distance between anchor frame and
// the frame, the object is oriented at.
- // OD 2004-05-21 #i28701# - correction: adjust relative position,
+ // #i28701# - correction: adjust relative position,
// only if the floating screen object has to follow the text flow.
if ( DoesObjFollowsTextFlow() && pOrientFrm != &rAnchorTxtFrm )
{
- // OD 2004-03-11 #i11860# - use new method <_GetTopForObjPos>
+ // #i11860# - use new method <_GetTopForObjPos>
// to get top of frame for object positioning.
const SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrm, fnRect, bVert );
nRelPosY += (*fnRect->fnYDiff)( nTopOfOrient,
_GetTopForObjPos( rAnchorTxtFrm, fnRect, bVert ) );
}
- // --> OD 2005-02-07 #i42124# - capture object inside vertical
+ // #i42124# - capture object inside vertical
// layout environment.
{
const SwTwips nTopOfAnch =
@@ -421,7 +416,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
DoesObjFollowsTextFlow(),
bCheckBottom );
}
- // <--
+
// keep calculated relative vertical position - needed for filters
// (including the xml-filter)
{
@@ -438,7 +433,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
// determine absolute 'vertical' position, depending on layout-direction
- // --> OD 2004-06-17 #i26791# - determine offset to 'vertical' frame
+ // #i26791# - determine offset to 'vertical' frame
// anchor position, depending on layout-direction
if ( bVert )
{
@@ -452,14 +447,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
}
- // OD 29.10.2003 #110978# - determine upper of frame vertical position
- // is oriented at.
- // OD 2004-05-21 #i28701# - determine 'virtual' anchor frame.
+ // Determine upper of frame vertical position is oriented at.
+ // #i28701# - determine 'virtual' anchor frame.
// This frame is used in the following instead of the 'real' anchor
// frame <rAnchorTxtFrm> for the 'vertical' position in all cases.
const SwLayoutFrm* pUpperOfOrientFrm = 0L;
{
- // OD 2004-05-21 #i28701# - As long as the anchor frame is on the
+ // #i28701# - As long as the anchor frame is on the
// same page as <pOrientFrm> and the vertical position isn't aligned
// automatic at the anchor character or the top of the line of the
// anchor character, the anchor frame determines the vertical position.
@@ -480,7 +474,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
// ignore one-column sections.
- // --> OD 2004-07-20 #i23512# - correction: also ignore one-columned
+ // #i23512# - correction: also ignore one-columned
// sections with footnotes/endnotes
if ( pUpperOfOrientFrm->IsInSct() )
{
@@ -497,17 +491,17 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// local variable <nRelPosY> for calculation of relative vertical
// distance to anchor.
SwTwips nRelPosY = 0;
- // --> OD 2004-06-17 #i26791# - local variable <nVertOffsetToFrmAnchorPos>
+ // #i26791# - local variable <nVertOffsetToFrmAnchorPos>
// for determination of the 'vertical' offset to the frame anchor
// position
SwTwips nVertOffsetToFrmAnchorPos( 0L );
- // OD 12.11.2003 #i22341# - add special case for vertical alignment
+ // #i22341# - add special case for vertical alignment
// at top of line.
if ( mbAnchorToChar &&
( aVert.GetRelationOrient() == text::RelOrientation::CHAR ||
aVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE ) )
{
- // OD 2004-03-11 #i11860# - use new method <_GetTopForObjPos>
+ // #i11860# - use new method <_GetTopForObjPos>
// to get top of frame for object positioning.
SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrm, fnRect, bVert );
if ( aVert.GetRelationOrient() == text::RelOrientation::CHAR )
@@ -525,20 +519,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- // OD 2004-05-21 #i28701# - correction: use <pAnchorFrmForVertPos>
+ // #i28701# - correction: use <pAnchorFrmForVertPos>
// instead of <pOrientFrm> and do not adjust relative position
// to get correct vertical position.
nVertOffsetToFrmAnchorPos = 0L;
- // OD 2004-03-11 #i11860# - use new method <_GetTopForObjPos>
+ // #i11860# - use new method <_GetTopForObjPos>
// to get top of frame for object positioning.
const SwTwips nTopOfOrient =
_GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
- // OD 02.10.2002 #102646# - increase <nRelPosY> by margin height,
+ // Increase <nRelPosY> by margin height,
// if position is vertical aligned to "paragraph text area"
if ( aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA )
{
- // OD 2004-03-11 #i11860# - consider upper space amount
- // of previous frame
+ // #i11860# - consider upper space amount of previous frame
SwTwips nTopMargin = (pAnchorFrmForVertPos->*fnRect->fnGetTopMargin)();
if ( pAnchorFrmForVertPos->IsTxtFrm() )
{
@@ -547,7 +540,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
nVertOffsetToFrmAnchorPos += nTopMargin;
}
- // OD 22.09.2003 #i18732# - adjust <nRelPosY> by difference
+ // #i18732# - adjust <nRelPosY> by difference
// between 'page area' and 'anchor' frame, if position is
// vertical aligned to 'page areas'
else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME )
@@ -578,23 +571,23 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// <nAvail>: space, which is available in the current
// layout frame
- // --> OD 2004-06-17 #i26791# - determine offset to 'vertical'
+ // #i26791# - determine offset to 'vertical'
// frame anchor position, depending on layout-direction
if ( bVert )
maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos;
else
maOffsetToFrmAnchorPos.Y() = nVertOffsetToFrmAnchorPos;
// <--
- // OD 2004-03-11 #i11860# - use new method <_GetTopForObjPos>
+ // #i11860# - use new method <_GetTopForObjPos>
// to get top of frame for object positioning.
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( nRelPosY <= 0 )
{
- // OD 08.09.2003 #110354# - allow negative position, but keep it
+ // Allow negative position, but keep it
// inside environment layout frame.
const SwLayoutFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- // --> OD 2004-07-22 #i31805# - do not check, if bottom of
+ // #i31805# - do not check, if bottom of
// anchored object would fit into environment layout frame, if
// anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
@@ -602,7 +595,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
- // <--
if ( bVert )
aRelPos.X() = nRelPosY;
else
@@ -617,7 +609,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const bool bInFtn = pAnchorFrmForVertPos->IsInFtn();
while ( nRelPosY )
{
- // --> OD 2004-07-20 #i23512# - correction:
+ // #i23512# - correction:
// consider section frame for grow in online layout.
// use new local method <lcl_DoesVertPosFits(..)>
SwLayoutFrm* pLayoutFrmToGrow = 0L;
@@ -631,11 +623,11 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
(*fnRect->fnYDiff)( (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)(),
nTopOfAnch ) -
nAvail + nRelPosY;
- // --> OD 2004-07-06 #i28701# - adjust calculated
+ // #i28701# - adjust calculated
// relative vertical position to object's environment.
const SwFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- // --> OD 2004-08-20 - do not check, if bottom of
+ // Do not check, if bottom of
// anchored object would fit into environment layout
// frame, if anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
@@ -644,13 +636,12 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nTmpRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
- // <--
if ( bVert )
aRelPos.X() = nTmpRelPosY;
else
aRelPos.Y() = nTmpRelPosY;
- // --> OD 2004-07-20 #i23512# - use local variable
+ // #i23512# - use local variable
// <pLayoutFrmToGrow> provided by new method
// <lcl_DoesVertPosFits(..)>.
if ( pLayoutFrmToGrow )
@@ -662,14 +653,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- // --> OD 2004-10-04 #i26495# - floating screen objects,
+ // #i26495# - floating screen objects,
// which are anchored inside a table, doesn't follow
// the text flow.
if ( DoesObjFollowsTextFlow() &&
!( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ||
aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) &&
!GetAnchorFrm().IsInTab() )
- // <--
{
if ( bMoveable )
{
@@ -710,7 +700,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
else
{
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "<SwToCntntAnchoredObjectPosition::CalcPosition()> - code under investigation by OD, please inform OD about this assertion!" );
+ OSL_ENSURE( false, "<SwToCntntAnchoredObjectPosition::CalcPosition()> - code under investigation by OD, please inform OD about this assertion!" );
#endif
nRelDiff = nRelPosY;
nRelPosY = 0;
@@ -724,7 +714,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- // OD 06.10.2003 #i18732# - do not follow text flow respectively
+ // #i18732# - do not follow text flow respectively
// align at 'page areas', but stay inside given environment
const SwFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
@@ -771,7 +761,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// grow environment under certain conditions
// ignore one-column sections.
- // --> OD 2004-07-20 #i23512# - correction: also ignore one-columned
+ // #i23512# - correction: also ignore one-columned
// sections with footnotes/endnotes
if ( pUpperOfOrientFrm->IsInSct() )
{
@@ -786,7 +776,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
(pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() );
if( nDist < 0 )
{
- // --> OD 2004-07-20 #i23512# - correction:
+ // #i23512# - correction:
// consider section frame for grow in online layout and
// consider page alignment for grow in table.
SwLayoutFrm* pLayoutFrmToGrow = 0L;
@@ -827,7 +817,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)(
(pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() );
- // --> OD 2004-10-04 #i26945# - floating screen objects, which are
+ // #i26945# - floating screen objects, which are
// anchored inside a table, doesn't follow the text flow. But, they
// have to stay inside its layout environment.
if ( nDist < 0 && pOrientFrm->IsInTab() )
@@ -893,7 +883,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
}
else
{
- // <--
// follow text flow
const bool bInFtn = rAnchorTxtFrm.IsInFtn();
while( bMoveable && nDist < 0 )
@@ -904,7 +893,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwLayoutFrm* pTmp = pUpperOfOrientFrm->FindSctFrm()->GetUpper();
nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)(
(pTmp->*fnRect->fnGetPrtBottom)() );
- // --> OD 2004-11-01 #i23129# - Try to flow into next
+ // #i23129# - Try to flow into next
// section|section column. Thus, do *not* leave section
// area, if anchored object doesn't fit into upper of section.
// But the anchored object is allowed to overlap bottom
@@ -913,7 +902,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
break;
}
- // <--
}
if ( !bInSct &&
(GetAnchoredObj().GetObjRect().*fnRect->fnGetTop)() ==
@@ -926,7 +914,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
? MAKEPAGE_NOSECTION
: ( bInFtn ? MAKEPAGE_NONE : MAKEPAGE_APPEND ) ),
sal_True, &rAnchorTxtFrm );
- // OD 06.10.2003 #110978# - correction:
+ // correction:
// If anchor is in footnote and proposed next layout environment
// isn't a footnote frame, object can't follow the text flow
if ( bInFtn && pNextLay && !pNextLay->IsFtnFrm() )
@@ -972,7 +960,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)(
(pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() );
}
- // --> OD 2004-11-01 #i23129# - leave section area
+ // #i23129# - leave section area
else if ( bInSct )
{
const SwLayoutFrm* pTmp = pUpperOfOrientFrm->FindSctFrm()->GetUpper();
@@ -983,7 +971,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
else
break;
}
- // <--
}
else if ( bInSct )
{
@@ -1034,20 +1021,20 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() );
// determine frame, horizontal position is oriented at.
- // OD 2004-05-21 #i28701# - If floating screen object doesn't follow
+ // #i28701# - If floating screen object doesn't follow
// the text flow, its horizontal position is oriented at <pOrientFrm>.
const SwFrm* pHoriOrientFrm = DoesObjFollowsTextFlow()
? &_GetHoriVirtualAnchor( *mpVertPosOrientFrm )
: pOrientFrm;
- // --> OD 2004-06-17 #i26791# - get 'horizontal' offset to frame anchor position.
+ // #i26791# - get 'horizontal' offset to frame anchor position.
SwTwips nHoriOffsetToFrmAnchorPos( 0L );
SwTwips nRelPosX = _CalcRelPosX( *pHoriOrientFrm, aEnvOfObj,
aHori, rLR, rUL, bWrapThrough,
( bVert ? aRelPos.X() : aRelPos.Y() ),
nHoriOffsetToFrmAnchorPos );
- // --> OD 2004-06-17 #i26791# - determine offset to 'horizontal' frame
+ // #i26791# - determine offset to 'horizontal' frame
// anchor position, depending on layout-direction
if ( bVert )
{
@@ -1136,3 +1123,4 @@ const SwLayoutFrm& SwToCntntAnchoredObjectPosition::GetVertPosOrientFrm() const
return *mpVertPosOrientFrm;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index cf02ed8e45cd..9e3317db6a25 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <anchoredobject.hxx>
#include <frame.hxx>
#include <pagefrm.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
@@ -119,7 +118,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
// anchor position, depending on layout-direction
if( bVert )
{
- ASSERT( !bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." );
+ OSL_ENSURE( !bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." );
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if ( bVertL2R )
aRelPos.X() = nRelPosY;
@@ -251,3 +250,4 @@ Point SwToLayoutAnchoredObjectPosition::GetRelPos() const
return maRelPos;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 69cb74a86d21..de3945b25e8a 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,9 +48,7 @@
#include <sfx2/app.hxx>
#include <sfx2/linkmgr.hxx>
#include <unotools/configitem.hxx>
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
@@ -58,9 +57,6 @@
#include <section.hxx>
#include <cntfrm.hxx>
#include <frmatr.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
#include <ndole.hxx>
#include <comphelper/classids.hxx>
@@ -68,9 +64,7 @@
#include <sot/formats.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <svtools/filter.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
using rtl::OUString;
using namespace utl;
@@ -228,8 +222,6 @@ void SwEmbedObjectLink::DataChanged( const String& ,
}
pOleNode->GetNewReplacement();
- // Initiate repainting
- // pObj->SetChanged();
}
// -----------------------------------------------------------------------------
@@ -285,15 +277,10 @@ Graphic* SwOLENode::GetGraphic()
return pGraphic;
}
-Graphic* SwOLENode::GetHCGraphic()
-{
- return aOLEObj.xOLERef.GetHCGraphic();
-}
-
SwCntntNode *SwOLENode::SplitCntntNode( const SwPosition & )
{
// OLE-Objecte vervielfaeltigen ??
- ASSERT( sal_False, "OleNode: can't split." );
+ OSL_ENSURE( sal_False, "OleNode: can't split." );
return this;
}
@@ -310,7 +297,7 @@ sal_Bool SwOLENode::RestorePersistentData()
{
// TODO/LATER: reicht hier nicht ein EmbeddedObjectContainer? Was passiert mit
// diesem Dokument?
- ASSERT( !this, "warum wird hier eine DocShell angelegt?" );
+ OSL_ENSURE( !this, "warum wird hier eine DocShell angelegt?" );
p = new SwDocShell( GetDoc(), SFX_CREATE_MODE_INTERNAL );
p->DoInitNew( NULL );
}
@@ -325,7 +312,7 @@ sal_Bool SwOLENode::RestorePersistentData()
{
if ( xChild.is() )
xChild->setParent( 0 );
- DBG_ERROR( "InsertObject failed" );
+ OSL_FAIL( "InsertObject failed" );
}
else
{
@@ -388,7 +375,7 @@ SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
SwGrfFmtColl* pGrfColl,
SwAttrSet* pAutoAttr )
{
- ASSERT( pGrfColl,"SwNodes::MakeOLENode: Formatpointer ist 0." );
+ OSL_ENSURE( pGrfColl,"SwNodes::MakeOLENode: Formatpointer ist 0." );
SwOLENode *pNode =
new SwOLENode( rWhere, xObj, pGrfColl, pAutoAttr );
@@ -410,7 +397,7 @@ SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere,
const String &rName, sal_Int64 nAspect, SwGrfFmtColl* pGrfColl, SwAttrSet* pAutoAttr )
{
- ASSERT( pGrfColl,"SwNodes::MakeOLENode: Formatpointer ist 0." );
+ OSL_ENSURE( pGrfColl,"SwNodes::MakeOLENode: Formatpointer ist 0." );
SwOLENode *pNode =
new SwOLENode( rWhere, rName, nAspect, pGrfColl, pAutoAttr );
@@ -442,8 +429,8 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
// 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 );
+ OSL_ENSURE( pDoc->GetRefForDocShell(),
+ "wo ist die Ref-Klasse fuer die DocShell?");
pPersistShell->DoInitNew( NULL );
}
@@ -516,9 +503,6 @@ sal_Bool SwOLENode::IsOLEObjectDeleted() const
if( p ) // muss da sein
{
return !p->GetEmbeddedObjectContainer().HasEmbeddedObject( aOLEObj.aName );
- //SvInfoObjectRef aRef( p->Find( aOLEObj.aName ) );
- //if( aRef.Is() )
- // bRet = aRef->IsDeleted();
}
}
return bRet;
@@ -749,7 +733,7 @@ void SwOLEObj::SetNode( SwOLENode* pNode )
{
// TODO/LATER: reicht hier nicht ein EmbeddedObjectContainer? Was passiert mit
// diesem Dokument?
- ASSERT( !this, "warum wird hier eine DocShell angelegt?" );
+ OSL_ENSURE( !this, "warum wird hier eine DocShell angelegt?" );
p = new SwDocShell( pDoc, SFX_CREATE_MODE_INTERNAL );
p->DoInitNew( NULL );
}
@@ -761,7 +745,7 @@ void SwOLEObj::SetNode( SwOLENode* pNode )
xChild->setParent( p->GetModel() );
if (!p->GetEmbeddedObjectContainer().InsertEmbeddedObject( xOLERef.GetObject(), aObjName ) )
{
- DBG_ERROR( "InsertObject failed" );
+ OSL_FAIL( "InsertObject failed" );
if ( xChild.is() )
xChild->setParent( 0 );
}
@@ -784,10 +768,10 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
if( !xOLERef.is() )
{
SfxObjectShell* p = pOLENd->GetDoc()->GetPersist();
- ASSERT( p, "kein SvPersist vorhanden" );
+ OSL_ENSURE( p, "kein SvPersist vorhanden" );
uno::Reference < embed::XEmbeddedObject > xObj = p->GetEmbeddedObjectContainer().GetEmbeddedObject( aName );
- ASSERT( !xOLERef.is(), "rekursiver Aufruf von GetOleRef() ist nicht erlaubt" )
+ OSL_ENSURE( !xOLERef.is(), "rekursiver Aufruf von GetOleRef() ist nicht erlaubt" );
if ( !xObj.is() )
{
@@ -840,9 +824,6 @@ svt::EmbeddedObjectRef& SwOLEObj::GetObject()
sal_Bool SwOLEObj::UnloadObject()
{
sal_Bool bRet = sal_True;
- //Nicht notwendig im Doc DTor (MM)
- //ASSERT( pOLERef && pOLERef->Is() && 1 < (*pOLERef)->GetRefCount(),
- // "Falscher RefCount fuers Unload" );
if ( pOLENd )
{
const SwDoc* pDoc = pOLENd->GetDoc();
@@ -880,7 +861,7 @@ sal_Bool SwOLEObj::UnloadObject( uno::Reference< embed::XEmbeddedObject > xObj,
if ( xPers.is() )
xPers->storeOwn();
else {
- DBG_ERROR("Modified object without persistance in cache!");
+ OSL_FAIL("Modified object without persistance in cache!");
}
}
@@ -921,7 +902,7 @@ String SwOLEObj::GetDescription()
SwOLELRUCache::SwOLELRUCache()
: SvPtrarr( 64, 16 ),
- utl::ConfigItem( OUString::createFromAscii( "Office.Common/Cache" )),
+ utl::ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Cache"))),
nLRU_InitSize( 20 ),
bInUnload( sal_False )
{
@@ -933,7 +914,7 @@ uno::Sequence< rtl::OUString > SwOLELRUCache::GetPropertyNames()
{
Sequence< OUString > aNames( 1 );
OUString* pNames = aNames.getArray();
- pNames[0] = OUString::createFromAscii( "Writer/OLE_Objects" );
+ pNames[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Writer/OLE_Objects"));
return aNames;
}
@@ -956,8 +937,6 @@ void SwOLELRUCache::Load()
{
sal_Int32 nVal = 0;
*pValues >>= nVal;
- //if( 20 > nVal )
- // nVal = 20;
{
if( nVal < nLRU_InitSize )
@@ -1015,3 +994,4 @@ void SwOLELRUCache::RemoveObj( SwOLEObj& rObj )
DELETEZ( pOLELRU_Cache );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index bff9983e4ede..ea8da3f45cc6 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,6 @@
#include <com/sun/star/text/WrapTextMode.hpp>
#include <unostyle.hxx>
#include <SwStyleNameMapper.hxx>
-#include "errhdl.hxx"
#include "paratr.hxx"
#include "charfmt.hxx"
#include "cmdid.h"
@@ -61,8 +61,6 @@ TYPEINIT1_AUTOFACTORY( SwParaConnectBorderItem, SfxBoolItem);
/*************************************************************************
|* Beschreibung Methoden von SwFmtDrop
-|* Ersterstellung MS 19.02.91
-|* Letzte Aenderung JP 08.08.94
*************************************************************************/
@@ -144,7 +142,7 @@ sal_Bool SwFmtDrop::GetInfo( SfxPoolItem& ) const
int SwFmtDrop::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return ( nLines == ((SwFmtDrop&)rAttr).GetLines() &&
nChars == ((SwFmtDrop&)rAttr).GetChars() &&
nDistance == ((SwFmtDrop&)rAttr).GetDistance() &&
@@ -158,7 +156,7 @@ SfxPoolItem* SwFmtDrop::Clone( SfxItemPool* ) const
return new SwFmtDrop( *this );
}
-sal_Bool SwFmtDrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtDrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
switch(nMemberId&~CONVERT_TWIPS)
{
@@ -187,10 +185,10 @@ sal_Bool SwFmtDrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
}
break;
}
- return sal_True;
+ return true;
}
-sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
switch(nMemberId&~CONVERT_TWIPS)
{
@@ -216,7 +214,7 @@ sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if ( rVal >>= nVal )
nDistance = (sal_Int16) MM100_TO_TWIP((sal_Int32)nVal);
else
- return sal_False;
+ return false;
break;
}
case MID_DROPCAP_FORMAT:
@@ -229,8 +227,6 @@ sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nDistance = MM100_TO_TWIP(pDrop->Distance);
}
else {
- //exception( wrong_type)
- ;
}
}
break;
@@ -238,10 +234,10 @@ sal_Bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
bWholeWord = *(sal_Bool*)rVal.getValue();
break;
case MID_DROPCAP_CHAR_STYLE_NAME :
- DBG_ERROR("char format cannot be set in PutValue()!");
+ OSL_FAIL("char format cannot be set in PutValue()!");
break;
}
- return sal_True;
+ return true;
}
// class SwRegisterItem -------------------------------------------------
@@ -259,33 +255,26 @@ SfxPoolItem* SwNumRuleItem::Clone( SfxItemPool * ) const
}
int SwNumRuleItem::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- // --> OD 2008-03-04 #refactorlists# - removed <pDefinedIn>
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+
return GetValue() == ((SwNumRuleItem&)rAttr).GetValue();
- // <--
}
-/* -----------------------------27.06.00 11:05--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwNumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const
+bool SwNumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
rtl::OUString sRet = SwStyleNameMapper::GetProgName(GetValue(), nsSwGetPoolIdFromName::GET_POOLID_NUMRULE );
rVal <<= sRet;
- return sal_True;
+ return true;
}
-/* -----------------------------27.06.00 11:05--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool SwNumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 )
+bool SwNumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 )
{
rtl::OUString uName;
rVal >>= uName;
SetValue(SwStyleNameMapper::GetUIName(uName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE));
- return sal_True;
+ return true;
}
-/* -----------------19.05.2003 10:44-----------------
- --------------------------------------------------*/
SfxPoolItem* SwParaConnectBorderItem::Clone( SfxItemPool * ) const
{
return new SwParaConnectBorderItem( *this );
@@ -293,3 +282,4 @@ SfxPoolItem* SwParaConnectBorderItem::Clone( SfxItemPool * ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/sw3io/sw3convert.cxx b/sw/source/core/sw3io/sw3convert.cxx
index af9350427b51..8605e23f6204 100644
--- a/sw/source/core/sw3io/sw3convert.cxx
+++ b/sw/source/core/sw3io/sw3convert.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,26 +72,6 @@
using namespace nsSwDocInfoSubType;
-
-//#include "poolfmt.hxx" // fuer InSetExpField
-//#include "poolfmt.hrc" // fuer InSetExpField
-
-//#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(CSET) && !defined(__MWERKS__) && !defined(WTC)
-
-//#define FIELDFNTAB_SIZE 37
-//#if FIELDFNTAB_SIZE != RES_FIELDS_END - RES_FIELDS_BEGIN
-//#error Feld-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-//#endif
-
-//#endif
-
-//#define SWG_AUTHORITY_ENTRY_LCL 'E'
-
-//sal_Char __FAR_DATA sSW3IO_FixedField[] = "FixedExport";
-//sal_Char __FAR_DATA sSW3IO_AuthorityField[] = "AuthorityExport";
-/* #108791# */
-//sal_Char __FAR_DATA sSW3IO_DropDownField[] = "DropDownExport";
-
struct OldFormats
{
NfIndexTableOffset eFormatIdx;
@@ -397,8 +378,6 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, sal_uInt16& rWhi
break;
default:
- // case REF_UPDOWN:
- // case REF_PAGE_PGDESC:
rFmt = REF_PAGE;
break;
}
@@ -408,13 +387,12 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, sal_uInt16& rWhi
if( pOldFmt && nOldFmt )
{
- sal_uInt16 i = 0;
-
SvNumberFormatter *pFormatter = ((SwValueField*)pFld)->GetDoc()->GetNumberFormatter();
const SvNumberformat* pEntry = pFormatter->GetEntry( nOldFmt );
if( pEntry )
{
+ sal_uInt16 i = 0;
while( pOldFmt[i].eFormatIdx != NF_NUMERIC_START ||
pOldFmt[i].nOldFormat )
{
@@ -431,3 +409,5 @@ SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, sal_uInt16& rWhi
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/sw3io/swacorr.cxx b/sw/source/core/sw3io/swacorr.cxx
index 6c9a4c52a111..86bd02e76a30 100644
--- a/sw/source/core/sw3io/swacorr.cxx
+++ b/sw/source/core/sw3io/swacorr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,12 +34,8 @@
#include <swacorr.hxx>
#include <swblocks.hxx>
#include "SwXMLTextBlocks.hxx"
-#ifndef _SWSERROR_H
#include <swerror.h>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <editsh.hxx>
#include <sot/storage.hxx>
@@ -62,7 +59,7 @@ sal_Bool SwAutoCorrect::GetLongText( const uno::Reference < embed::XStorage >& r
nRet = aBlk.GetText( rShort, rLong );
}
else {
- ASSERT ( rStg.is(), "Someone passed SwAutoCorrect::GetLongText a dud storage!");
+ OSL_ENSURE( rStg.is(), "Someone passed SwAutoCorrect::GetLongText a dud storage!");
}
return !IsError( nRet ) && rLong.Len();
}
@@ -104,3 +101,5 @@ SwAutoCorrect::SwAutoCorrect( const SvxAutoCorrect& rACorr )
SwAutoCorrect::~SwAutoCorrect()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx
index c99ebe35d9a8..674a33fe2c4f 100644
--- a/sw/source/core/swg/SwXMLBlockExport.cxx
+++ b/sw/source/core/swg/SwXMLBlockExport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -140,3 +141,5 @@ sal_uInt32 SwXMLTextBlockExport::exportDoc(const String &rText)
GetDocHandler()->endDocument();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLBlockImport.cxx b/sw/source/core/swg/SwXMLBlockImport.cxx
index 9c0084eb6f4c..c7499c69f0e4 100644
--- a/sw/source/core/swg/SwXMLBlockImport.cxx
+++ b/sw/source/core/swg/SwXMLBlockImport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,18 +31,16 @@
#include <SwXMLBlockImport.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlnmspe.hxx>
-#ifndef _SW_XMLBLOCKLIST_CONTEXT_HXX
#include <SwXMLBlockListContext.hxx>
-#endif
#include <SwXMLTextBlocks.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using namespace ::xmloff::token;
using ::rtl::OUString;
-sal_Char __READONLY_DATA sXML_np__block_list[] = "_block-list";
-sal_Char __READONLY_DATA sXML_np__office[] = "_ooffice";
-sal_Char __READONLY_DATA sXML_np__text[] = "_otext";
+sal_Char const sXML_np__block_list[] = "_block-list";
+sal_Char const sXML_np__office[] = "_ooffice";
+sal_Char const sXML_np__text[] = "_otext";
// #110680#
SwXMLBlockListImport::SwXMLBlockListImport(
@@ -116,3 +115,5 @@ void SAL_CALL SwXMLTextBlockImport::endDocument(void)
throw( xml::sax::SAXException, uno::RuntimeException )
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLBlockListContext.cxx b/sw/source/core/swg/SwXMLBlockListContext.cxx
index b8c5fb58aefc..babaada52596 100644
--- a/sw/source/core/swg/SwXMLBlockListContext.cxx
+++ b/sw/source/core/swg/SwXMLBlockListContext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -248,3 +249,5 @@ SwXMLTextBlockParContext::~SwXMLTextBlockParContext ( void )
rLocalRef.m_rText.AppendAscii( " " );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index a12693b8f72a..1aebeb72cf22 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,8 +39,8 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
using namespace ::xmloff::token;
-sal_Char __READONLY_DATA sXML_np__office[] = "_ooffice";
-sal_Char __READONLY_DATA sXML_np__text[] = "_otext";
+sal_Char const sXML_np__office[] = "_ooffice";
+sal_Char const sXML_np__text[] = "_otext";
// #110680#
SwXMLSectionList::SwXMLSectionList(
@@ -152,3 +153,5 @@ SvXMLImportContext *SvXMLIgnoreSectionListContext::CreateChildContext(
{
return new SvXMLIgnoreSectionListContext (rLocalRef, nPrefix, rLocalName, xAttrList);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index a0728661ad60..6126a3854f26 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,7 +102,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
}
catch( const uno::Exception& )
{
- DBG_ERROR("exception while creating AutoText storage");
+ OSL_FAIL("exception while creating AutoText storage");
}
}
InitBlockMode ( refStg );
@@ -277,10 +278,6 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
{
uno::Reference < embed::XStorage > rSourceRoot = xBlkRoot->openStorageElement( aGroup, embed::ElementModes::READ );
uno::Reference < embed::XStorage > rDestRoot = ((SwXMLTextBlocks&)rDestImp).xBlkRoot->openStorageElement( sDestShortName, embed::ElementModes::READWRITE );
- //if(!rSourceRoot.Is())
- // nError = ERR_SWG_READ_ERROR;
- //else
- //{
rSourceRoot->copyToStorage( rDestRoot );
}
catch ( uno::Exception& )
@@ -288,26 +285,9 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
nError = ERR_SWG_WRITE_ERROR;
}
- /* I think this should work now that text only blocks are in sub-storages as well
- else
- {
- SvStorageStreamRef rSourceStream = xBlkRoot->OpenStream( aGroup, STREAM_STGREAD );
- SvStorageStreamRef rDestStream = ((SwXMLTextBlocks&)rDestImp).xBlkRoot-> OpenStream( sDestShortName, STREAM_STGWRITE );
- if(!rDestStream.Is())
- nError = ERR_SWG_WRITE_ERROR;
- else
- {
- if(!rSourceStream->CopyTo(&rDestStream))
- nError = ERR_SWG_WRITE_ERROR;
- else
- rDestStream->Commit();
- }
- }
- */
if(!nError)
{
rShort = sDestShortName;
- //((SwXMLTextBlocks&)rDestImp).xBlkRoot->Commit();
((SwXMLTextBlocks&)rDestImp).AddName( rShort, rLong, bTextOnly );
((SwXMLTextBlocks&)rDestImp).MakeBlockList();
}
@@ -323,13 +303,6 @@ sal_uLong SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rP
if(!xBlkRoot.is())
return 0;
GetIndex ( rShort );
- /*
- if( xBlkRoot->IsContained( rPackageName ) )
- {
- xBlkRoot->Remove( rPackageName );
- xBlkRoot->Commit();
- }
- */
try
{
xRoot = xBlkRoot->openStorageElement( rPackageName, embed::ElementModes::READWRITE );
@@ -430,14 +403,6 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
}
//TODO/LATER: error handling
- /*
- sal_uLong nErr = xBlkRoot->GetError();
- if( nErr == SVSTREAM_DISK_FULL )
- nRes = ERR_W4W_WRITE_FULL;
- else if( nErr != SVSTREAM_OK )
- nRes = ERR_SWG_WRITE_ERROR;
- nFlags |= nCommitFlags;
- return nErr;*/
return 0;
}
@@ -473,7 +438,7 @@ sal_Bool SwXMLTextBlocks::PutMuchEntries( sal_Bool bOn )
{
if( bInPutMuchBlocks )
{
- ASSERT( !this, "verschachtelte Aufrufe sind nicht erlaubt" );
+ OSL_ENSURE( !this, "verschachtelte Aufrufe sind nicht erlaubt" );
}
else if( !IsFileChanged() )
{
@@ -623,7 +588,6 @@ void SwXMLTextBlocks::MakeBlockText( const String& rText )
{
SwTxtNode* pTxtNode = pDoc->GetNodes()[ pDoc->GetNodes().GetEndOfContent().
GetIndex() - 1 ]->GetTxtNode();
- //JP 18.09.98: Bug 56706 - Standard sollte zumindest gesetzt sein!
if( pTxtNode->GetTxtColl() == pDoc->GetDfltTxtFmtColl() )
pTxtNode->ChgFmtColl( pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
@@ -639,3 +603,5 @@ void SwXMLTextBlocks::MakeBlockText( const String& rText )
pTxtNode->InsertText( sTemp, aIdx );
} while ( STRING_NOTFOUND != nPos );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 0aab2addfd7d..feaffd7adb03 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,22 +40,19 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <shellio.hxx>
#include <SwXMLTextBlocks.hxx>
#include <SwXMLBlockImport.hxx>
#include <SwXMLBlockExport.hxx>
#include <swevent.hxx>
#include <swerror.h>
-#include <errhdl.hxx>
#define STREAM_STGREAD ( STREAM_READ | STREAM_SHARE_DENYWRITE | STREAM_NOCREATE )
#define STREAM_STGWRITE ( STREAM_READ | STREAM_WRITE | STREAM_SHARE_DENYWRITE )
-sal_Char __FAR_DATA XMLN_BLOCKLIST[] = "BlockList.xml";
+sal_Char XMLN_BLOCKLIST[] = "BlockList.xml";
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -111,7 +109,7 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- ASSERT( xServiceFactory.is(), "XMLReader::Read: got no service manager" );
+ OSL_ENSURE( xServiceFactory.is(), "XMLReader::Read: got no service manager" );
if( !xServiceFactory.is() )
{
// Throw an exception ?
@@ -124,8 +122,8 @@ sal_uLong SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx )
// get parser
uno::Reference< XInterface > xXMLParser = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Parser") );
- ASSERT( xXMLParser.is(),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")));
+ OSL_ENSURE( xXMLParser.is(),
"XMLReader::Read: com.sun.star.xml.sax.Parser service missing" );
if( !xXMLParser.is() )
{
@@ -206,7 +204,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
long nTmp = SOT_FORMATSTR_ID_STARWRITER_60;
sal_Bool bOasis = ( SotStorage::GetVersion( xRoot ) > nTmp );
- OUString sStreamName = OUString::createFromAscii("atevent.xml");
+ OUString sStreamName(RTL_CONSTASCII_USTRINGPARAM("atevent.xml"));
uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement(
sStreamName, embed::ElementModes::READ );
DBG_ASSERT(xDocStream.is(), "Can't create stream");
@@ -244,10 +242,9 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
aFilterArguments[0] <<= xReplace;
// get filter
- OUString sFilterComponent( OUString::createFromAscii(
- bOasis
- ? "com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"
- : "com.sun.star.comp.Writer.XMLAutotextEventsImporter"));
+ OUString sFilterComponent = bOasis
+ ? OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"))
+ : OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLAutotextEventsImporter"));
uno::Reference< xml::sax::XDocumentHandler > xFilter(
xServiceFactory->createInstanceWithArguments(
sFilterComponent, aFilterArguments),
@@ -337,7 +334,7 @@ sal_uLong SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
uno::Reference < io::XStream > xContents = xRoot->openStreamElement( aStreamName, embed::ElementModes::READ );
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- ASSERT( xServiceFactory.is(), "XMLReader::Read: got no service manager" );
+ OSL_ENSURE( xServiceFactory.is(), "XMLReader::Read: got no service manager" );
if( !xServiceFactory.is() )
{
// Throw an exception ?
@@ -349,8 +346,8 @@ sal_uLong SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
// get parser
uno::Reference< XInterface > xXMLParser = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Parser") );
- ASSERT( xXMLParser.is(),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) );
+ OSL_ENSURE( xXMLParser.is(),
"XMLReader::Read: com.sun.star.xml.sax.Parser service missing" );
if( !xXMLParser.is() )
{
@@ -388,7 +385,7 @@ sal_uLong SwXMLTextBlocks::GetBlockText( const String& rShort, String& rText )
}
catch ( uno::Exception& )
{
- ASSERT( sal_False, "Tried to open non-existent folder or stream!");
+ OSL_ENSURE( sal_False, "Tried to open non-existent folder or stream!");
}
return n;
@@ -410,7 +407,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- ASSERT( xServiceFactory.is(),
+ OSL_ENSURE( xServiceFactory.is(),
"XMLReader::Read: got no service manager" );
if( !xServiceFactory.is() )
{
@@ -490,7 +487,7 @@ void SwXMLTextBlocks::ReadInfo( void )
{
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- ASSERT( xServiceFactory.is(),
+ OSL_ENSURE( xServiceFactory.is(),
"XMLReader::Read: got no service manager" );
if( !xServiceFactory.is() )
{
@@ -505,8 +502,8 @@ void SwXMLTextBlocks::ReadInfo( void )
// get parser
uno::Reference< XInterface > xXMLParser = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Parser") );
- ASSERT( xXMLParser.is(),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")));
+ OSL_ENSURE( xXMLParser.is(),
"XMLReader::Read: com.sun.star.xml.sax.Parser service missing" );
if( !xXMLParser.is() )
{
@@ -588,9 +585,7 @@ void SwXMLTextBlocks::WriteInfo( void )
uno::Reference<xml::sax::XDocumentHandler> xHandler(xWriter, uno::UNO_QUERY);
- // #110680#
- // SwXMLBlockListExport aExp(*this, OUString::createFromAscii(XMLN_BLOCKLIST), xHandler);
- SwXMLBlockListExport aExp( xServiceFactory, *this, OUString::createFromAscii(XMLN_BLOCKLIST), xHandler);
+ SwXMLBlockListExport aExp( xServiceFactory, *this, OUString(RTL_CONSTASCII_USTRINGPARAM(XMLN_BLOCKLIST)), xHandler);
aExp.exportDoc( XML_BLOCK_LIST );
@@ -622,7 +617,7 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- ASSERT( xServiceFactory.is(),
+ OSL_ENSURE( xServiceFactory.is(),
"XML autotext event write:: got no service manager" );
if( !xServiceFactory.is() )
return ERR_SWG_WRITE_ERROR;
@@ -630,7 +625,7 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
// Get model
uno::Reference< lang::XComponent > xModelComp(
pDoc->GetDocShell()->GetModel(), UNO_QUERY );
- ASSERT( xModelComp.is(), "XMLWriter::Write: got no model" );
+ OSL_ENSURE( xModelComp.is(), "XMLWriter::Write: got no model" );
if( !xModelComp.is() )
return ERR_SWG_WRITE_ERROR;
@@ -664,9 +659,9 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
// get XML writer
uno::Reference< io::XActiveDataSource > xSaxWriter(
xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Writer") ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) ),
UNO_QUERY );
- ASSERT( xSaxWriter.is(), "can't instantiate XML writer" );
+ OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML writer" );
if( xSaxWriter.is() )
{
@@ -684,15 +679,15 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
aParams[0] <<= xDocHandler;
aParams[1] <<= xEvents;
+
// get filter component
+ OUString sFilterComponent = bOasis
+ ? OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"))
+ : OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLAutotextEventsExporter"));
uno::Reference< document::XExporter > xExporter(
xServiceFactory->createInstanceWithArguments(
- OUString::createFromAscii(
- bOasis
- ? "com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"
- : "com.sun.star.comp.Writer.XMLAutotextEventsExporter"),
- aParams), UNO_QUERY);
- ASSERT( xExporter.is(),
+ sFilterComponent, aParams), UNO_QUERY);
+ OSL_ENSURE( xExporter.is(),
"can't instantiate export filter component" );
if( xExporter.is() )
{
@@ -739,3 +734,4 @@ sal_uLong SwXMLTextBlocks::SetMacroTable(
return nRes;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index 3c0409b764cc..f673905dab26 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <sfx2/docfilt.hxx>
#include <sot/storage.hxx>
#include <tools/urlobj.hxx>
-#ifndef SVTOOLS_FSTATHELPER_HXX
#include <svl/fstathelper.hxx>
-#endif
#include <svl/macitem.hxx>
#include <unotools/charclass.hxx>
#include <frmfmt.hxx>
@@ -46,14 +45,10 @@
#include <ndtxt.hxx>
#include <mdiexp.hxx> // Progress
#include <SwXMLTextBlocks.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swunohelper.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
#include <swerror.h>
SV_IMPL_OP_PTRARR_SORT( SwBlockNames, SwBlockName* );
@@ -266,8 +261,6 @@ SwTextBlocks::SwTextBlocks( const String& rFile )
String sFileName = aObj.GetMainURL( INetURLObject::NO_DECODE );
switch( SwImpBlocks::GetFileType( rFile ) )
{
- //case SWBLK_SW2: pImp = new Sw2TextBlocks( sFileName ); break;
- //case SWBLK_SW3: pImp = new Sw3TextBlocks( sFileName ); break;
case SWBLK_XML: pImp = new SwXMLTextBlocks( sFileName ); break;
case SWBLK_NO_FILE: pImp = new SwXMLTextBlocks( sFileName ); break;
}
@@ -305,156 +298,6 @@ sal_Bool SwTextBlocks::IsOld() const
}
-/*
-sal_uLong SwTextBlocks::ConvertToNew()
-{
- // Wir nehmen die aktuelle Datei, benennen diese in .BAK um
- // und kreieren den neuen Storage
- if( IsOld() )
- {
- // Erst mal muessen wir die Datei freigeben
- short nType = pImp->GetFileType();
- Sw2TextBlocks *pTwo = NULL;
- Sw3TextBlocks *pThree = NULL;
- SwImpBlocks *pOld = NULL;
-
- pImp->nCur = (sal_uInt16) -1;
- String aName( pImp->aFile );
- delete pImp; pImp = NULL;
- // Jetzt wird umbenannt
- INetURLObject aOldFull( aName );
- INetURLObject aNewFull( aName );
-
- aOldFull.SetExtension( String::CreateFromAscii("bak") );
- String aOld( aOldFull.GetMainURL( INetURLObject::NO_DECODE ) );
- String aNew( aNewFull.GetMainURL( INetURLObject::NO_DECODE ) );
-
- sal_Bool bError = !SWUnoHelper::UCB_CopyFile( aNew, aOld, sal_True );
- if( bError )
- {
- if (nType == SWBLK_SW2)
- pImp = new Sw2TextBlocks( aOld );
- else
- pImp = new Sw3TextBlocks( aOld );
- return nErr = ERR_SWG_CANNOT_WRITE;
- }
-
- // Die Datei ist erfolgreich umbenannt. Jetzt wird der Storage
- // aufgesetzt
- if (nType == SWBLK_SW2)
- pOld = pTwo = new Sw2TextBlocks( aOld );
- else
- pOld = pThree = new Sw3TextBlocks( aOld );
- SwXMLTextBlocks* pNew = new SwXMLTextBlocks( aName );
- pNew->SetName ( pOld->GetName());
- // Wir kopieren den Doc-Ptr in das alte System
- // den alten SvPersist heben wir uns aber auf,
- // da dieser die ganze Zeit leben bleibt
- // und lesen die Dateivorlagen erneut ein
- SvPersist* pPersist2 = pOld->pDoc->GetPersist();
- if (SWBLK_SW2 == nType )
- {
- delete pOld->pDoc;
- pOld->pDoc = pNew->pDoc;nLinkCt
- nErr = pTwo->LoadDoc();
- }
- else
- {
- 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( sal_False )) )
- {
- nErr = pNew->SetConvertMode( sal_True );
- // jetzt werden die Bausteine einfach umkopiert!
- if( !nErr )
- {
- if (SWBLK_SW2 == nType)
- pTwo->StatLineStartPercent();
- sal_uInt16 nCount = pOld->GetCount();
- for( sal_uInt16 i = 0; i < nCount; i++ )
- {
- pNew->ClearDoc();
- String aShort( pOld->GetShortName( i ) );
- String aLong( pOld->GetLongName( i ) );
- pNew->AddName( aShort, aLong );
- if ( SWBLK_SW3 == nType && pThree->IsOnlyTextBlock(aShort) )
- {
- String sText;
- pThree->GetText( aShort, sText );
- pNew->PutText( aShort, aLong, sText );
- }
- else
- {
- if (SWBLK_SW2 == nType )
- {
- // I think this is how it should work (!!!!!!) mtg
- pNew->pDoc->SetPersist( pPersist2 );
- }
- nErr = pOld->GetDocForConversion( i );
- if( nErr )
- break;
- nErr = pNew->BeginPutDoc( aShort, aLong );
- if( nErr )
- break;
- nErr = pNew->PutDoc();
- if( nErr )
- break;
- }
-
- // convert macros, too
- SvxMacroTableDtor aMacroTable;
- pOld->GetMacroTable( i, aMacroTable, sal_True );
- pNew->SetMacroTable( i, aMacroTable, sal_True );
-
- if (SWBLK_SW2 == nType )
- pNew->pDoc->SetPersist( 0 );
- }
- if (SWBLK_SW2 == nType )
- ::EndProgress( pOld->pDoc->GetDocShell() );
- }
- if( !nErr )
- nErr = pNew->SetConvertMode( sal_False );
- }
- if ( SWBLK_SW3 == nType )
- {
- pThree->CloseFile();
- }
- else
- {
- // Haben wir es geschafft?
- pOld->pDoc = NULL;
- }
- pNew->ClearDoc();
- if( !nErr )
- {
- delete pOld;
- pImp = pNew;
- SWUnoHelper::UCB_DeleteFile( aOld );
- pNew->MakeBlockList();
- }
- else
- {
- delete pOld; delete pNew;
- SWUnoHelper::UCB_DeleteFile( aNew );
- SWUnoHelper::UCB_CopyFile( aOld, aNew, sal_True );
- if ( SWBLK_SW2 == nType )
- pImp = new Sw2TextBlocks( aOld );
- else
- pImp = new Sw3TextBlocks( aOld );
- }
- pNew->CloseFile();
- FStatHelper::GetModifiedDateTimeOfFile( aNew,
- &pImp->aDateModified, &pImp->aTimeModified );
- }
- return nErr;
-} */
-
-
sal_uInt16 SwTextBlocks::GetCount() const
{
return pImp ? pImp->GetCount() : 0;
@@ -527,7 +370,7 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const String* s, const String* l
aLong = *l;
if( !aNew.Len() )
{
- ASSERT( !this, "Kein Kurzname in Rename angegeben" );
+ OSL_ENSURE( !this, "Kein Kurzname in Rename angegeben" );
nErr = ERR_SWG_INTERNAL_ERROR; return (sal_uInt16) -1;
}
@@ -761,7 +604,7 @@ sal_Bool SwTextBlocks::IsOnlyTextBlock( const String& rShort ) const
return IsOnlyTextBlock( nIdx );
}
- ASSERT( !this, "ungueltiger Name" );
+ OSL_ENSURE( !this, "ungueltiger Name" );
return sal_False;
}
@@ -796,9 +639,6 @@ void SwTextBlocks::EndPutMuchBlockEntries()
pImp->PutMuchEntries( sal_False );
}
-/*-- 20.09.2004 10:25:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
String SwTextBlocks::GetBaseURL() const
{
String sRet;
@@ -806,9 +646,7 @@ String SwTextBlocks::GetBaseURL() const
sRet = pImp->GetBaseURL();
return sRet;
}
-/*-- 20.09.2004 10:25:33---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwTextBlocks::SetBaseURL( const String& rURL )
{
if(pImp)
@@ -816,3 +654,4 @@ void SwTextBlocks::SetBaseURL( const String& rURL )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 1ec108ca1deb..26ca86474869 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,15 +49,11 @@
#include <editeng/protitem.hxx>
#include <swtblfmt.hxx>
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
// ---------------------------------------------------------------
@@ -134,7 +131,7 @@ void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, sal_uInt
++nCheck;
if( rLine.GetTabBoxes().Count() < nCheck )
{ // robust
- ASSERT( false, "Box out of table line" );
+ OSL_ENSURE( false, "Box out of table line" );
nCheck = rLine.GetTabBoxes().Count();
}
@@ -143,7 +140,7 @@ void lcl_CheckMinMax( long& rMin, long& rMax, const SwTableLine& rLine, sal_uInt
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCheck; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
nWidth = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
nNew += nWidth;
}
@@ -177,12 +174,12 @@ long lcl_Box2LeftBorder( const SwTableBox& rBox )
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( pBox == &rBox )
return nLeft;
nLeft += pBox->GetFrmFmt()->GetFrmSize().GetWidth();
}
- ASSERT( false, "Box not found in own upper?" );
+ OSL_ENSURE( false, "Box not found in own upper?" );
return nLeft;
}
@@ -211,15 +208,15 @@ SwTableBox* lcl_LeftBorder2Box( long nLeft, const SwTableLine* pLine )
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( nCurrLeft >= nLeft && pBox->GetFrmFmt()->GetFrmSize().GetWidth() )
{
- ASSERT( nCurrLeft == nLeft, "Wrong box found" );
+ OSL_ENSURE( nCurrLeft == nLeft, "Wrong box found" );
return pBox;
}
nCurrLeft += pBox->GetFrmFmt()->GetFrmSize().GetWidth();
}
- ASSERT( false, "Didn't found wished box" );
+ OSL_ENSURE( false, "Didn't found wished box" );
return 0;
}
@@ -257,7 +254,7 @@ void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
{
if( !nDiff || nRowIdx >= rTable.GetTabLines().Count() )
return;
- ASSERT( !bSingle || nDiff > 0, "Don't set bSingle when deleting lines!" );
+ OSL_ENSURE( !bSingle || nDiff > 0, "Don't set bSingle when deleting lines!" );
bool bGoOn;
// nDistance is the distance between the current row and the critical row,
// e.g. the deleted rows or the inserted rows.
@@ -326,7 +323,7 @@ void lcl_ChangeRowSpan( const SwTable& rTable, const long nDiff,
SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
{
- ASSERT( bNewModel, "Don't call me for old tables" );
+ OSL_ENSURE( bNewModel, "Don't call me for old tables" );
if( !aLines.Count() )
return 0;
const SwNode* pStartNd = rPam.Start()->nNode.GetNode().FindTableBoxStartNode();
@@ -341,12 +338,12 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
for( sal_uInt16 nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
sal_uInt16 nCols = pLine->GetTabBoxes().Count();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( nFound )
{
if( pBox->GetSttNd() == pEndNd )
@@ -381,7 +378,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
for( sal_uInt16 nRow = nTop; nRow <= nBottom && bOkay; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
SwSelBoxes *pBoxes = new SwSelBoxes();
long nLeft = 0;
long nRight = 0;
@@ -390,7 +387,7 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
nLeft = nRight;
nRight += pBox->GetFrmFmt()->GetFrmSize().GetWidth();
nRowSpan = pBox->getRowSpan();
@@ -624,7 +621,7 @@ long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPos,
nAddWidth += nWidth;
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.." );
+ OSL_ENSURE( nCurrLine != USHRT_MAX, "Time to say Good-Bye.." );
if( rInsPos[ nCurrLine ] == USHRT_MAX )
{
rInsPos[ nCurrLine ] = nCurrBox;
@@ -695,7 +692,6 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
_FndBox aFndBox( 0, 0 );
aFndBox.SetTableLines( rBoxes, *this );
aFndBox.DelFrms( *this );
-// aFndBox.SaveChartData( *this );
SwTableNode* pTblNd = GetTableNode();
std::vector<SwTableBoxFmt*> aInsFormat( nCnt, 0 );
@@ -706,7 +702,7 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
{
SwTableLine* pLine = aLines[ i ];
sal_uInt16 nInsPos = aInsPos[i];
- ASSERT( nInsPos != USHRT_MAX, "Didn't found insert position" );
+ OSL_ENSURE( nInsPos != USHRT_MAX, "Didn't found insert position" );
SwTableBox* pBox = pLine->GetTabBoxes()[ nInsPos ];
if( bBehind )
++nInsPos;
@@ -776,14 +772,13 @@ sal_Bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
}
aFndBox.MakeFrms( *this );
-// aFndBox.RestoreChartData( *this );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
const SwTableBoxes &rTabBoxes = aLines[0]->GetTabBoxes();
long nNewWidth = 0;
for( sal_uInt16 i = 0; i < rTabBoxes.Count(); ++i )
nNewWidth += rTabBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
- ASSERT( nNewWidth > 0, "Very small" );
+ OSL_ENSURE( nNewWidth > 0, "Very small" );
}
#endif
CHECK_TABLE( *this )
@@ -990,7 +985,7 @@ void SwTable::_FindSuperfluousRows( SwSelBoxes& rBoxes,
for( sal_uInt16 nRow = nFirstLn; nRow <= nLastLn; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
sal_uInt16 nCols = pLine->GetTabBoxes().Count();
bool bSuperfl = true;
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
@@ -1075,7 +1070,7 @@ SwTableBox& SwTableBox::FindEndOfRowSpan( const SwTable& rTable, sal_uInt16 nMax
void lcl_getAllMergedBoxes( const SwTable& rTable, SwSelBoxes& rBoxes, SwTableBox& rBox )
{
SwTableBox* pBox = &rBox;
- ASSERT( pBox == &rBox.FindStartOfRowSpan( rTable, USHRT_MAX ), "Not a master box" );
+ OSL_ENSURE( pBox == &rBox.FindStartOfRowSpan( rTable, USHRT_MAX ), "Not a master box" );
rBoxes.Insert( pBox );
if( pBox->getRowSpan() == 1 )
return;
@@ -1163,7 +1158,7 @@ void lcl_FillSelBoxes( SwSelBoxes &rBoxes, SwTableLine &rLine )
void SwTable::InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt )
{
CHECK_TABLE( *this )
- ASSERT( nCnt && nRowIdx < GetTabLines().Count(), "Wrong call of InsertSpannedRow" );
+ OSL_ENSURE( nCnt && nRowIdx < GetTabLines().Count(), "Wrong call of InsertSpannedRow" );
SwSelBoxes aBoxes;
SwTableLine& rLine = *GetTabLines()[ nRowIdx ];
lcl_FillSelBoxes( aBoxes, rLine );
@@ -1218,7 +1213,7 @@ void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
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' ??" )
+ OSL_ENSURE( rBox.getRowSpan() > 0, "Didn't I say 'StartOfRowSpan' ??" );
if( nCnt > rBox.getRowSpan() )
{
const SwTableLine *pLine = rBox.GetUpper();
@@ -1254,7 +1249,7 @@ void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
aLnOfs.second < pCurr->second )
aLnOfs.second = pCurr->second; // Found a smaller row span
}
- ASSERT( aLnOfs.second < nCnt, "Clean-up failed" )
+ OSL_ENSURE( aLnOfs.second < nCnt, "Clean-up failed" );
aLnOfs.second = nCnt - aLnOfs.second; // the number of rows to insert
rArr.insert( rArr.end(),
SwLineOffset( aLnOfs.first - nSum, aLnOfs.second ) );
@@ -1317,7 +1312,7 @@ sal_uInt16 lcl_CalculateSplitLineHeights( SwSplitLines &rCurr, SwSplitLines &rNe
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' ??" )
+ OSL_ENSURE( rBox.getRowSpan() > 0, "Didn't I say 'StartOfRowSpan' ??" );
const SwTableLine *pLine = rBox.GetUpper();
const sal_uInt16 nStart = rTable.GetTabLines().C40_GETPOS( SwTableLine, pLine );
const sal_uInt16 nEnd = sal_uInt16( rBox.getRowSpan() + nStart - 1 );
@@ -1470,7 +1465,7 @@ sal_Bool SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16
std::set< sal_uInt16> aIndices;
for( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
- ASSERT( rBoxes[i]->getRowSpan() != 1, "Forgot to split?" )
+ OSL_ENSURE( rBoxes[i]->getRowSpan() != 1, "Forgot to split?" );
if( rBoxes[i]->getRowSpan() > 1 )
aIndices.insert( i );
}
@@ -1503,7 +1498,6 @@ sal_Bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
_FndBox aFndBox( 0, 0 );
aFndBox.SetTableLines( rBoxes, *this );
aFndBox.DelFrms( *this );
-// aFndBox.SaveChartData( *this );
bRet = true;
SwTableLine *pLine = GetTabLines()[ nRowIdx ];
@@ -1541,7 +1535,6 @@ sal_Bool SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
lcl_ChangeRowSpan( *this, nCnt, --nRowIdx, true );
//Layout update
aFndBox.MakeFrms( *this );
-// aFndBox.RestoreChartData( *this );
}
CHECK_TABLE( *this )
}
@@ -1567,14 +1560,14 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
long nLeft = lcl_Box2LeftBorder( *pBox );
SwTableLine *pLine = pBox->GetUpper();
sal_uInt16 nLinePos = GetTabLines().C40_GETPOS(SwTableLine, pLine);
- ASSERT( nLinePos < USHRT_MAX, "Box/table mismatch" )
+ OSL_ENSURE( nLinePos < USHRT_MAX, "Box/table mismatch" );
if( nRowSpan > 1 )
{
if( ++nLinePos < GetTabLines().Count() )
{
pLine = GetTabLines()[ nLinePos ];
pBox = lcl_LeftBorder2Box( nLeft, pLine );
- ASSERT( pBox, "RowSpan irritation I" )
+ OSL_ENSURE( pBox, "RowSpan irritation I" );
if( pBox )
pBox->setRowSpan( --nRowSpan );
}
@@ -1585,7 +1578,7 @@ void SwTable::PrepareDelBoxes( const SwSelBoxes& rBoxes )
{
pLine = GetTabLines()[ --nLinePos ];
pBox = lcl_LeftBorder2Box( nLeft, pLine );
- ASSERT( pBox, "RowSpan irritation II" )
+ OSL_ENSURE( pBox, "RowSpan irritation II" );
if( pBox )
{
nRowSpan = pBox->getRowSpan();
@@ -1622,7 +1615,7 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = rLine.GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
long nWidth = pBox->GetFrmFmt()->GetFrmSize().GetWidth();
nRight += nWidth;
if( nRight > nMin )
@@ -1635,7 +1628,6 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
bAdd = nLeft <= nMid || nRight - nMax < nMax - nLeft;
long nRowSpan = pBox->getRowSpan();
if( bAdd &&
- //( bColumn || nRowSpan > 0 ) &&
( !bChkProtected ||
!pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) )
{
@@ -1662,7 +1654,7 @@ void lcl_SearchSelBox( const SwTable &rTable, SwSelBoxes& rBoxes, long nMin, lon
void SwTable::CreateSelection( const SwPaM& rPam, SwSelBoxes& rBoxes,
const SearchType eSearch, bool bChkProtected ) const
{
- ASSERT( bNewModel, "Don't call me for old tables" );
+ OSL_ENSURE( bNewModel, "Don't call me for old tables" );
if( !aLines.Count() )
return;
const SwNode* pStartNd = rPam.GetPoint()->nNode.GetNode().FindTableBoxStartNode();
@@ -1700,12 +1692,12 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
for( sal_uInt16 nRow = 0; nFound < 2 && nRow < nLines; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
sal_uInt16 nCols = pLine->GetTabBoxes().Count();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( pBox->GetSttNd() == pEndNd || pBox->GetSttNd() == pStartNd )
{
if( !bChkProtected ||
@@ -1745,12 +1737,12 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
for( sal_uInt16 nRow = nTop; nRow <= nBottom; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
sal_uInt16 nCount = pLine->GetTabBoxes().Count();
for( sal_uInt16 nCurrBox = 0; nCurrBox < nCount; ++nCurrBox )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrBox];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( pBox->getRowSpan() > 0 && ( !bChkProtected ||
!pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) )
rBoxes.Insert( pBox );
@@ -1798,47 +1790,6 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
lcl_SearchSelBox( *this, rBoxes, nMin, nMax, *aLines[i],
bChkProtected, bColumn );
}
- /* if( nTop + 1 < nBottom )
- {
- long nInnerMin = nUpperMin < nLowerMin ? nLowerMin : nUpperMin;
- long nInnerMax = nUpperMax < nLowerMax ? nUpperMax : nLowerMax;
- for( sal_uInt16 i = nTop + 1; i < nBottom; ++i )
- lcl_SearchSelBox( *this, rBoxes, nInnerMin, nInnerMax, *aLines[i],
- bChkProtected, bColumn );
- }
- if( bCombine ) // => nUpperMin == nLowerMin, nUpperMax == nLowerMax
- {
- if( nBottom > nTop )
- lcl_SearchSelBox( *this, rBoxes, nUpperMin, nUpperMax, *aLines[nTop],
- bChkProtected, bColumn );
- lcl_SearchSelBox( *this, rBoxes, nLowerMin, nLowerMax, *aLines[nBottom],
- bChkProtected, bColumn );
- }
- else if( aKeepBoxes.Count() )
- {
- long nMin = nUpperMin < nLowerMin ? nUpperMin : nLowerMin;
- long nMax = nUpperMax < nLowerMax ? nLowerMax : nUpperMax;
- SwSelBoxes aCandidates;
- for( sal_uInt16 i = nTop; i <= nBottom; ++i )
- lcl_SearchSelBox( *this, aCandidates, nMin, nMax, *aLines[i],
- bChkProtected, bColumn );
- sal_uInt16 nOld = 0, nNew = 0;
- while ( nOld < aKeepBoxes.Count() && nNew < aCandidates.Count() )
- {
- const SwTableBox* pPOld = *( aKeepBoxes.GetData() + nOld );
- SwTableBox* pPNew = *( aCandidates.GetData() + nNew );
- if( pPOld == pPNew )
- { // this box will stay
- rBoxes.Insert( pPNew );
- ++nOld;
- ++nNew;
- }
- else if( pPOld->GetSttIdx() < pPNew->GetSttIdx() )
- ++nOld;
- else
- ++nNew;
- }
- } */
if( bColumn )
{
for( sal_uInt16 i = nBottom + 1; i < nLines; ++i )
@@ -1853,7 +1804,7 @@ void SwTable::CreateSelection( const SwNode* pStartNd, const SwNode* pEndNd,
void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax ) const
{
- ASSERT( bNewModel, "Don't call me for old tables" );
+ OSL_ENSURE( bNewModel, "Don't call me for old tables" );
rMin = 0;
rMax = 0;
if( !aLines.Count() || !rBoxes.Count() )
@@ -1865,12 +1816,12 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
for( sal_uInt16 nRow = 0; nRow < nLineCnt && nBox < nBoxCnt; ++nRow )
{
SwTableLine* pLine = aLines[nRow];
- ASSERT( pLine, "Missing table line" );
+ OSL_ENSURE( pLine, "Missing table line" );
sal_uInt16 nCols = pLine->GetTabBoxes().Count();
for( sal_uInt16 nCol = 0; nCol < nCols; ++nCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCol];
- ASSERT( pBox, "Missing table box" );
+ OSL_ENSURE( pBox, "Missing table box" );
if( pBox == rBoxes[nBox] )
{
lcl_CheckMinMax( rMin, rMax, *pLine, nCol, nBox == 0 );
@@ -1902,7 +1853,7 @@ void SwTable::ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax
*/
void SwTable::PrepareDeleteCol( long nMin, long nMax )
{
- ASSERT( bNewModel, "Don't call me for old tables" );
+ OSL_ENSURE( bNewModel, "Don't call me for old tables" );
if( !aLines.Count() || nMax < nMin )
return;
long nMid = nMin ? ( nMin + nMax ) / 2 : 0;
@@ -1973,9 +1924,9 @@ void SwTable::ExpandSelection( SwSelBoxes& rBoxes ) const
void SwTable::CheckRowSpan( SwTableLinePtr &rpLine, bool bUp ) const
{
- ASSERT( IsNewModel(), "Don't call me for old tables" );
+ OSL_ENSURE( IsNewModel(), "Don't call me for old tables" );
sal_uInt16 nLineIdx = GetTabLines().C40_GETPOS( SwTableLine, rpLine );
- ASSERT( nLineIdx < GetTabLines().Count(), "Start line out of range" );
+ OSL_ENSURE( nLineIdx < GetTabLines().Count(), "Start line out of range" );
bool bChange = true;
if( bUp )
{
@@ -2038,12 +1989,12 @@ SwSaveRowSpan::SwSaveRowSpan( SwTableBoxes& rBoxes, sal_uInt16 nSplitLn )
{
bool bDontSave = true; // nothing changed, nothing to save
sal_uInt16 nColCount = rBoxes.Count();
- ASSERT( nColCount, "Empty Table Line" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
mnRowSpans.resize( nColCount );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = rBoxes[nCurrCol];
- ASSERT( pBox, "Missing Table Box" );
+ OSL_ENSURE( pBox, "Missing Table Box" );
long nRowSp = pBox->getRowSpan();
mnRowSpans[ nCurrCol ] = nRowSp;
if( nRowSp < 0 )
@@ -2064,24 +2015,24 @@ void SwTable::RestoreRowSpan( const SwSaveRowSpan& rSave )
if( !IsNewModel() ) // for new model only
return;
sal_uInt16 nLineCount = GetTabLines().Count();
- ASSERT( rSave.mnSplitLine < nLineCount, "Restore behind last line?" )
+ OSL_ENSURE( rSave.mnSplitLine < nLineCount, "Restore behind last line?" );
if( rSave.mnSplitLine < nLineCount )
{
SwTableLine* pLine = GetTabLines()[rSave.mnSplitLine];
sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
- ASSERT( nColCount, "Empty Table Line" )
- ASSERT( nColCount == rSave.mnRowSpans.size(), "Wrong row span store" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
+ OSL_ENSURE( nColCount == rSave.mnRowSpans.size(), "Wrong row span store" );
if( nColCount == rSave.mnRowSpans.size() )
{
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
- ASSERT( pBox, "Missing Table Box" );
+ OSL_ENSURE( pBox, "Missing Table Box" );
long nRowSp = pBox->getRowSpan();
if( nRowSp != rSave.mnRowSpans[ nCurrCol ] )
{
- ASSERT( -nRowSp == rSave.mnRowSpans[ nCurrCol ], "Pardon me?!" )
- ASSERT( rSave.mnRowSpans[ nCurrCol ] < 0, "Pardon me?!" )
+ OSL_ENSURE( -nRowSp == rSave.mnRowSpans[ nCurrCol ], "Pardon me?!" );
+ OSL_ENSURE( rSave.mnRowSpans[ nCurrCol ] < 0, "Pardon me?!" );
pBox->setRowSpan( -nRowSp );
sal_uInt16 nLine = rSave.mnSplitLine;
@@ -2134,11 +2085,11 @@ void SwTable::CleanUpBottomRowSpan( sal_uInt16 nDelLines )
sal_uInt16 nLastLine = GetTabLines().Count()-1;
SwTableLine* pLine = GetTabLines()[nLastLine];
sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
- ASSERT( nColCount, "Empty Table Line" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
- ASSERT( pBox, "Missing Table Box" );
+ OSL_ENSURE( pBox, "Missing Table Box" );
long nRowSp = pBox->getRowSpan();
if( nRowSp < 0 )
nRowSp = -nRowSp;
@@ -2150,7 +2101,7 @@ void SwTable::CleanUpBottomRowSpan( sal_uInt16 nDelLines )
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
struct RowSpanCheck
{
@@ -2172,25 +2123,22 @@ void SwTable::CheckConsistency() const
{
SwTwips nWidth = 0;
SwTableLine* pLine = GetTabLines()[nCurrLine];
- ASSERT( pLine, "Missing Table Line" )
+ OSL_ENSURE( pLine, "Missing Table Line" );
sal_uInt16 nColCount = pLine->GetTabBoxes().Count();
- ASSERT( nColCount, "Empty Table Line" )
+ OSL_ENSURE( nColCount, "Empty Table Line" );
for( sal_uInt16 nCurrCol = 0; nCurrCol < nColCount; ++nCurrCol )
{
SwTableBox* pBox = pLine->GetTabBoxes()[nCurrCol];
- ASSERT( pBox, "Missing Table Box" );
+ OSL_ENSURE( pBox, "Missing Table Box" );
SwTwips nNewWidth = pBox->GetFrmFmt()->GetFrmSize().GetWidth() + nWidth;
long nRowSp = pBox->getRowSpan();
if( nRowSp < 0 )
{
- ASSERT( aIter != aRowSpanCells.end(), "Missing master box" )
-#ifdef DBG_UTIL
- //RowSpanCheck &rCheck = *aIter;
-#endif
- ASSERT( aIter->nLeft == nWidth && aIter->nRight == nNewWidth,
+ OSL_ENSURE( aIter != aRowSpanCells.end(), "Missing master box" );
+ OSL_ENSURE( aIter->nLeft == nWidth && aIter->nRight == nNewWidth,
"Wrong position/size of overlapped table box" );
--(aIter->nRowSpan);
- ASSERT( aIter->nRowSpan == -nRowSp, "Wrong row span value" );
+ OSL_ENSURE( aIter->nRowSpan == -nRowSp, "Wrong row span value" );
if( nRowSp == -1 )
{
std::list< RowSpanCheck >::iterator aEraseIter = aIter;
@@ -2202,7 +2150,7 @@ void SwTable::CheckConsistency() const
}
else if( nRowSp != 1 )
{
- ASSERT( nRowSp, "Zero row span?!" );
+ OSL_ENSURE( nRowSp, "Zero row span?!" );
RowSpanCheck aEntry;
aEntry.nLeft = nWidth;
aEntry.nRight = nNewWidth;
@@ -2213,117 +2161,16 @@ void SwTable::CheckConsistency() const
}
if( !nCurrLine )
nLineWidth = nWidth;
- ASSERT( nWidth == nLineWidth, "Different Line Widths" )
- ASSERT( nWidth == nTabSize, "Boxen der Line zu klein/gross" )
- ASSERT( nWidth >= 0 && nWidth <= USHRT_MAX, "Width out of range" )
- ASSERT( aIter == aRowSpanCells.end(), "Missing overlapped box" )
+ OSL_ENSURE( nWidth == nLineWidth, "Different Line Widths" );
+ OSL_ENSURE( nWidth == nTabSize, "Boxen der Line zu klein/gross" );
+ OSL_ENSURE( nWidth >= 0 && nWidth <= USHRT_MAX, "Width out of range" );
+ OSL_ENSURE( aIter == aRowSpanCells.end(), "Missing overlapped box" );
aIter = aRowSpanCells.begin();
}
bool bEmpty = aRowSpanCells.empty();
- ASSERT( bEmpty, "Open row span detected" )
+ OSL_ENSURE( bEmpty, "Open row span detected" );
}
#endif
-
-#ifdef FINDSTARTENDOFROWSPANCACHE
-/*
- * A small optimization for FindStartEndOfRowSpan START
- *
- * NOTE: Results of some measurement revealed that this cache
- * does not improve performance!
- */
-
-class SwFindRowSpanCache
-{
-private:
-
- struct SwFindRowSpanCacheObj
- {
- const SwTableBox* mpKeyBox;
- const SwTableBox* mpCacheBox;
- sal_uInt16 mnSteps;
- bool mbStart;
-
- SwFindRowSpanCacheObj( const SwTableBox& rKeyBox, const SwTableBox& rCacheBox, sal_uInt16 nSteps, bool bStart ) :
- mpKeyBox( &rKeyBox ), mpCacheBox( &rCacheBox ), mnSteps( nSteps ), mbStart( bStart ) {}
- };
-
- std::list< SwFindRowSpanCacheObj > aCache;
- bool mbUseCache;
- static SwFindRowSpanCache* mpFindRowSpanCache;
- SwFindRowSpanCache();
-
-public:
-
- static SwFindRowSpanCache& getSwFindRowSpanCache();
- 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 );
-};
-
-SwFindRowSpanCache* SwFindRowSpanCache::mpFindRowSpanCache = 0;
-SwFindRowSpanCache& SwFindRowSpanCache::getSwFindRowSpanCache()
-{
- if ( !mpFindRowSpanCache ) mpFindRowSpanCache = new SwFindRowSpanCache;
- return *mpFindRowSpanCache;
-}
-
-SwFindRowSpanCache::SwFindRowSpanCache() : mbUseCache( false )
-{
-}
-
-void SwFindRowSpanCache::SetUseCache( bool bNew )
-{
- mbUseCache = bNew; aCache.clear();
-}
-
-const SwTableBox* SwFindRowSpanCache::FindCachedStartEndOfRowSpan( const SwTableBox& rKeyBox,
- sal_uInt16 nSteps,
- bool bStart )
-{
- static nCallCount = 0;
- static nSuccessCount = 0;
- ++nCallCount;
-
- if ( !mbUseCache ) return 0;
-
- const SwTableBox* pRet = 0;
-
- std::list< SwFindRowSpanCacheObj >::const_iterator aIter;
- for ( aIter = aCache.begin(); aIter != aCache.end(); ++aIter )
- {
- if ( aIter->mpKeyBox == &rKeyBox &&
- aIter->mnSteps == nSteps &&
- aIter->mbStart == bStart )
- {
- pRet = aIter->mpCacheBox;
- ++nSuccessCount;
- break;
- }
- }
-
- return pRet;
-}
-
-const int FindBoxCacheSize = 2;
-
-void SwFindRowSpanCache::SetCachedStartEndOfRowSpan( const SwTableBox& rKeyBox,
- const SwTableBox& rCacheBox,
- sal_uInt16 nSteps,
- bool bStart )
-{
- if ( !mbUseCache ) return;
-
- const SwFindRowSpanCacheObj aNew( rKeyBox, rCacheBox, nSteps, bStart );
- aCache.push_front( aNew );
- if ( aCache.size() > FindBoxCacheSize )
- aCache.pop_back();
-}
-
-/*
- * A small optimization for FindStartEndOfRowSpan END
- */
-
-#endif
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 8f41fbe873a6..513154e57c85 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifdef WTC
-#define private public
-#endif
-
#include <ctype.h>
#include <float.h>
#include <hintids.hxx>
@@ -43,7 +40,6 @@
#include <sfx2/linkmgr.hxx>
#include <editeng/boxitem.hxx>
-
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtpdsc.hxx>
@@ -73,15 +69,11 @@
#include <redline.hxx>
#include <list>
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
using namespace com::sun::star;
@@ -186,7 +178,7 @@ void SwTableBox::setDummyFlag( bool bDummy )
pImpl->setDummyFlag( bDummy );
}
-//JP 15.09.98: Bug 55741 - Tabs beibehalten (vorne und hinten)
+//JP 15.09.98: Bug 55741 - Keep tabs (front and rear)
String& lcl_TabToBlankAtSttEnd( String& rTxt )
{
sal_Unicode c;
@@ -220,12 +212,12 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
SwTableBox* pBox,
sal_uInt16 nInsPos, sal_uInt16 nCnt )
{
- ASSERT( pBox->GetSttNd(), "Box ohne Start-Node" );
+ OSL_ENSURE( pBox->GetSttNd(), "Box ohne Start-Node" );
SwNodeIndex aIdx( *pBox->GetSttNd(), +1 );
SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( !pCNd )
pCNd = pDoc->GetNodes().GoNext( &aIdx );
- ASSERT( pCNd, "Box ohne ContentNode" );
+ OSL_ENSURE( pCNd, "Box ohne ContentNode" );
if( pCNd->IsTxtNode() )
{
@@ -267,9 +259,6 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
|*
|* SwTable::SwTable()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 05. May. 93
-|*
|*************************************************************************/
SwTable::SwTable( SwTableFmt* pFmt )
: SwClient( pFmt ),
@@ -280,7 +269,7 @@ SwTable::SwTable( SwTableFmt* pFmt )
bModifyLocked( sal_False ),
bNewModel( sal_True )
{
- // default Wert aus den Optionen setzen
+ // default value set in the options
eTblChgMode = (TblChgMode)GetTblChgDefaultMode();
}
@@ -307,7 +296,7 @@ SwTable::~SwTable()
if( refObj.Is() )
{
SwDoc* pDoc = GetFrmFmt()->GetDoc();
- if( !pDoc->IsInDtor() ) // dann aus der Liste entfernen
+ if( !pDoc->IsInDtor() ) // then remove from the list
pDoc->GetLinkManager().RemoveServer( &refObj );
refObj->Closed();
@@ -336,9 +325,6 @@ SwTable::~SwTable()
|*
|* SwTable::Modify()
|*
-|* Ersterstellung JP ??
-|* Letzte Aenderung MA 06. May. 93
-|*
|*************************************************************************/
inline void FmtInArr( SvPtrarr& rFmtArr, SwFmt* pBoxFmt )
{
@@ -409,7 +395,7 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
}
}
else {
- ASSERT( false, "Rounding error" );
+ OSL_ENSURE( false, "Rounding error" );
}
nSum += nBox;
}
@@ -437,7 +423,7 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
if ( !IsModifyLocked() )
{
- ASSERT( pOldSize && pOldSize->Which() == RES_FRM_SIZE &&
+ OSL_ENSURE( pOldSize && pOldSize->Which() == RES_FRM_SIZE &&
pNewSize && pNewSize->Which() == RES_FRM_SIZE,
"Kein Old oder New fuer FmtFrmSize-Modify der SwTable." );
AdjustWidths( pOldSize->GetWidth(), pNewSize->GetWidth() );
@@ -457,9 +443,6 @@ void SwTable::AdjustWidths( const long nOld, const long nNew )
|*
|* SwTable::GetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 30. Nov. 95
-|*
|*************************************************************************/
void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos )
{
@@ -475,7 +458,7 @@ void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos )
void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const SwFrmFmt *pTabFmt, const sal_Bool bHidden,
- const FASTBOOL bRefreshHidden )
+ const bool bRefreshHidden )
{
const long nWish = pTabFmt->GetFrmSize().GetWidth();
const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
@@ -578,7 +561,7 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
}
void lcl_ProcessBoxGet( const SwTableBox *pBox, SwTabCols &rToFill,
- const SwFrmFmt *pTabFmt, FASTBOOL bRefreshHidden )
+ const SwFrmFmt *pTabFmt, bool bRefreshHidden )
{
if ( pBox->GetTabLines().Count() )
{
@@ -620,7 +603,7 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
//Array aktualisiert.
if ( bRefreshHidden )
{
- //Korrekturen entfernen
+ // remove corrections
sal_uInt16 i;
for ( i = 0; i < rToFill.Count(); ++i )
{
@@ -711,9 +694,6 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
|*
|* SwTable::SetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 26. Aug. 98
-|*
|*************************************************************************/
//Struktur zur Parameteruebergabe
struct Parm
@@ -726,7 +706,7 @@ struct Parm
SwShareBoxFmts aShareFmts;
Parm( const SwTabCols &rN, const SwTabCols &rO ) :
- rNew( rN ), rOld( rO ), aBoxArr( 10, 1 ) {}
+ rNew( rN ), rOld( rO ), nNewWish(0), nOldWish(0), aBoxArr( 10, 1 ){}
};
inline sal_Bool BoxInArr( SvPtrarr& rArr, SwTableBox* pBox )
{
@@ -831,11 +811,6 @@ void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
nRightDiff = (long)rParm.rNew[nLeftPos] -
(long)rParm.rOld[nLeftPos];
}
-//MA 11. Feb. 99: #61577# 0 sollte doch gerade richtig sein, weil die
-//Kante doch schon in SetTabCols() korrigiert wurde.
-// else
-// nRightDiff = (long)rParm.rNew.GetRight() -
-// (long)rParm.rOld.GetRight();
}
if( pBox->getRowSpan() == 1 )
@@ -937,8 +912,6 @@ void lcl_AdjustBox( SwTableBox *pBox, const long nDiff, Parm &rParm )
//Groesse der Box anpassen.
SwFmtFrmSize aFmtFrmSize( pBox->GetFrmFmt()->GetFrmSize() );
aFmtFrmSize.SetWidth( aFmtFrmSize.GetWidth() + nDiff );
-//#30009# if ( aFmtFrmSize.GetWidth() < 0 )
-// aFmtFrmSize.SetWidth( -aFmtFrmSize.GetWidth() );
rParm.aShareFmts.SetSize( *pBox, aFmtFrmSize );
}
@@ -956,7 +929,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
Parm aParm( rNew, rOld );
- ASSERT( rOld.Count() == rNew.Count(), "Columnanzahl veraendert.");
+ OSL_ENSURE( rOld.Count() == rNew.Count(), "Columnanzahl veraendert.");
//Raender verarbeiten. Groesse der Tabelle und ein paar Boxen mussen
//angepasst werden. Bei der Groesseneinstellung darf allerdings das
@@ -994,7 +967,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
else if(!bLeftDist && rNew.GetRight() + nShRight < rNew.GetRightMax())
aOri.SetHoriOrient( text::HoriOrientation::LEFT );
else
- aOri.SetHoriOrient( text::HoriOrientation::NONE );
+ aOri.SetHoriOrient( text::HoriOrientation::LEFT_AND_WIDTH );
}
pFmt->SetFmtAttr( aOri );
}
@@ -1091,7 +1064,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
// steht im tblrwcl.cxx
extern void _CheckBoxWidth( const SwTableLine&, SwTwips );
@@ -1198,7 +1171,7 @@ static void lcl_CalcNewWidths( std::list<sal_uInt16> &rSpanPos, ChangeList& rCha
sal_uInt16 nPos = (sal_uInt16)nSum;
while( pCurr != rChanges.end() && pCurr->first < nPos )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nTemp = pCurr->first;
nTemp = pCurr->second;
#endif
@@ -1298,7 +1271,7 @@ static void lcl_CalcNewWidths( std::list<sal_uInt16> &rSpanPos, ChangeList& rCha
void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
const SwTabCols &rOld, const SwTableBox *pStart, sal_Bool bCurRowOnly )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static int nCallCount = 0;
++nCallCount;
#endif
@@ -1407,9 +1380,6 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
|* const SwTableBox* SwTable::GetTblBox( const Strn?ng& rName ) const
|* gebe den Pointer auf die benannte Box zurueck.
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
sal_Bool IsValidRowName( const String& rStr )
@@ -1518,7 +1488,7 @@ const SwTableBox* SwTable::GetTblBox( const String& rName,
// Box ist ??
if( pBox && !pBox->GetSttNd() )
{
- ASSERT( sal_False, "Box ohne Inhalt, suche die naechste !!" );
+ OSL_ENSURE( sal_False, "Box ohne Inhalt, suche die naechste !!" );
// "herunterfallen lassen" bis zur ersten Box
while( pBox->GetTabLines().Count() )
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
@@ -1595,9 +1565,6 @@ sal_Bool SwTable::IsTblComplex() const
|*
|* SwTableLine::SwTableLine()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 09. Mar. 93
-|*
|*************************************************************************/
SwTableLine::SwTableLine( SwTableLineFmt *pFmt, sal_uInt16 nBoxes,
SwTableBox *pUp )
@@ -1621,9 +1588,6 @@ SwTableLine::~SwTableLine()
|*
|* SwTableLine::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 03. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableLine::ClaimFrmFmt()
{
@@ -1748,9 +1712,6 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
|*
|* SwTableBox::SwTableBox()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 04. May. 93
-|*
|*************************************************************************/
SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, sal_uInt16 nLines, SwTableLine *pUp )
: SwClient( 0 ),
@@ -1775,7 +1736,7 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwNodeIndex &rIdx,
// an der Table eintragen
const SwTableNode* pTblNd = pSttNd->FindTableNode();
- ASSERT( pTblNd, "in welcher Tabelle steht denn die Box?" );
+ OSL_ENSURE( pTblNd, "in welcher Tabelle steht denn die Box?" );
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTblNd->GetTable().
GetTabSortBoxes();
SwTableBox* p = this; // error: &this
@@ -1793,7 +1754,7 @@ SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, const SwStartNode& rSttNd, SwTableL
// an der Table eintragen
const SwTableNode* pTblNd = pSttNd->FindTableNode();
- ASSERT( pTblNd, "in welcher Tabelle steht denn die Box?" );
+ OSL_ENSURE( pTblNd, "in welcher Tabelle steht denn die Box?" );
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTblNd->GetTable().
GetTabSortBoxes();
SwTableBox* p = this; // error: &this
@@ -1807,7 +1768,7 @@ SwTableBox::~SwTableBox()
{
// an der Table austragen
const SwTableNode* pTblNd = pSttNd->FindTableNode();
- ASSERT( pTblNd, "in welcher Tabelle steht denn die Box?" );
+ OSL_ENSURE( pTblNd, "in welcher Tabelle steht denn die Box?" );
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTblNd->GetTable().
GetTabSortBoxes();
SwTableBox *p = this; // error: &this
@@ -1852,9 +1813,6 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
|*
|* SwTableBox::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableBox::ClaimFrmFmt()
{
@@ -1939,9 +1897,6 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
|* gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt
|* und ergibt sich aus der Position in den Lines/Boxen/Tabelle
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm )
{
@@ -2013,7 +1968,7 @@ sal_Bool SwTableBox::IsInHeadline( const SwTable* pTbl ) const
return pTbl->GetTabLines()[ 0 ] == pLine;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uLong SwTableBox::GetSttIdx() const
{
@@ -2358,7 +2313,7 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
SwTableBox* pBox = (SwTableBox*)aIter.First( TYPE( SwTableBox ) );
if( pBox )
{
- ASSERT( !aIter.Next(), "keine Box oder mehrere am Format" );
+ OSL_ENSURE( !aIter.Next(), "keine Box oder mehrere am Format" );
sal_uLong nNewFmt;
if( pNewFmt )
@@ -2490,13 +2445,6 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
else if( bNewIsTxtFmt && nOldFmt != nNewFmt )
{
- // auf jedenfall muessen jetzt die Formeln/Values
- // geloescht werden!
- // LockModify();
- // ResetAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE );
- // UnlockModify();
-
-
ChgNumToText( *pBox, nNewFmt );
}
}
@@ -2540,21 +2488,6 @@ sal_Bool SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
rFmtIndex = 0;
bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum );
-
-/*
-// wie bekommt man aus dem neuen String den neuen Wert?
-// denn der Numberformater erkennt aus "123.--DM" kein Zahlenformat!
- if( !bRet && rFmtIndex && !pNumFmtr->IsTextFormat( rFmtIndex ) &&
- SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_VALUE,
- sal_False, &pItem ))
- {
- Color* pCol;
- String sNewTxt;
- pNumFmtr->GetOutputString( ((SwTblBoxValue*)pItem)->GetValue(),
- rFmtIndex, sNewTxt, &pCol );
- bRet = aTxt == sNewTxt;
- }
-*/
}
else
rIsEmptyTxtNd = sal_False;
@@ -2611,14 +2544,14 @@ sal_uLong SwTableBox::IsValidNumTxtNd( sal_Bool bCheckAttr ) const
{
const SwNode* pNode = pSttNd->GetNodes()[nIndex];
if( pNode->IsTableNode() )
- { /*return ULONG_MAX if the cell contains a table(in table)*/
+ {
pTextNode = 0;
break;
}
if( pNode->IsTxtNode() )
{
if( pTextNode )
- { /*return ULONG_MAX if the cell contains complex paragraphs*/
+ {
pTextNode = 0;
break;
}
@@ -2882,3 +2815,5 @@ const SwTableBox * SwTableCellInfo::getTableBox() const
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 7d777089fb7f..dc6db207b65a 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,7 +100,7 @@ FrmTagIdMap SwEnhancedPDFExportHelper::aFrmTagIdMap;
LanguageType SwEnhancedPDFExportHelper::eLanguageDefault = 0;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
static std::vector< sal_uInt16 > aStructStack;
@@ -288,7 +289,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo,
if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Int32 nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement();
lcl_DBGCheckStack();
#endif
@@ -301,7 +302,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo,
else
BeginTag( vcl::PDFWriter::NonStructElement, aEmptyString );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement();
lcl_DBGCheckStack();
#endif
@@ -316,13 +317,13 @@ SwTaggedPDFHelper::~SwTaggedPDFHelper()
{
if ( mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportTaggedPDF() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Int32 nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement();
lcl_DBGCheckStack();
#endif
EndStructureElements();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement();
lcl_DBGCheckStack();
#endif
@@ -389,9 +390,9 @@ bool SwTaggedPDFHelper::CheckReopenTag()
{
nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement();
const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag );
- ASSERT( bSuccess, "Failed to reopen tag" )
+ OSL_ENSURE( bSuccess, "Failed to reopen tag" );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.push_back( 99 );
#endif
@@ -412,9 +413,9 @@ bool SwTaggedPDFHelper::CheckRestoreTag() const
{
const bool bSuccess = mpPDFExtOutDevData->SetCurrentStructureElement( nRestoreCurrentTag );
(void)bSuccess;
- ASSERT( bSuccess, "Failed to restore reopened tag" )
+ OSL_ENSURE( bSuccess, "Failed to restore reopened tag" );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.pop_back();
#endif
@@ -434,7 +435,7 @@ void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const Str
const sal_Int32 nId = mpPDFExtOutDevData->BeginStructureElement( eType, rtl::OUString( rString ) );
++nEndStructureElement;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.push_back( static_cast<sal_uInt16>(eType) );
#endif
@@ -494,7 +495,7 @@ void SwTaggedPDFHelper::EndTag()
{
mpPDFExtOutDevData->EndStructureElement();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.pop_back();
#endif
}
@@ -655,7 +656,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
if ( bTextIndent )
{
- ASSERT( pFrm->IsTxtFrm(), "Frame type <-> tag attribute mismatch" )
+ OSL_ENSURE( pFrm->IsTxtFrm(), "Frame type <-> tag attribute mismatch" );
const SvxLRSpaceItem &rSpace =
static_cast<const SwTxtFrm*>(pFrm)->GetTxtNode()->GetSwAttrSet().GetLRSpace();
nVal = rSpace.GetTxtFirstLineOfst();
@@ -665,7 +666,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
if ( bTextAlign )
{
- ASSERT( pFrm->IsTxtFrm(), "Frame type <-> tag attribute mismatch" )
+ OSL_ENSURE( pFrm->IsTxtFrm(), "Frame type <-> tag attribute mismatch" );
const SwAttrSet& aSet = static_cast<const SwTxtFrm*>(pFrm)->GetTxtNode()->GetSwAttrSet();
const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust();
if ( SVX_ADJUST_BLOCK == nAdjust || SVX_ADJUST_CENTER == nAdjust ||
@@ -684,7 +685,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
if ( bAlternateText )
{
- ASSERT( pFrm->IsFlyFrm(), "Frame type <-> tag attribute mismatch" )
+ OSL_ENSURE( pFrm->IsFlyFrm(), "Frame type <-> tag attribute mismatch" );
const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pFrm);
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
@@ -740,7 +741,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
const TableColumnsMapEntry::const_iterator aLeftIter = rCols.find( nLeft );
const TableColumnsMapEntry::const_iterator aRightIter = rCols.find( nRight );
- ASSERT( aLeftIter != rCols.end() && aRightIter != rCols.end(), "Colspan trouble" )
+ OSL_ENSURE( aLeftIter != rCols.end() && aRightIter != rCols.end(), "Colspan trouble" );
if ( aLeftIter != rCols.end() && aRightIter != rCols.end() )
{
nVal = std::distance( aLeftIter, aRightIter );
@@ -862,12 +863,12 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
*/
void SwTaggedPDFHelper::BeginNumberedListStructureElements()
{
- ASSERT( mpNumInfo, "List without mpNumInfo?" )
+ OSL_ENSURE( mpNumInfo, "List without mpNumInfo?" );
if ( !mpNumInfo )
return;
const SwFrm& rFrm = mpNumInfo->mrFrm;
- ASSERT( rFrm.IsTxtFrm(), "numbered only for text frames" )
+ OSL_ENSURE( rFrm.IsTxtFrm(), "numbered only for text frames" );
const SwTxtFrm& rTxtFrm = static_cast<const SwTxtFrm&>(rFrm);
//
@@ -970,7 +971,7 @@ void SwTaggedPDFHelper::BeginNumberedListStructureElements()
nRestoreCurrentTag = mpPDFExtOutDevData->GetCurrentStructureElement();
mpPDFExtOutDevData->SetCurrentStructureElement( nReopenTag );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.push_back( 99 );
#endif
}
@@ -1101,7 +1102,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
static_cast<const SwTxtFrm*>(pFrm)->GetTxtNode();
const SwFmt* pTxtFmt = pTxtNd->GetFmtColl();
- const SwFmt* pParentTxtFmt = pTxtFmt->DerivedFrom();
+ const SwFmt* pParentTxtFmt = pTxtFmt ? pTxtFmt->DerivedFrom() : NULL;
String sStyleName;
String sParentStyleName;
@@ -1525,7 +1526,7 @@ SwEnhancedPDFExportHelper::SwEnhancedPDFExportHelper( SwEditShell& rSh,
aNumListBodyIdMap.clear();
aFrmTagIdMap.clear();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
aStructStack.clear();
#endif
@@ -1598,7 +1599,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{
const SwTxtNode* pTNd =
(SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
- ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
+ OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
@@ -1654,10 +1655,10 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
for( sal_uInt16 n = 0; n < nHyperLinkCount; ++n )
{
SwGetINetAttr* p = aArr[ n ];
- ASSERT( 0 != p, "Enhanced pdf export - SwGetINetAttr is missing" )
+ OSL_ENSURE( 0 != p, "Enhanced pdf export - SwGetINetAttr is missing" );
const SwTxtNode* pTNd = p->rINetAttr.GetpTxtNode();
- ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
+ OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
// 1. Check if the whole paragraph is hidden
// 2. Move to the hyperlink
@@ -1688,7 +1689,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// be deleted again in JumpToSwMark.
SwRects aTmp;
aTmp.Insert( mrSh.SwCrsrShell::_GetCrsr(), 0 );
- ASSERT( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" )
+ OSL_ENSURE( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" );
// Create the destination for internal links:
sal_Int32 nDestId = -1;
@@ -1840,7 +1841,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{
const SwTxtNode* pTNd =
(SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
- ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
+ OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
@@ -1856,7 +1857,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Link Rectangles
SwRects aTmp;
aTmp.Insert( mrSh.SwCrsrShell::_GetCrsr(), 0 );
- ASSERT( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" )
+ OSL_ENSURE( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" );
mrSh.SwCrsrShell::ClearMark();
@@ -1947,7 +1948,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Link Rectangle
SwRects aTmp;
aTmp.Insert( mrSh.SwCrsrShell::_GetCrsr(), 0 );
- ASSERT( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" )
+ OSL_ENSURE( aTmp.Count() > 0, "Enhanced pdf export - rectangles are missing" );
const SwRect aLinkRect( aTmp[ 0 ] );
mrSh._GetCrsr()->RestoreSavePos();
@@ -2002,7 +2003,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
{
// Check if outline is hidden
const SwTxtNode* pTNd = mrSh.GetNodes().GetOutLineNds()[ i ]->GetTxtNode();
- ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
+ OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
if ( pTNd->IsHidden() ||
// --> FME 2005-01-10 #i40292# Skip empty outlines:
@@ -2117,7 +2118,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
else
pPDFExtOutDevData->SetLinkURL( aIBeg->nLinkId, aBookmarkName );
- aIBeg++;
+ ++aIBeg;
}
rBookmarks.clear();
}
@@ -2215,3 +2216,4 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/SwGrammarMarkUp.cxx b/sw/source/core/text/SwGrammarMarkUp.cxx
index cddf4519fd50..b3873d6b7ff9 100644
--- a/sw/source/core/text/SwGrammarMarkUp.cxx
+++ b/sw/source/core/text/SwGrammarMarkUp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -164,3 +165,4 @@ xub_StrLen SwGrammarMarkUp::getSentenceEnd( xub_StrLen nPos )
return nRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index f5b8f87fe25c..1befde44e5d5 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -157,16 +158,16 @@ public:
inline const SfxPoolItem& SwAttrHandler::GetDefault( const sal_uInt16 nAttribID ) const
{
- ASSERT( nAttribID < RES_TXTATR_END,
+ OSL_ENSURE( nAttribID < RES_TXTATR_END,
"this attrib does not ex."
);
- ASSERT( pDefaultArray[ StackPos[ nAttribID ] ], "array not initialized" );
+ OSL_ENSURE( pDefaultArray[ StackPos[ nAttribID ] ], "array not initialized" );
return *pDefaultArray[ StackPos[ nAttribID ] ];
}
inline void SwAttrHandler::ResetFont( SwFont& rFnt ) const
{
- ASSERT( pFnt, "ResetFont without a font" );
+ OSL_ENSURE( pFnt, "ResetFont without a font" );
if ( pFnt )
rFnt = *pFnt;
};
@@ -177,3 +178,5 @@ inline const SwFont* SwAttrHandler::GetFont() const
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 63f3c22151b3..92e88ecde74a 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
-#include <errhdl.hxx> // ASSERT
#include <atrhndl.hxx>
#include <svl/itemiter.hxx>
#include <vcl/outdev.hxx>
@@ -332,7 +332,7 @@ void SwAttrHandler::SwAttrStack::Insert( const SwTxtAttr& rAttr, const sal_uInt1
}
}
- ASSERT( nPos <= nCount, "wrong position for insert operation");
+ OSL_ENSURE( nPos <= nCount, "wrong position for insert operation");
if ( nPos < nCount )
memmove( pArray + nPos + 1, pArray + nPos,
@@ -520,7 +520,7 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
{
- ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END,
+ OSL_ENSURE( rItem.Which() < RES_TXTATR_WITHEND_END,
"I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
// robust
@@ -541,7 +541,7 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
}
sal_uInt16 nPos = aAttrStack[ nStack ].Count();
- ASSERT( nPos, "empty stack?" );
+ OSL_ENSURE( nPos, "empty stack?" );
aAttrStack[ nStack ].Insert( rAttr, nPos - 1 );
return sal_False;
}
@@ -598,7 +598,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
{
- ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END,
+ OSL_ENSURE( rAttr.Which() < RES_TXTATR_WITHEND_END,
"I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
if ( rAttr.Which() < RES_TXTATR_WITHEND_END )
@@ -612,7 +612,7 @@ void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
*************************************************************************/
void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
{
- ASSERT( nAttr < RES_TXTATR_WITHEND_END,
+ OSL_ENSURE( nAttr < RES_TXTATR_WITHEND_END,
"I cannot activate this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
const sal_uInt16 nStackPos = StackPos[ nAttr ];
@@ -944,7 +944,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
void SwAttrHandler::GetDefaultAscentAndHeight( ViewShell* pShell, OutputDevice& rOut,
sal_uInt16& nAscent, sal_uInt16& nHeight ) const
{
- ASSERT( pFnt, "No font available for GetDefaultAscentAndHeight" )
+ OSL_ENSURE( pFnt, "No font available for GetDefaultAscentAndHeight" );
if ( pFnt )
{
@@ -954,3 +954,4 @@ void SwAttrHandler::GetDefaultAscentAndHeight( ViewShell* pShell, OutputDevice&
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 611f167bbea2..596820a3ab0d 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -196,3 +197,4 @@ void SwBlink::FrmDelete( const SwRootFrm* pRoot )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 810efc66f1da..87b56063b87a 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,6 @@
#include <unicode/ubidi.h>
-#include "txtcfg.hxx"
#include "txtfrm.hxx" // SwTxtFrm
#include "inftxt.hxx" // SwTxtSizeInfo
#include "itrtxt.hxx" // SwTxtCursor
@@ -113,7 +113,7 @@ SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos,
pFrmAtPos->GetFormatted();
pFrmAtPos = pFrmAtPos->FindMaster();
}
- ASSERT( pFrmAtPos, "+GetCharRect: no frame with my rightmargin" );
+ OSL_ENSURE( pFrmAtPos, "+GetCharRect: no frame with my rightmargin" );
}
return pFrmAtPos ? pFrmAtPos : pFrm;
}
@@ -121,7 +121,7 @@ SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos,
sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew )
{
// In Bereichen und ausserhalb von Flies wird nicht mehr gescrollt.
- ASSERT( !pFrm->IsFollow(), "Illegal Scrolling by Follow!" );
+ OSL_ENSURE( !pFrm->IsFollow(), "Illegal Scrolling by Follow!" );
if( pFrm->GetOfst() != nNew && !pFrm->IsInSct() )
{
SwFlyFrm *pFly = pFrm->FindFlyFrm();
@@ -200,7 +200,7 @@ SwTxtFrm *SwTxtFrm::GetFrmAtPos( const SwPosition &rPos )
sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
SwCrsrMoveState *pCMS ) const
{
- ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::GetCharRect with swapped frame" );
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::GetCharRect with swapped frame" );
if( IsLocked() || IsHiddenNow() )
return sal_False;
@@ -354,7 +354,7 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos,
if( bRet )
{
SwPageFrm *pPage = pFrm->FindPageFrm();
- ASSERT( pPage, "Text esaped from page?" );
+ OSL_ENSURE( pPage, "Text esaped from page?" );
const SwTwips nOrigTop = (rOrig.*fnRect->fnGetTop)();
const SwTwips nPageTop = (pPage->Frm().*fnRect->fnGetTop)();
const SwTwips nPageBott = (pPage->Frm().*fnRect->fnGetBottom)();
@@ -618,7 +618,6 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
aLine.TwipsToLine( rPoint.Y() );
while( aLine.Y() + aLine.GetLineHeight() > nMaxY )
{
- DBG_LOOP;
if( !aLine.Prev() )
break;
}
@@ -887,14 +886,16 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
aCharBox.Pos().X() = aCharBox.Pos().X() - 150;
// siehe Kommentar in SwTxtFrm::GetCrsrOfst()
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
// Der Node soll nicht gewechselt werden
xub_StrLen nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(),
aCharBox.Pos(), sal_False );
- ASSERT( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
- "SwTxtFrm::UnitUp: illegal node change" )
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
+ "SwTxtFrm::UnitUp: illegal node change" );
+#endif
// 7684: Wir stellen sicher, dass wir uns nach oben bewegen.
if( nTmpOfst >= nStart && nStart && !bSecondOfDouble )
@@ -1253,7 +1254,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
if( pNextLine || bFirstOfDouble )
{
aCharBox.SSize().Width() /= 2;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// siehe Kommentar in SwTxtFrm::GetCrsrOfst()
const sal_uLong nOldNode = pPam->GetPoint()->nNode.GetIndex();
#endif
@@ -1262,8 +1263,10 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
xub_StrLen nTmpOfst = aLine.GetCrsrOfst( pPam->GetPoint(),
aCharBox.Pos(), sal_False );
- ASSERT( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
- "SwTxtFrm::UnitDown: illegal node change" )
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( nOldNode == pPam->GetPoint()->nNode.GetIndex(),
+ "SwTxtFrm::UnitDown: illegal node change" );
+#endif
// 7684: Wir stellen sicher, dass wir uns nach unten bewegen.
if( nTmpOfst <= nStart && ! bFirstOfDouble )
@@ -1541,7 +1544,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
SwTwips nSpace = 0;
if( FILL_TAB != rFill.Mode() )
{
-static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+static sal_Char const sDoubleSpace[] = " ";
const XubString aTmp( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTmp, 0, 2 );
@@ -1745,3 +1748,5 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
((SwCrsrMoveState*)rFill.pCMS)->bFillRet = bFill;
delete pFnt;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 4fac26a7a08d..5ac6d2e685ec 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/hyznitem.hxx>
@@ -47,7 +47,6 @@
#include <pam.hxx>
#include <flyfrms.hxx>
#include <fmtanchr.hxx>
-#include <txtcfg.hxx>
#include <itrform2.hxx> // SwTxtFormatter
#include <widorp.hxx> // Widows and Orphans
#include <txtcache.hxx>
@@ -62,6 +61,9 @@
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
+// Toleranzwert in der Formatierung und Textausgabe.
+#define SLOPPY_TWIPS 5
+
class FormatLevel
{
static MSHORT nLevel;
@@ -84,23 +86,6 @@ void ValidateTxt( SwFrm *pFrm ) // Freund vom Frame
( pFrm->IsVertical() &&
pFrm->Frm().Height() == pFrm->GetUpper()->Prt().Height() ) )
pFrm->bValidSize = sal_True;
-/*
- pFrm->bValidPrtArea = sal_True;
- //Die Position validieren um nicht unnoetige (Test-)Moves zu provozieren.
- //Dabei darf allerdings nicht eine tatsaechlich falsche Coordinate
- //validiert werden.
- if ( !pFrm->bValidPos )
- {
- //Leider muessen wir dazu die korrekte Position berechnen.
- Point aOld( pFrm->Frm().Pos() );
- pFrm->MakePos();
- if ( aOld != pFrm->Pos() )
- {
- pFrm->Frm().Pos( aOld );
- pFrm->bValidPos = sal_False;
- }
- }
-*/
}
void SwTxtFrm::ValidateFrm()
@@ -129,7 +114,7 @@ void SwTxtFrm::ValidateFrm()
ValidateTxt( this );
//MA: mindestens das MustFit-Flag muessen wir retten!
- ASSERT( HasPara(), "ResetPreps(), missing ParaPortion." );
+ OSL_ENSURE( HasPara(), "ResetPreps(), missing ParaPortion." );
SwParaPortion *pPara = GetPara();
const sal_Bool bMustFit = pPara->IsPrepMustFit();
ResetPreps();
@@ -185,7 +170,7 @@ sal_Bool SwTxtFrm::_GetDropRect( SwRect &rRect ) const
{
SWAP_IF_NOT_SWAPPED( this )
- ASSERT( HasPara(), "SwTxtFrm::_GetDropRect: try again next year." );
+ OSL_ENSURE( HasPara(), "SwTxtFrm::_GetDropRect: try again next year." );
SwTxtSizeInfo aInf( (SwTxtFrm*)this );
SwTxtMargin aLine( (SwTxtFrm*)this, &aInf );
if( aLine.GetDropLines() )
@@ -233,7 +218,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst )
{
SWAP_IF_SWAPPED( this )
- ASSERT( HasFollow(), "CalcFollow: missing Follow." );
+ OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." );
SwTxtFrm* pMyFollow = GetFollow();
@@ -245,7 +230,7 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst )
( pMyFollow->IsVertical() && !pMyFollow->Prt().Width() ) ||
( ! pMyFollow->IsVertical() && !pMyFollow->Prt().Height() ) )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const SwFrm *pOldUp = GetUpper();
#endif
@@ -332,12 +317,12 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst )
pMyFollow->Calc();
// Der Follow merkt anhand seiner Frm().Height(), dass was schief
// gelaufen ist.
- ASSERT( !pMyFollow->GetPrev(), "SwTxtFrm::CalcFollow: cheesy follow" );
+ OSL_ENSURE( !pMyFollow->GetPrev(), "SwTxtFrm::CalcFollow: cheesy follow" );
if( pMyFollow->GetPrev() )
{
pMyFollow->Prepare( PREP_CLEAR );
pMyFollow->Calc();
- ASSERT( !pMyFollow->GetPrev(), "SwTxtFrm::CalcFollow: very cheesy follow" );
+ OSL_ENSURE( !pMyFollow->GetPrev(), "SwTxtFrm::CalcFollow: very cheesy follow" );
}
// OD 14.03.2003 #i11760# - reset control flag for follow format.
@@ -374,8 +359,8 @@ sal_Bool SwTxtFrm::CalcFollow( const xub_StrLen nTxtOfst )
pPage->ValidateCntnt();
}
-#ifdef DBG_UTIL
- ASSERT( pOldUp == GetUpper(), "SwTxtFrm::CalcFollow: heavy follow" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( pOldUp == GetUpper(), "SwTxtFrm::CalcFollow: heavy follow" );
#endif
const long nRemaining =
@@ -481,7 +466,7 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
SwTwips nRstHeight;
if ( IsVertical() )
{
- ASSERT( ! IsSwapped(),"Swapped frame while calculating nRstHeight" );
+ OSL_ENSURE( ! IsSwapped(),"Swapped frame while calculating nRstHeight" );
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if ( IsVertLR() )
@@ -510,7 +495,7 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
{
long nAdd = (*fnRect->fnYDiff)( (GetUpper()->Lower()->Frm().*fnRect->fnGetTop)(),
(GetUpper()->*fnRect->fnGetPrtTop)() );
- ASSERT( nAdd >= 0, "Ey" );
+ OSL_ENSURE( nAdd >= 0, "Ey" );
nRstHeight += nAdd;
}
@@ -586,7 +571,7 @@ void SwTxtFrm::_AdjustFollow( SwTxtFormatter &rLine,
{
if( ((SwTxtFrm*)GetFollow())->IsLocked() )
{
- ASSERT( sal_False, "+SwTxtFrm::JoinFrm: Follow ist locked." );
+ OSL_ENSURE( sal_False, "+SwTxtFrm::JoinFrm: Follow ist locked." );
return;
}
JoinFrm();
@@ -608,7 +593,6 @@ void SwTxtFrm::_AdjustFollow( SwTxtFormatter &rLine,
while( GetFollow() && GetFollow()->GetFollow() &&
nNewOfst >= GetFollow()->GetFollow()->GetOfst() )
{
- DBG_LOOP;
JoinFrm();
}
}
@@ -634,7 +618,7 @@ void SwTxtFrm::_AdjustFollow( SwTxtFormatter &rLine,
SwCntntFrm *SwTxtFrm::JoinFrm()
{
- ASSERT( GetFollow(), "+SwTxtFrm::JoinFrm: no follow" );
+ OSL_ENSURE( GetFollow(), "+SwTxtFrm::JoinFrm: no follow" );
SwTxtFrm *pFoll = GetFollow();
SwTxtFrm *pNxt = pFoll->GetFollow();
@@ -672,12 +656,12 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else if ( pFoll->GetValidPrtAreaFlag() ||
pFoll->GetValidSizeFlag() )
{
pFoll->CalcFtnFlag();
- ASSERT( !pFoll->HasFtn(), "Missing FtnFlag." );
+ OSL_ENSURE( !pFoll->HasFtn(), "Missing FtnFlag." );
}
#endif
@@ -772,11 +756,11 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
CalcFtnFlag( nTxtPos-1 );
- ASSERT( !HasFtn(), "Missing FtnFlag." );
+ OSL_ENSURE( !HasFtn(), "Missing FtnFlag." );
}
#endif
@@ -797,12 +781,6 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
void SwTxtFrm::_SetOfst( const xub_StrLen nNewOfst )
{
-#ifdef DBGTXT
- // Es gibt tatsaechlich einen Sonderfall, in dem ein SetOfst(0)
- // zulaessig ist: bug 3496
- ASSERT( nNewOfst, "!SwTxtFrm::SetOfst: missing JoinFrm()." );
-#endif
-
// Die Invalidierung unseres Follows ist nicht noetig.
// Wir sind ein Follow, werden gleich formatiert und
// rufen von dort aus das SetOfst() !
@@ -824,7 +802,7 @@ void SwTxtFrm::_SetOfst( const xub_StrLen nNewOfst )
sal_Bool SwTxtFrm::CalcPreps()
{
- ASSERT( ! IsVertical() || ! IsSwapped(), "SwTxtFrm::CalcPreps with swapped frame" );
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(), "SwTxtFrm::CalcPreps with swapped frame" );
SWRECTFN( this );
SwParaPortion *pPara = GetPara();
@@ -847,7 +825,7 @@ sal_Bool SwTxtFrm::CalcPreps()
{
if( !GetFollow() )
{
- ASSERT( GetFollow(), "+SwTxtFrm::CalcPreps: no credits" );
+ OSL_ENSURE( GetFollow(), "+SwTxtFrm::CalcPreps: no credits" );
return sal_False;
}
@@ -883,7 +861,7 @@ sal_Bool SwTxtFrm::CalcPreps()
}
else
{
- ASSERT( nChgHeight < (Prt().*fnRect->fnGetHeight)(),
+ OSL_ENSURE( nChgHeight < (Prt().*fnRect->fnGetHeight)(),
"+SwTxtFrm::CalcPrep: wanna shrink" );
nChgHeight = (Prt().*fnRect->fnGetHeight)() - nChgHeight;
@@ -902,7 +880,6 @@ sal_Bool SwTxtFrm::CalcPreps()
else
rRepaint.Chg( Frm().Pos() + Prt().Pos(), Prt().SSize() );
- // 6792: Rrand < LRand und Repaint
if( 0 >= rRepaint.Width() )
rRepaint.Width(1);
}
@@ -1156,53 +1133,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
AdjustFrm( nChg, bHasToFit );
-/*
- // 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, sal_False ) invalidated
- // the other flags => loop
-
- // OD 04.04.2003 #108446# - handle special case:
- // If text frame contains no content and just has split, because of a
- // line stop, it has to move forward. To force this forward move without
- // unnecessary formatting of its footnotes and its follow, especially in
- // columned sections, adjust frame height to zero (0) and do not perform
- // the intrinsic format of the follow.
- // The formating method <SwCntntFrm::MakeAll()> will initiate the move forward.
- sal_Bool bForcedNoIntrinsicFollowCalc = sal_False;
- if ( nEnd == 0 &&
- rLine.IsStop() && HasFollow() && nNew == 1
- )
- {
- AdjustFrm( -Frm().SSize().Height(), bHasToFit );
- Prt().Pos().Y() = 0;
- Prt().Height( Frm().Height() );
- if ( FollowFormatAllowed() )
- {
- bForcedNoIntrinsicFollowCalc = sal_True;
- ForbidFollowFormat();
- }
- }
- else
- {
- AdjustFrm( nChg, bHasToFit );
- }
- */
-
if( HasFollow() || IsInFtn() )
_AdjustFollow( rLine, nEnd, nStrLen, nNew );
- // FME 16.07.2003 #i16930# - removed this code because it did not work
- // correctly
- // OD 04.04.2003 #108446# - allow intrinsic format of follow, if above
- // special case has forbit it.
-/* if ( bForcedNoIntrinsicFollowCalc )
- {
- AllowFollowFormat();
- }
- */
-
pPara->SetPrepMustFit( sal_False );
UNDO_SWAP( this )
@@ -1218,13 +1151,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
{
- ASSERT( ! IsVertical() || IsSwapped(),
+ OSL_ENSURE( ! IsVertical() || IsSwapped(),
"SwTxtFrm::FormatLine( rLine, bPrev) with unswapped frame" );
SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
- // Nach rLine.FormatLine() haelt nStart den neuen Wert,
- // waehrend in pOldStart der alte Offset gepflegt wird.
- // Ueber diesen Weg soll das nDelta ersetzt werden.
- // *pOldStart += rLine.GetCurr()->GetLen();
const SwLineLayout *pOldCur = rLine.GetCurr();
const xub_StrLen nOldLen = pOldCur->GetLen();
const KSHORT nOldAscent = pOldCur->GetAscent();
@@ -1238,9 +1167,9 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
const xub_StrLen nNewStart = rLine.FormatLine( rLine.GetStart() );
- ASSERT( Frm().Pos().Y() + Prt().Pos().Y() == rLine.GetFirstPos(),
+ OSL_ENSURE( Frm().Pos().Y() + Prt().Pos().Y() == rLine.GetFirstPos(),
"SwTxtFrm::FormatLine: frame leaves orbit." );
- ASSERT( rLine.GetCurr()->Height(),
+ OSL_ENSURE( rLine.GetCurr()->Height(),
"SwTxtFrm::FormatLine: line height is zero" );
// Das aktuelle Zeilenumbruchobjekt.
@@ -1250,7 +1179,6 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
bOldHyph == pNew->IsEndHyph();
if ( bUnChg && !bPrev )
{
- // 6672: Toleranz von SLOPPY_TWIPS (5 Twips); vgl. 6922
const long nWidthDiff = nOldWidth > pNew->Width()
? nOldWidth - pNew->Width()
: pNew->Width() - nOldWidth;
@@ -1364,7 +1292,7 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
const sal_Bool bAdjust )
{
- ASSERT( ! IsVertical() || IsSwapped(),"SwTxtFrm::_Format with unswapped frame" );
+ OSL_ENSURE( ! IsVertical() || IsSwapped(),"SwTxtFrm::_Format with unswapped frame" );
SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
rLine.SetUnclipped( sal_False );
@@ -1454,7 +1382,6 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
if( pPara->IsMargin() )
rRepaint.Width( rRepaint.Width() + pPara->GetHangingMargin() );
rRepaint.Top( rLine.Y() );
- // 6792: Rrand < LRand und Repaint
if( 0 >= rRepaint.Width() )
rRepaint.Width(1);
WidowsAndOrphans aFrmBreak( this, rInf.IsTest() ? 1 : 0 );
@@ -1521,7 +1448,7 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
const SwLineLayout* pLine;
{
SwTxtFrm *pMaster = FindMaster();
- ASSERT( pMaster, "SwTxtFrm::Format: homeless follow" );
+ OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
if( !pMaster->HasPara() )
pMaster->GetFormatted();
SwTxtSizeInfo aInf( pMaster );
@@ -1547,7 +1474,6 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
*/
do
{
- DBG_LOOP;
if( bFirst )
bFirst = sal_False;
else
@@ -1693,7 +1619,7 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
{
- ASSERT( ! IsVertical() || IsSwapped(),
+ OSL_ENSURE( ! IsVertical() || IsSwapped(),
"A frame is not swapped in SwTxtFrm::FormatOnceMore" );
SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
@@ -1708,9 +1634,6 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
sal_uInt8 nGo = 0;
while( bGoOn )
{
-#ifdef DBGTXT
- aDbstream << "OnceMore!" << endl;
-#endif
++nGo;
rInf.Init();
rLine.Top();
@@ -1765,11 +1688,6 @@ void SwTxtFrm::_Format( SwParaPortion *pPara )
{
const xub_StrLen nStrLen = GetTxt().Len();
- // AMA: Wozu soll das gut sein? Scheint mir zuoft zu einem kompletten
- // Formatieren und Repainten zu fuehren???
-// if ( !(*pPara->GetDelta()) )
-// *(pPara->GetDelta()) = nStrLen;
-// else
if ( !nStrLen )
{
// Leere Zeilen werden nicht lange gequaelt:
@@ -1788,7 +1706,7 @@ void SwTxtFrm::_Format( SwParaPortion *pPara )
pPara->SetPrepMustFit( bMustFit );
}
- ASSERT( ! IsSwapped(), "A frame is swapped before _Format" );
+ OSL_ENSURE( ! IsSwapped(), "A frame is swapped before _Format" );
if ( IsVertical() )
SwapWidthAndHeight();
@@ -1807,7 +1725,7 @@ void SwTxtFrm::_Format( SwParaPortion *pPara )
if ( IsVertical() )
SwapWidthAndHeight();
- ASSERT( ! IsSwapped(), "A frame is swapped after _Format" );
+ OSL_ENSURE( ! IsSwapped(), "A frame is swapped after _Format" );
if( 1 < aLine.GetDropLines() )
{
@@ -1838,7 +1756,6 @@ void SwTxtFrm::_Format( SwParaPortion *pPara )
void SwTxtFrm::Format( const SwBorderAttrs * )
{
- DBG_LOOP;
#if OSL_DEBUG_LEVEL > 1
const XubString aXXX = GetTxtNode()->GetTxt();
const SwTwips nDbgY = Frm().Top();
@@ -1850,7 +1767,6 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
const SwFrm *pDbgFtnCont = (const SwFrm*)(FindPageFrm()->FindFtnCont());
(void)pDbgFtnCont;
-#ifdef DBG_UTIL
// nStopAt laesst sich vom CV bearbeiten.
static MSHORT nStopAt = 0;
if( nStopAt == GetFrmId() )
@@ -1859,32 +1775,10 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
(void)i;
}
#endif
-#endif
-
-#ifdef DEBUG_FTN
- //Fussnote darf nicht auf einer Seite vor ihrer Referenz stehen.
- if( IsInFtn() )
- {
- const SwFtnFrm *pFtn = (SwFtnFrm*)GetUpper();
- const SwPageFrm *pFtnPage = pFtn->GetRef()->FindPageFrm();
- const MSHORT nFtnPageNr = pFtnPage->GetPhyPageNum();
- if( !IsLocked() )
- {
- if( nFtnPageNr > nDbgPageNr )
- {
- SwTxtFrmLocker aLock(this);
- ASSERT( nFtnPageNr <= nDbgPageNr, "!Ftn steht vor der Referenz." );
- MSHORT i = 0;
- }
- }
- }
-#endif
SWRECTFN( this )
- // --> OD 2008-01-31 #newlistlevelattrs#
CalcAdditionalFirstLineOffset();
- // <--
// Vom Berichtsautopiloten oder ueber die BASIC-Schnittstelle kommen
// gelegentlich TxtFrms mit einer Breite <=0.
@@ -1975,7 +1869,7 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
else if( bSetOfst && IsFollow() )
{
SwTxtFrm *pMaster = FindMaster();
- ASSERT( pMaster, "SwTxtFrm::Format: homeless follow" );
+ OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
if( pMaster )
pMaster->Prepare( PREP_FOLLOW_FOLLOWS );
SwTwips nMaxY = (GetUpper()->*fnRect->fnGetPrtBottom)();
@@ -2088,15 +1982,13 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
{
- ASSERT( ! IsVertical() || ! IsSwapped(),
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
"SwTxtFrm::FormatQuick with swapped frame" );
- DBG_LOOP;
#if OSL_DEBUG_LEVEL > 1
const XubString aXXX = GetTxtNode()->GetTxt();
const SwTwips nDbgY = Frm().Top();
(void)nDbgY;
-#ifdef DBG_UTIL
// nStopAt laesst sich vom CV bearbeiten.
static MSHORT nStopAt = 0;
if( nStopAt == GetFrmId() )
@@ -2105,7 +1997,6 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
(void)i;
}
#endif
-#endif
if( IsEmpty() && FormatEmpty() )
return sal_True;
@@ -2139,13 +2030,6 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
? GetFollow()->GetOfst() : aInf.GetTxt().Len();
do
{
- //DBG_LOOP; shadows declaration above.
- //resolved into:
-#if OSL_DEBUG_LEVEL > 1
-#ifdef DBG_UTIL
- DbgLoop aDbgLoop2( (const void*) this );
-#endif
-#endif
nStart = aLine.FormatLine( nStart );
if( aInf.IsNewLine() || (!aInf.IsStop() && nStart < nEnd) )
aLine.Insert( new SwLineLayout() );
@@ -2160,7 +2044,6 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
if( !bForceQuickFormat && nNewHeight != nOldHeight && !IsUndersized() )
{
// Achtung: Durch FormatLevel==12 kann diese Situation auftreten, don't panic!
- // ASSERT( nNewHeight == nOldHeight, "!FormatQuick: rosebud" );
const xub_StrLen nStrt = GetOfst();
_InvalidateRange( SwCharRange( nStrt, nEnd - nStrt) );
return sal_False;
@@ -2181,3 +2064,5 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
return sal_True;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index 60700849fc80..530c93a51825 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <pam.hxx> // GetSpaces
-#include <txtcfg.hxx>
#include <frminf.hxx> // SwTxtFrminfo
#include <itrtxt.hxx> // SwTxtMargin
@@ -375,3 +375,4 @@ KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index d9f9597d472c..f8b6fe93cdd0 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,6 @@
#include <viewimp.hxx> // SwViewImp
#include <viewopt.hxx> // SwViewOption
#include <frmtool.hxx> // DrawGraphic
-#include <txtcfg.hxx>
#include <txtfrm.hxx> // SwTxtFrm
#include <itrpaint.hxx> // SwTxtPainter
#include <txtpaint.hxx> // SwSaveClip
@@ -66,7 +66,7 @@
// --> OD 2006-06-27 #b6440955#
// variable moved to class <numfunc:GetDefBulletConfig>
-//extern const sal_Char __FAR_DATA sBulletFntName[];
+//extern const sal_Char sBulletFntName[];
namespace numfunc
{
extern const String& GetDefBulletFontname();
@@ -141,7 +141,7 @@ SwExtraPainter::SwExtraPainter( const SwTxtFrm *pFrm, ViewShell *pVwSh,
nDivider = rLineInf.GetDivider().Len() ? rLineInf.GetDividerCountBy() : 0;
nX = pFrm->Frm().Left();
SwCharFmt* pFmt = rLineInf.GetCharFmt( const_cast<IDocumentStylePoolAccess&>(*pFrm->GetNode()->getIDocumentStylePoolAccess()) );
- ASSERT( pFmt, "PaintExtraData without CharFmt" );
+ OSL_ENSURE( pFmt, "PaintExtraData without CharFmt" );
pFnt = new SwFont( &pFmt->GetAttrSet(), pFrm->GetTxtNode()->getIDocumentSettingAccess() );
pFnt->Invalidate();
pFnt->ChgPhysFnt( pSh, *pSh->GetOut() );
@@ -437,7 +437,7 @@ SwRect SwTxtFrm::Paint()
#endif
// finger layout
- ASSERT( GetValidPosFlag(), "+SwTxtFrm::Paint: no Calc()" );
+ OSL_ENSURE( GetValidPosFlag(), "+SwTxtFrm::Paint: no Calc()" );
SwRect aRet( Prt() );
if ( IsEmpty() || !HasPara() )
@@ -566,21 +566,25 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
}
}
- const XubString aTmp( CH_PAR );
- SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
- aDrawInf.SetLeft( rRect.Left() );
- aDrawInf.SetRight( rRect.Right() );
- aDrawInf.SetPos( aPos );
- aDrawInf.SetSpace( 0 );
- aDrawInf.SetKanaComp( 0 );
- aDrawInf.SetWrong( NULL );
- aDrawInf.SetGrammarCheck( NULL );
- aDrawInf.SetSmartTags( NULL ); // SMARTTAGS
- aDrawInf.SetFrm( this );
- aDrawInf.SetFont( pFnt );
- aDrawInf.SetSnapToGrid( sal_False );
-
- pFnt->_DrawText( aDrawInf );
+ // Don't show the paragraph mark for collapsed paragraphs, when they are hidden
+ if ( EmptyHeight( ) > 1 )
+ {
+ const XubString aTmp( CH_PAR );
+ SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
+ aDrawInf.SetLeft( rRect.Left() );
+ aDrawInf.SetRight( rRect.Right() );
+ aDrawInf.SetPos( aPos );
+ aDrawInf.SetSpace( 0 );
+ aDrawInf.SetKanaComp( 0 );
+ aDrawInf.SetWrong( NULL );
+ aDrawInf.SetGrammarCheck( NULL );
+ aDrawInf.SetSmartTags( NULL ); // SMARTTAGS
+ aDrawInf.SetFrm( this );
+ aDrawInf.SetFont( pFnt );
+ aDrawInf.SetSnapToGrid( sal_False );
+
+ pFnt->_DrawText( aDrawInf );
+ }
delete pClip;
}
delete pFnt;
@@ -610,7 +614,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
SwTaggedPDFHelper aTaggedPDFHelperParagraph( 0, &aFrmInfo, 0, *pSh->GetOut() );
// <--
- DBG_LOOP_RESET;
if( !IsEmpty() || !PaintEmpty( rRect, sal_True ) )
{
#if OSL_DEBUG_LEVEL > 1
@@ -618,10 +621,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
(void)nDbgY;
#endif
-#ifdef DBGTXT
- if( IsDbg( this ) )
- DBTXTFRM << "Paint()" << endl;
-#endif
if( IsLocked() || IsHiddenNow() || ! Prt().HasArea() )
return;
@@ -629,7 +628,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
//Informationen entzogen hat.
if( !HasPara() )
{
- ASSERT( GetValidPosFlag(), "+SwTxtFrm::Paint: no Calc()" );
+ OSL_ENSURE( GetValidPosFlag(), "+SwTxtFrm::Paint: no Calc()" );
// --> FME 2004-10-29 #i29062# pass info that we are currently
// painting.
@@ -642,7 +641,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
}
if( !HasPara() )
{
- ASSERT( !this, "+SwTxtFrm::Paint: missing format information" );
+ OSL_ENSURE( !this, "+SwTxtFrm::Paint: missing format information" );
return;
}
}
@@ -677,7 +676,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// die Laenge ist immer wieder interessant.
// Rectangle
- ASSERT( ! IsSwapped(), "A frame is swapped before Paint" );
+ OSL_ENSURE( ! IsSwapped(), "A frame is swapped before Paint" );
SwRect aOldRect( rRect );
SWAP_IF_NOT_SWAPPED( this )
@@ -721,13 +720,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
do
{
- //DBG_LOOP; shadows declaration above.
- //resolved into:
-#if OSL_DEBUG_LEVEL > 1
-#ifdef DBG_UTIL
- DbgLoop aDbgLoop2( (const void*) this );
-#endif
-#endif
aLine.DrawTextLine( rRect, aClip, IsUndersized() );
} while( aLine.Next() && aLine.Y() <= nBottom );
@@ -743,7 +735,8 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
UNDO_SWAP( this )
(SwRect&)rRect = aOldRect;
- ASSERT( ! IsSwapped(), "A frame is swapped after Paint" );
+ OSL_ENSURE( ! IsSwapped(), "A frame is swapped after Paint" );
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 9c341c3838ea..31e0a4d8ed73 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,11 +33,9 @@
#include <ctype.h>
#include <editeng/unolingu.hxx>
#include <tools/shl.hxx> // needed for SW_MOD() macro
-#include <errhdl.hxx> // ASSERTs
#include <dlelstnr.hxx>
#include <swmodule.hxx>
#include <IDocumentSettingAccess.hxx>
-#include <txtcfg.hxx>
#include <guess.hxx>
#include <inftxt.hxx>
#include <pagefrm.hxx>
@@ -73,10 +72,10 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
if( !rInf.GetLen() || !rInf.GetTxt().Len() )
return sal_False;
- ASSERT( rInf.GetIdx() < rInf.GetTxt().Len(),
+ OSL_ENSURE( rInf.GetIdx() < rInf.GetTxt().Len(),
"+SwTxtGuess::Guess: invalid SwTxtFormatInfo" );
- ASSERT( nPorHeight, "+SwTxtGuess::Guess: no height" );
+ OSL_ENSURE( nPorHeight, "+SwTxtGuess::Guess: no height" );
sal_uInt16 nMinSize;
sal_uInt16 nMaxSizeDiff;
@@ -173,12 +172,12 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
{
nCutPos = rInf.GetTxtBreak( nLineWidth, nMaxLen, nMaxComp );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( STRING_LEN != nCutPos )
{
rInf.GetTxtSize( &rSI, rInf.GetIdx(), nCutPos - rInf.GetIdx(),
nMaxComp, nMinSize, nMaxSizeDiff );
- ASSERT( nMinSize <= nLineWidth, "What a Guess!!!" );
+ OSL_ENSURE( nMinSize <= nLineWidth, "What a Guess!!!" );
}
#endif
}
@@ -329,7 +328,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
{
sal_uInt16 nScript = pBreakIt->GetRealScriptOfText( rInf.GetTxt(),
nLangIndex );
- ASSERT( nScript, "Script is not between 1 and 4" );
+ OSL_ENSURE( nScript, "Script is not between 1 and 4" );
// compare current script with script from last "real" character
if ( nScript - 1 != rInf.GetFont()->GetActual() )
@@ -422,7 +421,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
}
else if ( !bHyph && nBreakPos >= rInf.GetLineStart() )
{
- ASSERT( nBreakPos != STRING_LEN, "we should have found a break pos" );
+ OSL_ENSURE( nBreakPos != STRING_LEN, "we should have found a break pos" );
// found break position within line
xHyphWord = NULL;
@@ -451,7 +450,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
// no line break found, setting nBreakPos to STRING_LEN
// causes a break cut
nBreakPos = STRING_LEN;
- ASSERT( nCutPos >= rInf.GetIdx(), "Deep cut" );
+ OSL_ENSURE( nCutPos >= rInf.GetIdx(), "Deep cut" );
nPorLen = nCutPos - rInf.GetIdx();
}
@@ -460,7 +459,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
const xub_StrLen nHangingLen = nBreakPos - nCutPos;
SwPosSize aTmpSize = rInf.GetTxtSize( &rSI, nCutPos,
nHangingLen, 0 );
- ASSERT( !pHanging, "A hanging portion is hanging around" );
+ OSL_ENSURE( !pHanging, "A hanging portion is hanging around" );
pHanging = new SwHangingPortion( aTmpSize );
pHanging->SetLen( nHangingLen );
nPorLen = nCutPos - rInf.GetIdx();
@@ -477,11 +476,11 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nBreakPos = nOldIdx - 1;
else if ( STRING_LEN != nBreakPos )
{
- ASSERT( nBreakPos >= nFieldDiff, "I've got field trouble!" );
+ OSL_ENSURE( nBreakPos >= nFieldDiff, "I've got field trouble!" );
nBreakPos = nBreakPos - nFieldDiff;
}
- ASSERT( nCutPos >= rInf.GetIdx() && nCutPos >= nFieldDiff,
+ OSL_ENSURE( nCutPos >= rInf.GetIdx() && nCutPos >= nFieldDiff,
"I've got field trouble, part2!" );
nCutPos = nCutPos - nFieldDiff;
@@ -491,7 +490,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
rInf.SetIdx( nOldIdx );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( aDebugString == rInf.GetTxt(),
+ OSL_ENSURE( aDebugString == rInf.GetTxt(),
"Somebody, somebody, somebody put something in my string" );
#endif
}
@@ -544,7 +543,7 @@ sal_Bool SwTxtGuess::AlternativeSpelling( const SwTxtFormatInfo &rInf,
// check, if word has alternative spelling
Reference< XHyphenator > xHyph( ::GetHyphenator() );
- ASSERT( xHyph.is(), "Hyphenator is missing");
+ OSL_ENSURE( xHyph.is(), "Hyphenator is missing");
//! subtract 1 since the UNO-interface is 0 based
xHyphWord = xHyph->queryAlternativeSpelling( OUString(aTxt),
pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ),
@@ -552,3 +551,4 @@ sal_Bool SwTxtGuess::AlternativeSpelling( const SwTxtFormatInfo &rInf,
return xHyphWord.is() && xHyphWord->isAlternativeSpelling();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/guess.hxx b/sw/source/core/text/guess.hxx
index d0ef7b4d5cdb..3f2e457a609e 100644
--- a/sw/source/core/text/guess.hxx
+++ b/sw/source/core/text/guess.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 557d44045d95..17bd0d0ceedb 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,11 +42,7 @@
#include <editeng/brshitem.hxx>
#include <editeng/splwrap.hxx>
#include <editeng/pgrditem.hxx>
-// --> OD 2008-01-17 #newlistlevelattrs#
-#ifndef _SVX_TSTPITEM_HXX
#include <editeng/tstpitem.hxx>
-#endif
-// <--
#include <SwSmartTagMgr.hxx>
#include <linguistic/lngprops.hxx>
@@ -61,9 +58,7 @@
#include <viewopt.hxx> // SwViewOptions
#include <frmtool.hxx> // DrawGraphic
#include <IDocumentSettingAccess.hxx>
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
#include <IDocumentDeviceAccess.hxx>
-#endif
#include <paratr.hxx> // SwFmtDrop
#include <rootfrm.hxx> // SwRootFrm
#include <inftxt.hxx> // SwTxtInfo
@@ -84,6 +79,10 @@
#include <unomid.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
using namespace ::com::sun::star::uno;
@@ -103,7 +102,7 @@ using namespace ::com::sun::star::beans;
// --> OD 2006-06-27 #b6440955#
// variable moved to class <numfunc:GetDefBulletConfig>
-//extern const sal_Char __FAR_DATA sBulletFntName[];
+//extern const sal_Char sBulletFntName[];
namespace numfunc
{
extern const String& GetDefBulletFontname();
@@ -111,43 +110,30 @@ namespace numfunc
}
// <--
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// Test2: WYSIWYG++
// Test4: WYSIWYG debug
static sal_Bool bDbgLow = sal_False;
#endif
-#ifdef DBG_UTIL
-
+#if OSL_DEBUG_LEVEL > 1
sal_Bool SwTxtSizeInfo::IsOptCalm() const { return !GetOpt().IsTest3(); }
-
sal_Bool SwTxtSizeInfo::IsOptLow() const { return bDbgLow; }
-
sal_Bool SwTxtSizeInfo::IsOptDbg() const { return GetOpt().IsTest4(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest1() const { return GetOpt().IsTest1(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest2() const { return GetOpt().IsTest2(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest3() const { return GetOpt().IsTest3(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest4() const { return GetOpt().IsTest4(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest5() const { return GetOpt().IsTest5(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest6() const { return GetOpt().IsTest6(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest7() const { return GetOpt().IsTest7(); }
-
sal_Bool SwTxtSizeInfo::IsOptTest8() const { return GetOpt().IsTest8(); }
-
#endif
/*************************************************************************
* SwLineInfo::SwLineInfo()
*************************************************************************/
-// --> OD 2008-01-17 #newlistlevelattrs#
SwLineInfo::SwLineInfo()
: pRuler( 0 ),
pSpace( 0 ),
@@ -164,10 +150,7 @@ SwLineInfo::~SwLineInfo()
}
void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
const SwTxtNode& rTxtNode )
-// <--
{
- // --> OD 2008-01-17 #newlistlevelattrs#
-// pRuler = &rAttrSet.GetTabStops();
delete pRuler;
pRuler = new SvxTabStopItem( rAttrSet.GetTabStops() );
if ( rTxtNode.GetListTabStopPosition( nListTabStopPosition ) )
@@ -190,8 +173,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
}
}
}
- // <--
- // --> OD 2008-02-15 #newlistlevelattrs#
+
if ( !rTxtNode.getIDocumentSettingAccess()->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) )
{
// remove default tab stop at position 0
@@ -205,7 +187,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
}
}
}
- // <--
+
pSpace = &rAttrSet.GetLineSpacing();
nVertAlign = rAttrSet.GetParaVertAlign().GetValue();
nDefTabStop = MSHRT_MAX;
@@ -221,7 +203,7 @@ void SwTxtInfo::CtorInitTxtInfo( SwTxtFrm *pFrm )
nTxtStart = pFrm->GetOfst();
if( !pPara )
{
- ASSERT( pPara, "+SwTxtInfo::CTOR: missing paragraph information" );
+ OSL_ENSURE( pPara, "+SwTxtInfo::CTOR: missing paragraph information" );
pFrm->Format();
pPara = pFrm->GetPara();
}
@@ -233,7 +215,7 @@ SwTxtInfo::SwTxtInfo( const SwTxtInfo &rInf )
{ }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* ChkOutDev()
*************************************************************************/
@@ -245,7 +227,7 @@ void ChkOutDev( const SwTxtSizeInfo &rInf )
const OutputDevice* pOut = rInf.GetOut();
const OutputDevice* pRef = rInf.GetRefDev();
- ASSERT( pOut && pRef, "ChkOutDev: invalid output devices" )
+ OSL_ENSURE( pOut && pRef, "ChkOutDev: invalid output devices" );
}
#endif // PRODUCT
@@ -286,7 +268,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew )
bSnapToGrid( rNew.SnapToGrid() ),
nDirection( rNew.GetDirection() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ChkOutDev( *this );
#endif
}
@@ -323,7 +305,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
pRef = pOut;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ChkOutDev( *this );
#endif
@@ -341,18 +323,6 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
nDirection = DIR_LEFT2RIGHT;
}
-/* LanguageType eLang;
- const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions();
- if ( SvtCTLOptions::NUMERALS_HINDI == rCTLOptions.GetCTLTextNumerals() )
- eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
- else if ( SvtCTLOptions::NUMERALS_ARABIC == rCTLOptions.GetCTLTextNumerals() )
- eLang = LANGUAGE_ENGLISH;
- else
- eLang = (LanguageType)::GetAppLanguage();
-
- pOut->SetDigitLanguage( eLang );
- pRef->SetDigitLanguage( eLang );*/
-
//
// The Options
//
@@ -411,7 +381,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt,
bSnapToGrid( rNew.SnapToGrid() ),
nDirection( rNew.GetDirection() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ChkOutDev( *this );
#endif
SetLen( GetMinLen( *this ) );
@@ -440,8 +410,8 @@ void SwTxtSizeInfo::NoteAnimation() const
if( OnWin() )
SwRootFrm::FlushVout();
- ASSERT( pOut == pVsh->GetOut(),
- "SwTxtSizeInfo::NoteAnimation() changed pOut" )
+ OSL_ENSURE( pOut == pVsh->GetOut(),
+ "SwTxtSizeInfo::NoteAnimation() changed pOut" );
}
/*************************************************************************
@@ -518,7 +488,7 @@ xub_StrLen SwTxtSizeInfo::GetTxtBreak( const long nLineWidth,
const SwScriptInfo& rScriptInfo =
( (SwParaPortion*)GetParaPortion() )->GetScriptInfo();
- ASSERT( pRef == pOut, "GetTxtBreak is supposed to use the RefDev" )
+ OSL_ENSURE( pRef == pOut, "GetTxtBreak is supposed to use the RefDev" );
SwDrawTextInfo aDrawInf( pVsh, *pOut, &rScriptInfo,
*pTxt, GetIdx(), nMaxLen );
aDrawInf.SetFrm( pFrm );
@@ -542,7 +512,7 @@ xub_StrLen SwTxtSizeInfo::GetTxtBreak( const long nLineWidth,
const SwScriptInfo& rScriptInfo =
( (SwParaPortion*)GetParaPortion() )->GetScriptInfo();
- ASSERT( pRef == pOut, "GetTxtBreak is supposed to use the RefDev" )
+ OSL_ENSURE( pRef == pOut, "GetTxtBreak is supposed to use the RefDev" );
SwDrawTextInfo aDrawInf( pVsh, *pOut, &rScriptInfo,
*pTxt, GetIdx(), nMaxLen );
aDrawInf.SetFrm( pFrm );
@@ -569,10 +539,10 @@ void SwTxtPaintInfo::CtorInitTxtPaintInfo( SwTxtFrm *pFrame, const SwRect &rPain
pGrammarCheckList = NULL;
pSmartTags = NULL; // SMARTTAGS
-#ifndef DBG_UTIL
- pBrushItem = 0;
-#else
+#if OSL_DEBUG_LEVEL > 1
pBrushItem = ((SvxBrushItem*)-1);
+#else
+ pBrushItem = 0;
#endif
}
@@ -709,7 +679,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
const sal_Bool bTmpGrammarCheck = bGrammarCheck && OnWin() && bCfgIsAutoGrammar && GetOpt().IsOnlineSpell();
const sal_Bool bTmpSmart = bSmartTag && OnWin() && !GetOpt().IsPagePreview() && SwSmartTagMgr::Get().IsSmartTagsEnabled(); // SMARTTAGS
- ASSERT( GetParaPortion(), "No paragraph!");
+ OSL_ENSURE( GetParaPortion(), "No paragraph!");
SwDrawTextInfo aDrawInf( pFrm->GetShell(), *pOut, pSI, rText, nStart, nLength,
rPor.Width(), bBullet );
@@ -920,7 +890,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
nMaxWidth = rRect.Height();
break;
default:
- ASSERT( sal_False, "Unknown direction set at font" )
+ OSL_ENSURE( sal_False, "Unknown direction set at font" );
break;
}
@@ -998,7 +968,7 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, sal_Bool bNoGraphic,
pOut->DrawRect( rRect.SVRect() );
else
{
- ASSERT( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" );
+ OSL_ENSURE( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" );
::DrawGraphic( pBrushItem, pOut, aItemRect, rRect );
}
}
@@ -1177,7 +1147,7 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked)
*************************************************************************/
void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const
{
- ASSERT( OnWin(), "SwTxtPaintInfo::DrawBackground: printer polution ?" );
+ OSL_ENSURE( OnWin(), "SwTxtPaintInfo::DrawBackground: printer polution ?" );
SwRect aIntersect;
CalcRect( rPor, 0, &aIntersect );
@@ -1246,7 +1216,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
}
if( !pFnt->GetBackColor() ) return;
- ASSERT( pFnt->GetBackColor(), "DrawBackBrush: Lost Color" );
+ OSL_ENSURE( pFnt->GetBackColor(), "DrawBackBrush: Lost Color" );
SwRect aIntersect;
CalcRect( rPor, 0, &aIntersect );
@@ -1304,7 +1274,7 @@ void SwTxtPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
case POR_BLANK: if ( GetOpt().IsHardBlank())bDraw = sal_True; break;
default:
{
- ASSERT( !this, "SwTxtPaintInfo::DrawViewOpt: don't know how to draw this" );
+ OSL_ENSURE( !this, "SwTxtPaintInfo::DrawViewOpt: don't know how to draw this" );
break;
}
}
@@ -1319,7 +1289,7 @@ void SwTxtPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
void SwTxtPaintInfo::_NotifyURL( const SwLinePortion &rPor ) const
{
- ASSERT( pNoteURL, "NotifyURL: pNoteURL gone with the wind!" );
+ OSL_ENSURE( pNoteURL, "NotifyURL: pNoteURL gone with the wind!" );
SwRect aIntersect;
CalcRect( rPor, 0, &aIntersect );
@@ -1367,7 +1337,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals,
pVal[1].Value <<= nMinTrailing;
}
else {
- DBG_ERROR( "unxpected size of sequence" );
+ OSL_FAIL( "unxpected size of sequence" );
}
}
@@ -1524,7 +1494,7 @@ void SwTxtFormatInfo::Init()
SetPaintOfst(0);
}
-/*-----------------16.10.00 11:39-------------------
+/*--------------------------------------------------
* There are a few differences between a copy constructor
* and the following constructor for multi-line formatting.
* The root is the first line inside the multi-portion,
@@ -1635,12 +1605,6 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
bool bNumFound = false;
const bool bTabCompat = GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
- // Removed for i7288. bSkip used to be passed from SwFldPortion::Format
- // as IsFollow(). Therefore more than one special character was not
- // handled correctly at the beginning of follow fields.
-// if ( bSkip && i < nEnd )
-// ++i;
-
for( ; i < nEnd; ++i )
{
const xub_Unicode cPos = GetChar( i );
@@ -1659,8 +1623,6 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
case CH_BREAK:
case CHAR_ZWSP :
case CHAR_ZWNBSP :
-// case CHAR_RLM :
-// case CHAR_LRM :
cHookChar = cPos;
return i;
@@ -1674,7 +1636,7 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
{
if( cTabDec == cPos )
{
- ASSERT( cPos, "Unexpected end of string" );
+ OSL_ENSURE( cPos, "Unexpected end of string" );
if( cPos ) // robust
{
cHookChar = cPos;
@@ -1977,3 +1939,4 @@ sal_Bool SwTxtFormatInfo::ChgHyph( const sal_Bool bNew )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 065e38a0e563..45f153c53612 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <com/sun/star/beans/PropertyValues.hpp>
-#ifndef _TABLE_HXX //autogen
#include <tools/table.hxx>
-#endif
#include "swtypes.hxx"
#include "txttypes.hxx"
@@ -41,7 +40,6 @@
#include "porlay.hxx"
#include "txtfrm.hxx"
#include "ndtxt.hxx"
-#include "txttypes.hxx"
#include <editeng/paravertalignitem.hxx>
class Font;
@@ -76,7 +74,7 @@ class SwWrongList;
#define DIR_RIGHT2LEFT 2
#define DIR_TOP2BOTTOM 3
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#define OPTCALM( rInf ) (rInf).IsOptCalm()
#define OPTLOW( rInf ) (rInf).IsOptLow()
#define OPTDBG( rInf ) (rInf).IsOptDbg()
@@ -100,17 +98,12 @@ class SwLineInfo
const SvxLineSpacingItem *pSpace;
sal_uInt16 nVertAlign;
KSHORT nDefTabStop;
- // --> OD 2008-02-04 #newlistlevelattrs#
bool bListTabStopIncluded;
long nListTabStopPosition;
- // <--
- // --> OD 2008-01-17 #newlistlevelattrs#
void CtorInitLineInfo( const SwAttrSet& rAttrSet,
const SwTxtNode& rTxtNode );
- // <--
- // --> OD 2008-01-17 #newlistlevelattrs#
SwLineInfo();
~SwLineInfo();
public:
@@ -134,7 +127,6 @@ public:
sal_uInt16 NumberOfTabStops() const;
- // --> OD 2008-02-04 #newlistlevelattrs#
inline bool IsListTabStopIncluded() const
{
return bListTabStopIncluded;
@@ -143,8 +135,6 @@ public:
{
return nListTabStopPosition;
}
- // <--
-
// friend ostream &operator<<( ostream &rOS, const SwLineInfo &rInf );
friend SvStream &operator<<( SvStream &rOS, const SwLineInfo &rInf );
@@ -162,7 +152,7 @@ class SwTxtInfo
xub_StrLen nTxtStart; // TxtOfst bei Follows
protected:
- inline SwTxtInfo() { }
+ inline SwTxtInfo() : pPara(0) {}
public:
void CtorInitTxtInfo( SwTxtFrm *pFrm );
SwTxtInfo( const SwTxtInfo &rInf );
@@ -226,7 +216,7 @@ protected:
void CtorInitTxtSizeInfo( SwTxtFrm *pFrm, SwFont *pFnt = 0,
const xub_StrLen nIdx = 0,
const xub_StrLen nLen = STRING_LEN );
- SwTxtSizeInfo() {}
+ SwTxtSizeInfo() : pKanaComp(0), pVsh(0), pOut(0), pRef(0), pFnt(0), pUnderFnt(0), pFrm(0), pOpt(0), pTxt(0) {}
public:
SwTxtSizeInfo( const SwTxtSizeInfo &rInf );
SwTxtSizeInfo( const SwTxtSizeInfo &rInf, const XubString &rTxt,
@@ -381,7 +371,7 @@ public:
{ return ( pKanaComp && nKanaIdx < pKanaComp->Count() )
? (*pKanaComp)[nKanaIdx] : 0; }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool IsOptCalm() const;
sal_Bool IsOptLow() const;
sal_Bool IsOptDbg() const;
@@ -424,11 +414,11 @@ class SwTxtPaintInfo : public SwTxtSizeInfo
void _DrawBackBrush( const SwLinePortion &rPor ) const;
protected:
-#ifndef DBG_UTIL
- SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;}
-#else
+#if OSL_DEBUG_LEVEL > 1
SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0;
pBrushItem = ((SvxBrushItem*)-1);}
+#else
+ SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;}
#endif
public:
SwTxtPaintInfo( const SwTxtPaintInfo &rInf );
@@ -813,13 +803,13 @@ public:
inline KSHORT SwTxtSizeInfo::GetAscent() const
{
- ASSERT( GetOut(), "SwTxtSizeInfo::GetAscent() without pOut" )
+ OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetAscent() without pOut" );
return ((SwFont*)GetFont())->GetAscent( pVsh, *GetOut() );
}
inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
{
- ASSERT( GetOut(), "SwTxtSizeInfo::GetTxtHeight() without pOut" )
+ OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetTxtHeight() without pOut" );
return ((SwFont*)GetFont())->GetHeight( pVsh, *GetOut() );
}
@@ -903,3 +893,4 @@ inline sal_Bool SwTxtFormatInfo::IsSoftHyph( const xub_StrLen nPos ) const
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index a262b411a4f9..9323716fd6b2 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,15 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <vcl/outdev.hxx>
#include <IDocumentSettingAccess.hxx>
#include "frame.hxx" // CalcFlyAdjust()
#include "paratr.hxx"
-#include "txtcfg.hxx"
#include "itrtxt.hxx"
#include "porglue.hxx"
#include "porlay.hxx"
@@ -271,9 +269,9 @@ bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIter&
void SwTxtAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
const SwLinePortion *pStopAt, SwTwips nReal, bool bSkipKashida )
{
- ASSERT( GetInfo().IsMulti() || SVX_ADJUST_BLOCK == GetAdjust(),
+ OSL_ENSURE( GetInfo().IsMulti() || SVX_ADJUST_BLOCK == GetAdjust(),
"CalcNewBlock: Why?" );
- ASSERT( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
+ OSL_ENSURE( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
pCurrent->InitSpaceAdd();
xub_StrLen nGluePortion = 0;
@@ -423,8 +421,8 @@ void SwTxtAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
{
- ASSERT( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
- ASSERT( !pCurrent->GetpKanaComp(), "pKanaComp already exists!!" );
+ OSL_ENSURE( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
+ OSL_ENSURE( !pCurrent->GetpKanaComp(), "pKanaComp already exists!!" );
SvUShorts *pNewKana = new SvUShorts;
pCurrent->SetKanaComp( pNewKana );
@@ -714,7 +712,7 @@ void SwTxtAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent )
void SwTxtAdjuster::CalcAdjLine( SwLineLayout *pCurrent )
{
- ASSERT( pCurrent->IsFormatAdj(), "CalcAdjLine: Why?" );
+ OSL_ENSURE( pCurrent->IsFormatAdj(), "CalcAdjLine: Why?" );
pCurrent->SetFormatAdj(sal_False);
@@ -731,21 +729,7 @@ void SwTxtAdjuster::CalcAdjLine( SwLineLayout *pCurrent )
}
case SVX_ADJUST_BLOCK:
{
- // disabled for #i13507#
- // 8311: In Zeilen mit LineBreaks gibt es keinen Blocksatz!
-/* if( pCurrent->GetLen() &&
- CH_BREAK == GetInfo().GetChar( nStart + pCurrent->GetLen() - 1 ) &&
- !IsLastBlock() )
- {
- if( IsLastCenter() )
- {
- CalcFlyAdjust( pCurrent );
- pPara->GetRepaint()->SetOfst( 0 );
- break;
- }
- return;
- }
-*/ FormatBlock();
+ FormatBlock();
break;
}
default : return;
@@ -815,8 +799,8 @@ SwFlyPortion *SwTxtAdjuster::CalcFlyPortion( const long nRealWidth,
void SwTxtAdjuster::CalcDropAdjust()
{
- ASSERT( 1<GetDropLines() && SVX_ADJUST_LEFT!=GetAdjust() && SVX_ADJUST_BLOCK!=GetAdjust(),
- "CalcDropAdjust: No reason for DropAdjustment." )
+ OSL_ENSURE( 1<GetDropLines() && SVX_ADJUST_LEFT!=GetAdjust() && SVX_ADJUST_BLOCK!=GetAdjust(),
+ "CalcDropAdjust: No reason for DropAdjustment." );
const MSHORT nLineNumber = GetLineNr();
@@ -883,9 +867,6 @@ void SwTxtAdjuster::CalcDropAdjust()
pLeft->MoveAllGlue( pRight );
else
pLeft->MoveGlue( pRight, nGlue );
-#ifdef DBGTXT
- aDbstream << "Drop adjusted: " << nGlue << endl;
-#endif
}
}
}
@@ -917,3 +898,4 @@ void SwTxtAdjuster::CalcDropRepaint()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 83e49dc14584..354de3eca96b 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,7 +73,7 @@ using namespace ::com::sun::star;
void SwAttrIter::Chg( SwTxtAttr *pHt )
{
- ASSERT( pHt && pFnt, "No attribute of font available for change");
+ OSL_ENSURE( pHt && pFnt, "No attribute of font available for change");
if( pRedln && pRedln->IsOn() )
pRedln->ChangeTxtAttr( pFnt, *pHt, sal_True );
else
@@ -86,7 +87,7 @@ void SwAttrIter::Chg( SwTxtAttr *pHt )
void SwAttrIter::Rst( SwTxtAttr *pHt )
{
- ASSERT( pHt && pFnt, "No attribute of font available for reset");
+ OSL_ENSURE( pHt && pFnt, "No attribute of font available for reset");
// get top from stack after removing pHt
if( pRedln && pRedln->IsOn() )
pRedln->ChangeTxtAttr( pFnt, *pHt, sal_False );
@@ -371,7 +372,7 @@ public:
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; }
+ void Minimum( long nNew ) const { if( (long)rMin < nNew ) rMin = nNew; }
void NewWord() { nWordAdd = nWordWidth = 0; }
};
@@ -468,7 +469,7 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs )
{
const SwMinMaxNodeArgs *pIn = (const SwMinMaxNodeArgs*)pArgs;
const SwPosition *pPos = rFmtA.GetCntntAnchor();
- ASSERT(pPos && pIn, "Unexpected NULL arguments");
+ OSL_ENSURE(pPos && pIn, "Unexpected NULL arguments");
if (!pPos || !pIn || pIn->nIndx != pPos->nNode.GetIndex())
bCalculate = false;
}
@@ -744,7 +745,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
if( RES_FLYFRMFMT == pFrmFmt->Which()
&& rTmpSize.GetWidthPercent() )
{
-/*-----------------24.01.97 14:09----------------------------------------------
+/*-----------------------------------------------------------------------------
* Hier ein HACK fuer folgende Situation: In dem Absatz befindet sich
* ein Textrahmen mit relativer Groesse. Dann nehmen wir mal als minimale
* Breite 0,5 cm und als maximale KSHRT_MAX.
@@ -845,7 +846,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
pOut = getIDocumentDeviceAccess()->getReferenceDevice( true );
}
- ASSERT( pOut, "GetScalingOfSelectedText without outdev" )
+ OSL_ENSURE( pOut, "GetScalingOfSelectedText without outdev" );
MapMode aOldMap( pOut->GetMapMode() );
pOut->SetMapMode( MapMode( MAP_TWIP ) );
@@ -1084,3 +1085,5 @@ sal_uInt16 SwTxtNode::GetWidthOfLeadingTabs() const
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx
index 372c6083b73f..a9e5b455e1f9 100644
--- a/sw/source/core/text/itratr.hxx
+++ b/sw/source/core/text/itratr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,7 +80,9 @@ protected:
void Rst( SwTxtAttr *pHt );
void CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm = 0 );
inline SwAttrIter(SwTxtNode* pTxtNode)
- : pShell(0), pFnt(0), pLastOut(0), nChgCnt(0), pRedln(0), nPropFont(0), m_pTxtNode(pTxtNode) {}
+ : pShell(0), pFnt(0), pHints(0), pAttrSet(0), pScriptInfo(0), pLastOut(0), nChgCnt(0), pRedln(0), nPropFont(0), m_pTxtNode(pTxtNode) {
+ aMagicNo[SW_LATIN] = aMagicNo[SW_CJK] = aMagicNo[SW_CTL] = NULL;
+ }
public:
// Konstruktor, Destruktor
@@ -129,3 +132,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 67569418f0bb..b480f2cff520 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
#include "hintids.hxx"
-#include "errhdl.hxx"
#include "ndtxt.hxx"
#include "frmfmt.hxx"
#include "paratr.hxx"
@@ -47,7 +47,6 @@
#include <IDocumentSettingAccess.hxx>
#include <pagefrm.hxx>
-#include "txtcfg.hxx"
#include "itrtxt.hxx"
#include "txtfrm.hxx"
#include "flyfrms.hxx"
@@ -77,7 +76,7 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
const SwCrsrMoveState& rCMS,
const SwLinePortion& rPor )
{
- ASSERT( rCMS.pSpecialPos, "Information about special pos missing" )
+ OSL_ENSURE( rCMS.pSpecialPos, "Information about special pos missing" );
if ( rPor.InFldGrp() && ((SwFldPortion&)rPor).GetExp().Len() )
{
@@ -109,7 +108,7 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
} while ( sal_True );
- ASSERT( nCharOfst >= nFldIdx, "Request of position inside field failed" )
+ OSL_ENSURE( nCharOfst >= nFldIdx, "Request of position inside field failed" );
sal_uInt16 nLen = nCharOfst - nFldIdx + 1;
if ( pString )
@@ -200,7 +199,6 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const int nLMWithNum = pNode->GetLeftMarginWithNum( sal_True );
if ( pFrm->IsRightToLeft() )
{
- // --> OD 2008-01-23 #newlistlevelattrs#
// this calculation is identical this the calculation for L2R layout - see below
nLeft = pFrm->Frm().Left() +
pFrm->Prt().Left() +
@@ -287,7 +285,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
case SVX_LINE_SPACE_FIX:
nFirstLineOfs = pSpace->GetLineHeight();
break;
- default: ASSERT( sal_False, ": unknown LineSpaceRule" );
+ default: OSL_ENSURE( sal_False, ": unknown LineSpaceRule" );
}
switch( pSpace->GetInterLineSpaceRule() )
{
@@ -313,7 +311,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirstLineOfs += pSpace->GetInterLineSpace();
break;
}
- default: ASSERT( sal_False, ": unknown InterLineSpaceRule" );
+ default: OSL_ENSURE( sal_False, ": unknown InterLineSpaceRule" );
}
}
}
@@ -338,13 +336,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
pFrm->Prt().Left() );
}
- // --> OD 2008-01-31 #newlistlevelattrs#
// Note: <SwTxtFrm::GetAdditionalFirstLineOffset()> returns a negative
// value for the new list label postion and space mode LABEL_ALIGNMENT
// and label alignment CENTER and RIGHT in L2R layout respectively
// label alignment LEFT and CENTER in R2L layout
nFirst += pFrm->GetAdditionalFirstLineOffset();
- // <--
if( nFirst >= nRight )
nFirst = nRight - 1;
@@ -498,7 +494,7 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const xub_StrLen nOfst,
pCMS->aRealHeight.X() = nTmpAscent - nPorAscent;
else
pCMS->aRealHeight.X() = 0;
- ASSERT( nPorHeight, "GetCharRect: Missing Portion-Height" );
+ OSL_ENSURE( nPorHeight, "GetCharRect: Missing Portion-Height" );
pCMS->aRealHeight.Y() = nPorHeight;
}
@@ -575,10 +571,8 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
if( bNoTxt )
nTmpFirst = nX;
// 8670: EndPortions zaehlen hier einmal als TxtPortions.
- // --> OD 2008-01-28 #newlistlevelattrs#
// if( pPor->InTxtGrp() || pPor->IsBreakPortion() )
if( pPor->InTxtGrp() || pPor->IsBreakPortion() || pPor->InTabGrp() )
- // <--
{
bNoTxt = sal_False;
nTmpFirst = nX;
@@ -963,7 +957,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
if( pPor )
{
- ASSERT( !pPor->InNumberGrp() || bInsideFirstField, "Number surprise" );
+ OSL_ENSURE( !pPor->InNumberGrp() || bInsideFirstField, "Number surprise" );
sal_Bool bEmptyFld = sal_False;
if( pPor->InFldGrp() && pPor->GetLen() )
{
@@ -974,7 +968,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
SwLinePortion *pNext = pTmp->GetPortion();
while( pNext && !pNext->InFldGrp() )
{
- ASSERT( !pNext->GetLen(), "Where's my field follow?" );
+ OSL_ENSURE( !pNext->GetLen(), "Where's my field follow?" );
nAddX = nAddX + pNext->Width();
pNext = pNext->GetPortion();
}
@@ -1046,7 +1040,6 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
// Ausgleich vor 's'.
while( pPor && !pPor->GetLen() )
{
- DBG_LOOP;
nX += pPor->Width();
if( !pPor->IsMarginPortion() )
{
@@ -1151,8 +1144,8 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
const SwLinePortion *pLast = rLineLayout.FindLastPortion();
if ( pLast->IsMultiPortion() )
{
- ASSERT( ((SwMultiPortion*)pLast)->IsBidi(),
- "Non-BidiPortion inside BidiPortion" )
+ OSL_ENSURE( ((SwMultiPortion*)pLast)->IsBidi(),
+ "Non-BidiPortion inside BidiPortion" );
pOrig->Pos().X() += pLast->Width() +
pLast->CalcSpacing( nSpaceAdd, aInf );
}
@@ -1181,7 +1174,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
pCMS->aRealHeight.X() = nTmpAscent - nPorAscent;
else
pCMS->aRealHeight.X() = 0;
- ASSERT( nPorHeight, "GetCharRect: Missing Portion-Height" );
+ OSL_ENSURE( nPorHeight, "GetCharRect: Missing Portion-Height" );
if ( nTmpHeight > nPorHeight )
pCMS->aRealHeight.Y() = nPorHeight;
else
@@ -1208,8 +1201,8 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
{
const sal_uInt8 nExtendRange = pCMS->pSpecialPos->nExtendRange;
- ASSERT( ! pCMS->pSpecialPos->nLineOfst || SP_EXTEND_RANGE_BEFORE != nExtendRange,
- "LineOffset AND Number Portion?" )
+ OSL_ENSURE( ! pCMS->pSpecialPos->nLineOfst || SP_EXTEND_RANGE_BEFORE != nExtendRange,
+ "LineOffset AND Number Portion?" );
// portions which are behind the string
if ( SP_EXTEND_RANGE_BEHIND == nExtendRange )
@@ -1293,7 +1286,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
// x ist der horizontale Offset innerhalb der Zeile.
SwTwips x = rPoint.X();
- CONST SwTwips nLeftMargin = GetLineStart();
+ const SwTwips nLeftMargin = GetLineStart();
SwTwips nRightMargin = GetLineEnd();
if( nRightMargin == nLeftMargin )
nRightMargin += 30;
@@ -1628,7 +1621,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
((SwDropPortion*)pPor)->GetFnt() : NULL );
SwParaPortion* pPara = (SwParaPortion*)GetInfo().GetParaPortion();
- ASSERT( pPara, "No paragraph!" );
+ OSL_ENSURE( pPara, "No paragraph!" );
SwDrawTextInfo aDrawInf( aSizeInf.GetVsh(),
*aSizeInf.GetOut(),
@@ -1884,3 +1877,4 @@ bool SwTxtFrm::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) c
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 66251e83e618..f4b63fd7c293 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include "hintids.hxx"
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <editeng/lspcitem.hxx>
#include <txtftn.hxx>
#include <fmtftn.hxx>
@@ -43,7 +42,6 @@
#include <viewsh.hxx>
#include <viewopt.hxx> // SwViewOptions
#include <paratr.hxx> // SwFmtDrop
-#include <txtcfg.hxx>
#include <itrform2.hxx>
#include <porrst.hxx>
#include <portab.hxx> // pLastTab->
@@ -62,10 +60,10 @@
#include <tgrditem.hxx>
#include <doc.hxx> // SwDoc
#include <pormulti.hxx> // SwMultiPortion
-#define _SVSTDARR_LONGS
-#include <svl/svstdarr.hxx>
#include <unotools/charclass.hxx>
+#include <vector>
+
#if OSL_DEBUG_LEVEL > 1
#include <ndtxt.hxx> // pSwpHints, Ausgabeoperator
#endif
@@ -73,7 +71,16 @@
using namespace ::com::sun::star;
extern sal_Bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
-bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos );
+
+namespace {
+ //! Calculates and sets optimal repaint offset for the current line
+ static long lcl_CalcOptRepaint( SwTxtFormatter &rThis,
+ SwLineLayout &rCurr,
+ const xub_StrLen nOldLineEnd,
+ const std::vector<long> &rFlyStarts );
+ //! Determine if we need to build hidden portions
+ static bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos );
+}
#define MAX_TXTPORLEN 300
@@ -109,7 +116,7 @@ void SwTxtFormatter::CtorInitTxtFormatter( SwTxtFrm *pNewFrm, SwTxtFormatInfo *p
if( nStart > GetInfo().GetTxt().Len() )
{
- ASSERT( !this, "+SwTxtFormatter::CTOR: bad offset" );
+ OSL_ENSURE( !this, "+SwTxtFormatter::CTOR: bad offset" );
nStart = GetInfo().GetTxt().Len();
}
@@ -210,7 +217,6 @@ SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
SwLinePortion *pTmpPrev = pPor;
while( pPor && pPor != pUnderFlow )
{
- DBG_LOOP;
if( !pPor->IsKernPortion() &&
( pPor->Width() || pPor->IsSoftHyphPortion() ) )
{
@@ -219,7 +225,7 @@ SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
pTmpPrev->Move( rInf );
rInf.SetLast( pTmpPrev );
pTmpPrev = pTmpPrev->GetPortion();
- ASSERT( pTmpPrev, "UnderFlow: Loosing control!" );
+ OSL_ENSURE( pTmpPrev, "UnderFlow: Loosing control!" );
};
}
pPor = pPor->GetPortion();
@@ -237,7 +243,7 @@ SwLinePortion *SwTxtFormatter::UnderFlow( SwTxtFormatInfo &rInf )
}
// Was? Die Unterlaufsituation ist nicht in der Portion-Kette ?
- ASSERT( pPor, "SwTxtFormatter::UnderFlow: overflow but underflow" );
+ OSL_ENSURE( pPor, "SwTxtFormatter::UnderFlow: overflow but underflow" );
// OD 2004-05-26 #i29529# - correction: no delete of footnotes
// if( rInf.IsFtnInside() && pPor && !rInf.IsQuick() )
@@ -368,7 +374,6 @@ void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf,
rInf.SetLast( pPor );
while( pPor )
{
- DBG_LOOP;
pPor->Move( rInf );
rInf.SetLast( pPor );
pPor = pPor->GetPortion();
@@ -381,7 +386,7 @@ void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf,
void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
{
- ASSERT( rInf.GetTxt().Len() < STRING_LEN,
+ OSL_ENSURE( rInf.GetTxt().Len() < STRING_LEN,
"SwTxtFormatter::BuildPortions: bad text length in info" );
rInf.ChkNoHyph( CntEndHyph(), CntMidHyph() );
@@ -392,7 +397,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
rInf.SetLast( pCurr );
rInf.ForcedLeftMargin( 0 );
- ASSERT( pCurr->FindLastPortion() == pCurr, "pLast supposed to equal pCurr" );
+ OSL_ENSURE( pCurr->FindLastPortion() == pCurr, "pLast supposed to equal pCurr" );
if( !pCurr->GetAscent() && !pCurr->Height() )
CalcAscent( rInf, pCurr );
@@ -400,7 +405,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
SeekAndChg( rInf );
// In CalcFlyWidth wird Width() verkuerzt, wenn eine FlyPortion vorliegt.
- ASSERT( !rInf.X() || pMulti, "SwTxtFormatter::BuildPortion X=0?" );
+ OSL_ENSURE( !rInf.X() || pMulti, "SwTxtFormatter::BuildPortion X=0?" );
CalcFlyWidth( rInf );
SwFlyPortion *pFly = rInf.GetFly();
if( pFly )
@@ -433,10 +438,9 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
while( pPor && !rInf.IsStop() )
{
- ASSERT( rInf.GetLen() < STRING_LEN &&
+ OSL_ENSURE( rInf.GetLen() < STRING_LEN &&
rInf.GetIdx() <= rInf.GetTxt().Len(),
"SwTxtFormatter::BuildPortions: bad length in info" );
- DBG_LOOP;
// We have to check the script for fields in order to set the
// correct nActual value for the font.
@@ -669,7 +673,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
if ( nRestWidth > 0 && SW_CJK != nCurrScript &&
! rInf.IsUnderFlow() && ( bFull || SW_CJK == nNextScript ) )
{
- ASSERT( pGridKernPortion, "No GridKernPortion available" )
+ OSL_ENSURE( pGridKernPortion, "No GridKernPortion available" );
// calculate size
SwLinePortion* pTmpPor = pGridKernPortion->GetPortion();
@@ -688,8 +692,8 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
nRestWidth );
const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2);
- ASSERT( nKernWidth <= nRestWidth,
- "Not enough space left for adjusting non-asian text in grid mode" )
+ OSL_ENSURE( nKernWidth <= nRestWidth,
+ "Not enough space left for adjusting non-asian text in grid mode" );
pGridKernPortion->Width( pGridKernPortion->Width() + nKernWidth_1 );
rInf.X( rInf.X() + nKernWidth_1 );
@@ -1063,8 +1067,8 @@ SwLinePortion *SwTxtFormatter::WhichFirstPortion(SwTxtFormatInfo &rInf)
// 5) Die Fussnotenzahlen
if( !rInf.IsFtnDone() )
{
- ASSERT( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
- "Rotated number portion trouble" )
+ OSL_ENSURE( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
+ "Rotated number portion trouble" );
sal_Bool bFtnNum = pFrm->IsFtnNumFrm();
rInf.GetParaPortion()->SetFtnNum( bFtnNum );
@@ -1085,8 +1089,8 @@ SwLinePortion *SwTxtFormatter::WhichFirstPortion(SwTxtFormatInfo &rInf)
// 7) Die Numerierungen
if( !rInf.IsNumDone() && !pPor )
{
- ASSERT( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
- "Rotated number portion trouble" )
+ OSL_ENSURE( ( ! rInf.IsMulti() && ! pMulti ) || pMulti->HasRotation(),
+ "Rotated number portion trouble" );
// Wenn wir im Follow stehen, dann natuerlich nicht.
if( GetTxtFrm()->GetTxtNode()->GetNumRule() )
@@ -1162,7 +1166,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
rInf.SetStopUnderFlow( sal_False );
if( rInf.GetUnderFlow() )
{
- ASSERT( rInf.IsFull(), "SwTxtFormatter::NewPortion: underflow but not full" );
+ OSL_ENSURE( rInf.IsFull(), "SwTxtFormatter::NewPortion: underflow but not full" );
return UnderFlow( rInf );
}
@@ -1225,7 +1229,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
if ( !pPor )
{
xub_StrLen nEnd = rInf.GetIdx();
- if ( lcl_BuildHiddenPortion( rInf, nEnd ) )
+ if ( ::lcl_BuildHiddenPortion( rInf, nEnd ) )
pPor = new SwHiddenTextPortion( nEnd - rInf.GetIdx() );
}
@@ -1349,7 +1353,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
if ( GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) /*rInf.GetVsh()->IsTabCompat();*/ &&
POR_TABDECIMAL == pLastTabPortion->GetWhichPor() )
{
- ASSERT( rInf.X() >= pLastTabPortion->Fix(), "Decimal tab stop position cannot be calculated" )
+ OSL_ENSURE( rInf.X() >= pLastTabPortion->Fix(), "Decimal tab stop position cannot be calculated" );
const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = (sal_uInt16)(rInf.X() - pLastTabPortion->Fix() );
static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
rInf.SetTabDecimal( 0 );
@@ -1462,12 +1466,12 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
// Werte bereithalten muss:
if( !pCurr->Height() )
{
- ASSERT( pCurr->Height(), "SwTxtFormatter::NewPortion: limbo dance" );
+ OSL_ENSURE( pCurr->Height(), "SwTxtFormatter::NewPortion: limbo dance" );
pCurr->Height( pPor->Height() );
pCurr->SetAscent( pPor->GetAscent() );
}
- ASSERT( !pPor || pPor->Height(),
+ OSL_ENSURE( !pPor || pPor->Height(),
"SwTxtFormatter::NewPortion: something went wrong");
if( pPor->IsPostItsPortion() && rInf.X() >= rInf.Width() && rInf.GetFly() )
{
@@ -1483,7 +1487,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
{
- ASSERT( ! pFrm->IsVertical() || pFrm->IsSwapped(),
+ OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
"SwTxtFormatter::FormatLine( nStartPos ) with unswapped frame" );
// For the formatting routines, we set pOut to the reference device.
@@ -1516,21 +1520,18 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
// before and after the BuildPortions call
const sal_Bool bOptimizeRepaint = AllowRepaintOpt();
const xub_StrLen nOldLineEnd = nStartPos + pCurr->GetLen();
- SvLongs* pFlyStart = 0;
+ std::vector<long> flyStarts;
// these are the conditions for a fly position comparison
if ( bOptimizeRepaint && pCurr->IsFly() )
{
- pFlyStart = new SvLongs;
SwLinePortion* pPor = pCurr->GetFirstPortion();
long nPOfst = 0;
- sal_uInt16 nCnt = 0;
-
while ( pPor )
{
if ( pPor->IsFlyPortion() )
// insert start value of fly portion
- pFlyStart->Insert( nPOfst, nCnt++ );
+ flyStarts.push_back( nPOfst );
nPOfst += pPor->Width();
pPor = pPor->GetPortion();
@@ -1621,9 +1622,8 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
// calculate optimal repaint rectangle
if ( bOptimizeRepaint )
{
- GetInfo().SetPaintOfst( CalcOptRepaint( nOldLineEnd, pFlyStart ) );
- if ( pFlyStart )
- delete pFlyStart;
+ GetInfo().SetPaintOfst( ::lcl_CalcOptRepaint( *this, *pCurr, nOldLineEnd, flyStarts ) );
+ flyStarts.clear();
}
else
// Special case: We do not allow an optimitation of the repaint
@@ -1678,7 +1678,6 @@ void SwTxtFormatter::RecalcRealHeight()
sal_Bool bMore = sal_True;
while(bMore)
{
- DBG_LOOP;
CalcRealHeight();
bMore = Next() != 0;
}
@@ -1746,6 +1745,28 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
switch( pSpace->GetLineSpaceRule() )
{
case SVX_LINE_SPACE_AUTO:
+ if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) {
+ long nTmp = pSpace->GetPropLineSpace();
+ if (nTmp<100) { // code adaped from fixed line height
+ nTmp *= nLineHeight;
+ nTmp /= 100;
+ if( !nTmp )
+ ++nTmp;
+ nLineHeight = (KSHORT)nTmp;
+/*
+ //@TODO figure out how WW maps ascent and descent
+ //in case of prop line spacing <100%
+ KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80%
+ if( nAsc < pCurr->GetAscent() ||
+ nLineHeight - nAsc < pCurr->Height() -
+pCurr->GetAscent() )
+ pCurr->SetClipping( sal_True );
+ pCurr->SetAscent( nAsc );
+*/
+ pCurr->Height( nLineHeight );
+ pInf->GetParaPortion()->SetFixLineHeight();
+ }
+ }
break;
case SVX_LINE_SPACE_MIN:
{
@@ -1765,7 +1786,7 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
pInf->GetParaPortion()->SetFixLineHeight();
}
break;
- default: ASSERT( sal_False, ": unknown LineSpaceRule" );
+ default: OSL_ENSURE( sal_False, ": unknown LineSpaceRule" );
}
if( !IsParaLine() )
switch( pSpace->GetInterLineSpaceRule() )
@@ -1792,7 +1813,7 @@ void SwTxtFormatter::CalcRealHeight( sal_Bool bNewLine )
nLineHeight = nLineHeight + pSpace->GetInterLineSpace();
break;
}
- default: ASSERT( sal_False, ": unknown InterLineSpaceRule" );
+ default: OSL_ENSURE( sal_False, ": unknown InterLineSpaceRule" );
}
}
#if OSL_DEBUG_LEVEL > 1
@@ -1994,140 +2015,148 @@ sal_Bool SwTxtFormatter::AllowRepaintOpt() const
return bOptimizeRepaint;
}
-/*************************************************************************
- * SwTxtFormatter::CalcOptRepaint()
- *
- * calculates an optimal repaint offset for the current line
- *************************************************************************/
-long SwTxtFormatter::CalcOptRepaint( xub_StrLen nOldLineEnd,
- const SvLongs* pFlyStart )
-{
- if ( GetInfo().GetIdx() < GetInfo().GetReformatStart() )
- // the reformat position is behind our new line, that means
- // something of our text has moved to the next line
- return 0;
-
- xub_StrLen nReformat = Min( GetInfo().GetReformatStart(), nOldLineEnd );
-
- // in case we do not have any fly in our line, our repaint position
- // is the changed position - 1
- if ( ! pFlyStart && ! pCurr->IsFly() )
+namespace {
+ /*************************************************************************
+ * ::CalcOptRepaint()
+ *
+ * calculates and sets optimal repaint offset for the current line
+ *************************************************************************/
+ long lcl_CalcOptRepaint( SwTxtFormatter &rThis,
+ SwLineLayout &rCurr,
+ const xub_StrLen nOldLineEnd,
+ const std::vector<long> &rFlyStarts )
{
- // this is the maximum repaint offset determined during formatting
- // for example: the beginning of the first right tab stop
- // if this value is 0, this means that we do not have an upper
- // limit for the repaint offset
- const long nFormatRepaint = GetInfo().GetPaintOfst();
-
- if ( nReformat < GetInfo().GetLineStart() + 3 )
+ SwTxtFormatInfo txtFmtInfo = rThis.GetInfo();
+ if ( txtFmtInfo.GetIdx() < txtFmtInfo.GetReformatStart() )
+ // the reformat position is behind our new line, that means
+ // something of our text has moved to the next line
return 0;
- // step back two positions for smoother repaint
- nReformat -= 2;
-
-#ifndef QUARTZ
-#ifndef ENABLE_GRAPHITE
- // --> FME 2004-09-27 #i28795#, #i34607#, #i38388#
- // step back six(!) more characters for complex scripts
- // this is required e.g., for Khmer (thank you, Javier!)
- const SwScriptInfo& rSI = GetInfo().GetParaPortion()->GetScriptInfo();
- xub_StrLen nMaxContext = 0;
- if( ::i18n::ScriptType::COMPLEX == rSI.ScriptType( nReformat ) )
- nMaxContext = 6;
-#else
- // Some Graphite fonts need context for scripts not marked as complex
- static const xub_StrLen nMaxContext = 10;
-#endif
-#else
- // some fonts like Quartz's Zapfino need more context
- // TODO: query FontInfo for maximum unicode context
- static const xub_StrLen nMaxContext = 8;
-#endif
- if( nMaxContext > 0 )
- {
- if ( nReformat > GetInfo().GetLineStart() + nMaxContext )
- nReformat = nReformat - nMaxContext;
- else
- nReformat = GetInfo().GetLineStart();
- }
- // <--
-
- // Weird situation: Our line used to end with a hole portion
- // and we delete some characters at the end of our line. We have
- // to take care for repainting the blanks which are not anymore
- // covered by the hole portion
- while ( nReformat > GetInfo().GetLineStart() &&
- CH_BLANK == GetInfo().GetChar( nReformat ) )
- --nReformat;
-
- ASSERT( nReformat < GetInfo().GetIdx(), "Reformat too small for me!" );
- SwRect aRect;
-
- // Note: GetChareRect is not const. It definitely changes the
- // bMulti flag. We have to save and resore the old value.
- sal_Bool bOldMulti = GetInfo().IsMulti();
- GetCharRect( &aRect, nReformat );
- GetInfo().SetMulti( bOldMulti );
-
- return nFormatRepaint ? Min( aRect.Left(), nFormatRepaint ) :
- aRect.Left();
- }
- else
- {
- // nReformat may be wrong, if something around flys has changed:
- // we compare the former and the new fly positions in this line
- // if anything has changed, we carefully have to adjust the right
- // repaint position
- long nPOfst = 0;
- sal_uInt16 nCnt = 0;
- sal_uInt16 nX = 0;
- sal_uInt16 nIdx = GetInfo().GetLineStart();
- SwLinePortion* pPor = pCurr->GetFirstPortion();
+ xub_StrLen nReformat = Min( txtFmtInfo.GetReformatStart(), nOldLineEnd );
- while ( pPor )
+ // in case we do not have any fly in our line, our repaint position
+ // is the changed position - 1
+ if ( rFlyStarts.empty() && ! rCurr.IsFly() )
{
- if ( pPor->IsFlyPortion() )
+ // this is the maximum repaint offset determined during formatting
+ // for example: the beginning of the first right tab stop
+ // if this value is 0, this means that we do not have an upper
+ // limit for the repaint offset
+ const long nFormatRepaint = txtFmtInfo.GetPaintOfst();
+
+ if ( nReformat < txtFmtInfo.GetLineStart() + 3 )
+ return 0;
+
+ // step back two positions for smoother repaint
+ nReformat -= 2;
+
+ #ifndef QUARTZ
+ #ifndef ENABLE_GRAPHITE
+ // --> FME 2004-09-27 #i28795#, #i34607#, #i38388#
+ // step back six(!) more characters for complex scripts
+ // this is required e.g., for Khmer (thank you, Javier!)
+ const SwScriptInfo& rSI = txtFmtInfo.GetParaPortion()->GetScriptInfo();
+ xub_StrLen nMaxContext = 0;
+ if( ::i18n::ScriptType::COMPLEX == rSI.ScriptType( nReformat ) )
+ nMaxContext = 6;
+ #else
+ // Some Graphite fonts need context for scripts not marked as complex
+ static const xub_StrLen nMaxContext = 10;
+ #endif
+ #else
+ // some fonts like Quartz's Zapfino need more context
+ // TODO: query FontInfo for maximum unicode context
+ static const xub_StrLen nMaxContext = 8;
+ #endif
+ if( nMaxContext > 0 )
{
- // compare start of fly with former start of fly
- if ( pFlyStart &&
- nCnt < pFlyStart->Count() &&
- nX == (*pFlyStart)[ nCnt ] &&
- nIdx < nReformat
- )
- // found fix position, nothing has changed left from nX
- nPOfst = nX + pPor->Width();
+ if ( nReformat > txtFmtInfo.GetLineStart() + nMaxContext )
+ nReformat = nReformat - nMaxContext;
else
- break;
-
- nCnt++;
+ nReformat = txtFmtInfo.GetLineStart();
}
- nX = nX + pPor->Width();
- nIdx = nIdx + pPor->GetLen();
- pPor = pPor->GetPortion();
+ // <--
+
+ // Weird situation: Our line used to end with a hole portion
+ // and we delete some characters at the end of our line. We have
+ // to take care for repainting the blanks which are not anymore
+ // covered by the hole portion
+ while ( nReformat > txtFmtInfo.GetLineStart() &&
+ CH_BLANK == txtFmtInfo.GetChar( nReformat ) )
+ --nReformat;
+
+ OSL_ENSURE( nReformat < txtFmtInfo.GetIdx(), "Reformat too small for me!" );
+ SwRect aRect;
+
+ // Note: GetChareRect is not const. It definitely changes the
+ // bMulti flag. We have to save and resore the old value.
+ sal_Bool bOldMulti = txtFmtInfo.IsMulti();
+ rThis.GetCharRect( &aRect, nReformat );
+ txtFmtInfo.SetMulti( bOldMulti );
+
+ return nFormatRepaint ? Min( aRect.Left(), nFormatRepaint ) :
+ aRect.Left();
}
+ else
+ {
+ // nReformat may be wrong, if something around flys has changed:
+ // we compare the former and the new fly positions in this line
+ // if anything has changed, we carefully have to adjust the right
+ // repaint position
+ long nPOfst = 0;
+ sal_uInt16 nCnt = 0;
+ sal_uInt16 nX = 0;
+ sal_uInt16 nIdx = rThis.GetInfo().GetLineStart();
+ SwLinePortion* pPor = rCurr.GetFirstPortion();
+
+ while ( pPor )
+ {
+ if ( pPor->IsFlyPortion() )
+ {
+ // compare start of fly with former start of fly
+ if (nCnt < rFlyStarts.size() &&
+ nX == rFlyStarts[ nCnt ] &&
+ nIdx < nReformat
+ )
+ // found fix position, nothing has changed left from nX
+ nPOfst = nX + pPor->Width();
+ else
+ break;
- return nPOfst + GetLeftMargin();
- }
-}
+ nCnt++;
+ }
+ nX = nX + pPor->Width();
+ nIdx = nIdx + pPor->GetLen();
+ pPor = pPor->GetPortion();
+ }
-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( sal_True ) && rInf.GetOpt().IsPrinting();
- if (bShowInDocView || bShowForPrinting)
- return false;
+ return nPOfst + rThis.GetLeftMargin();
+ }
+ }
- const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
- xub_StrLen nHiddenStart;
- xub_StrLen nHiddenEnd;
- rSI.GetBoundsOfHiddenRange( rPos, nHiddenStart, nHiddenEnd );
- if ( nHiddenEnd )
+ // Determine if we need to build hidden portions
+ bool lcl_BuildHiddenPortion( const SwTxtSizeInfo& rInf, xub_StrLen &rPos )
{
- rPos = nHiddenEnd;
- return true;
+ // 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( sal_True ) && rInf.GetOpt().IsPrinting();
+ if (bShowInDocView || bShowForPrinting)
+ return false;
+
+ const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
+ xub_StrLen nHiddenStart;
+ xub_StrLen nHiddenEnd;
+ rSI.GetBoundsOfHiddenRange( rPos, nHiddenStart, nHiddenEnd );
+ if ( nHiddenEnd )
+ {
+ rPos = nHiddenEnd;
+ return true;
+ }
+
+ return false;
}
- return false;
-}
+} //end unnamed namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index a082538ed4d3..a838806a11c8 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,6 @@ class SwErgoSumPortion;
class SwExpandPortion;
class SwMultiPortion;
class SwFtnPortion;
-class SvLongs;
/*************************************************************************
* class SwTxtFormatter
@@ -100,9 +100,6 @@ class SwTxtFormatter : public SwTxtPainter
// determines, if a optimized repaint rectange is allowed
sal_Bool AllowRepaintOpt() const;
- // calculates and sets the optimized repaint offset
- long CalcOptRepaint( xub_StrLen nOldLineEnd, const SvLongs* pFlyStart );
-
// wird von FormatLine gerufen.
void FormatReset( SwTxtFormatInfo &rInf );
@@ -212,3 +209,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 8c9405a9a483..0571efb8a5d3 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "hintids.hxx"
#include "flyfrm.hxx" // SwFlyInCntFrm
#include "viewopt.hxx" // SwViewOptions
-#include "errhdl.hxx"
#include "txtatr.hxx" // SwINetFmt
#include <tools/multisel.hxx>
#include <editeng/escpitem.hxx>
@@ -57,7 +57,6 @@
#include "flyfrms.hxx"
#include "viewsh.hxx"
-#include "txtcfg.hxx"
#include "itrpaint.hxx"
#include "txtfrm.hxx" // pFrm
#include "txtfly.hxx"
@@ -100,10 +99,10 @@ void SwTxtPainter::CtorInitTxtPainter( SwTxtFrm *pNewFrm, SwTxtPaintInfo *pNewIn
pInf = pNewInf;
SwFont *pMyFnt = GetFnt();
GetInfo().SetFont( pMyFnt );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( ALIGN_BASELINE != pMyFnt->GetAlign() )
{
- ASSERT( ALIGN_BASELINE == pMyFnt->GetAlign(),
+ OSL_ENSURE( ALIGN_BASELINE == pMyFnt->GetAlign(),
"+SwTxtPainter::CTOR: font alignment revolution" );
pMyFnt->SetAlign( ALIGN_BASELINE );
}
@@ -132,7 +131,6 @@ SwLinePortion *SwTxtPainter::CalcPaintOfst( const SwRect &rPaint )
while( pPor && GetInfo().X() + pPor->Width() + (pPor->Height()/2)
< nPaintOfst )
{
- DBG_LOOP;
if( pPor->InSpaceGrp() && GetInfo().GetSpaceAdd() )
{
long nTmp = GetInfo().X() +pPor->Width() +
@@ -241,7 +239,6 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
}
// Alignment:
- sal_Bool bPlus = sal_False;
OutputDevice* pOut = GetInfo().GetOut();
Point aPnt1( nTmpLeft, GetInfo().GetPos().Y() );
if ( aPnt1.X() < rPaint.Left() )
@@ -253,10 +250,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
if ( aPnt2.X() > rPaint.Right() )
aPnt2.X() = rPaint.Right();
if ( aPnt2.Y() > rPaint.Bottom() )
- {
aPnt2.Y() = rPaint.Bottom();
- bPlus = sal_True;
- }
const SwRect aLineRect( aPnt1, aPnt2 );
@@ -267,12 +261,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
}
if( !pPor && !bEndPor )
- {
-#ifdef DBGTXT
- aDbstream << "PAINTER: done nothing" << endl;
-#endif
return;
- }
// Baseline-Ausgabe auch bei nicht-TxtPortions (vgl. TabPor mit Fill)
// if no special vertical alignment is used,
@@ -319,7 +308,6 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
while( pPor )
{
- DBG_LOOP;
sal_Bool bSeeked = sal_True;
GetInfo().SetLen( pPor->GetLen() );
@@ -537,8 +525,8 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
Range aRange( 0, GetInfo().GetTxt().Len() );
MultiSelection aUnderMulti( aRange );
- ASSERT( GetFnt() && UNDERLINE_NONE != GetFnt()->GetUnderline(),
- "CheckSpecialUnderline without underlined font" )
+ OSL_ENSURE( GetFnt() && UNDERLINE_NONE != GetFnt()->GetUnderline(),
+ "CheckSpecialUnderline without underlined font" );
const SwFont* pParaFnt = GetAttrHandler().GetFont();
if( pParaFnt && pParaFnt->GetUnderline() == GetFnt()->GetUnderline() )
aUnderMulti.SelectAll();
@@ -716,3 +704,5 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
// I'm sorry, we do not have a special underlining font for you.
GetInfo().SetUnderFnt( 0 );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrpaint.hxx b/sw/source/core/text/itrpaint.hxx
index b7410d57d881..4304676f3f97 100644
--- a/sw/source/core/text/itrpaint.hxx
+++ b/sw/source/core/text/itrpaint.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,3 +68,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index c042634eaf60..93cba310f3be 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include "ndtxt.hxx"
#include "flyfrm.hxx"
#include "paratr.hxx"
-#include "errhdl.hxx"
#include <vcl/outdev.hxx>
#include <editeng/paravertalignitem.hxx>
@@ -42,13 +42,12 @@
#include <tgrditem.hxx>
#include <porfld.hxx>
-#include "txtcfg.hxx"
#include "itrtxt.hxx"
#include "txtfrm.hxx"
#include "porfly.hxx"
#if OSL_DEBUG_LEVEL > 1
-# include "txtfrm.hxx" // GetFrmID,
+#include "txtfrm.hxx" // GetFrmID,
#endif
/*************************************************************************
@@ -57,26 +56,15 @@
void SwTxtIter::CtorInitTxtIter( SwTxtFrm *pNewFrm, SwTxtInfo *pNewInf )
{
-#ifdef DBGTXT
- // nStopAt laesst sich vom CV bearbeiten.
- static MSHORT nStopAt = 0;
- if( nStopAt == pNewFrm->GetFrmId() )
- {
- int i = pNewFrm->GetFrmId();
- }
-#endif
-
SwTxtNode *pNode = pNewFrm->GetTxtNode();
- ASSERT( pNewFrm->GetPara(), "No paragraph" );
+ OSL_ENSURE( pNewFrm->GetPara(), "No paragraph" );
CtorInitAttrIter( *pNode, pNewFrm->GetPara()->GetScriptInfo(), pNewFrm );
pFrm = pNewFrm;
pInf = pNewInf;
- // --> OD 2008-01-17 #newlistlevelattrs#
aLineInf.CtorInitLineInfo( pNode->GetSwAttrSet(), *pNode );
- // <--
nFrameStart = pFrm->Frm().Pos().Y() + pFrm->Prt().Pos().Y();
SwTxtIter::Init();
if( pNode->GetSwAttrSet().GetRegister().GetValue() )
@@ -187,7 +175,6 @@ const SwLineLayout *SwTxtIter::NextLine()
const SwLineLayout *pNext = Next();
while( pNext && pNext->IsDummy() && pNext->GetNext() )
{
- DBG_LOOP;
pNext = Next();
}
return pNext;
@@ -202,7 +189,6 @@ const SwLineLayout *SwTxtIter::GetNextLine() const
const SwLineLayout *pNext = pCurr->GetNext();
while( pNext && pNext->IsDummy() && pNext->GetNext() )
{
- DBG_LOOP;
pNext = pNext->GetNext();
}
return (SwLineLayout*)pNext;
@@ -251,7 +237,6 @@ const SwLineLayout *SwTxtIter::PrevLine()
const SwLineLayout *pLast = pMyPrev;
while( pMyPrev && pMyPrev->IsDummy() )
{
- DBG_LOOP;
pLast = pMyPrev;
pMyPrev = Prev();
}
@@ -266,7 +251,7 @@ void SwTxtIter::Bottom()
{
while( Next() )
{
- DBG_LOOP;
+ // nothing
}
}
@@ -358,7 +343,7 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine,
nOfst = nOfst + nPorAscent;
break;
case SvxParaVertAlignItem::CENTER :
- ASSERT( rLine.Height() >= nPorHeight, "Portion height > Line height");
+ OSL_ENSURE( rLine.Height() >= nPorHeight, "Portion height > Line height");
nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent;
break;
case SvxParaVertAlignItem::BOTTOM :
@@ -488,7 +473,6 @@ void SwTxtIter::CntHyphens( sal_uInt8 &nEndCnt, sal_uInt8 &nMidCnt) const
return;
while( pLay != pCurr )
{
- DBG_LOOP;
if ( pLay->IsEndHyph() )
nEndCnt++;
else
@@ -513,7 +497,7 @@ SwHookOut::SwHookOut( SwTxtSizeInfo& rInfo ) :
pOut( rInfo.GetOut() ),
bOnWin( rInfo.OnWin() )
{
- ASSERT( rInfo.GetRefDev(), "No reference device for text formatting" )
+ OSL_ENSURE( rInfo.GetRefDev(), "No reference device for text formatting" );
// set new values
rInfo.SetOut( rInfo.GetRefDev() );
@@ -525,3 +509,5 @@ SwHookOut::~SwHookOut()
pInf->SetOut( pOut );
pInf->SetOnWin( bOnWin );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index aa129aef9888..46ec8cfd7964 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,8 +66,13 @@ protected:
// Zuruecksetzen in die erste Zeile.
void Init();
void CtorInitTxtIter( SwTxtFrm *pFrm, SwTxtInfo *pInf );
- inline SwTxtIter(SwTxtNode* pTxtNode) : SwAttrIter(pTxtNode) { }
-
+ inline SwTxtIter(SwTxtNode* pTxtNode)
+ : SwAttrIter(pTxtNode)
+ , pFrm(NULL)
+ , pInf(NULL)
+ , pCurr(NULL)
+ , pPrev(NULL)
+ {}
public:
inline SwTxtIter( SwTxtFrm *pTxtFrm, SwTxtInfo *pTxtInf ) : SwAttrIter(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
{ CtorInitTxtIter( pTxtFrm, pTxtInf ); }
@@ -338,3 +344,5 @@ inline SwTwips SwTxtMargin::Left() const
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index 7fe36a990fca..2e5cbcc692a7 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@ void SwNoteURL::InsertURLNote( const XubString& rURL, const XubString& rTarget,
void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
const MapMode& rMap )
{
- ASSERT( pMap, "FillImageMap: No ImageMap, no cookies!" );
+ OSL_ENSURE( pMap, "FillImageMap: No ImageMap, no cookies!" );
MSHORT nCount = Count();
if( nCount )
{
@@ -85,3 +86,4 @@ void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx
index 452a2b394d65..41179f534f4f 100644
--- a/sw/source/core/text/pordrop.hxx
+++ b/sw/source/core/text/pordrop.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,3 +118,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 95fae4d7b64e..344bc25b1f10 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -310,3 +311,4 @@ sal_Bool SwPostItsPortion::GetExpTxt( const SwTxtSizeInfo &rInf,
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 214c9f336eb3..5761431810f5 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,3 +107,5 @@ CLASSIO( SwPostItsPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 1057ed7899b6..d806a9316a9c 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,22 +32,13 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
#include <editeng/brshitem.hxx>
-#ifndef _METRIC_HXX //autogen
#include <vcl/metric.hxx>
-#endif
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <viewopt.hxx> // SwViewOptions
-#include <txtcfg.hxx>
#include <SwPortionHandler.hxx>
#include <porlay.hxx>
#include <porfld.hxx>
@@ -54,9 +46,7 @@
#include <blink.hxx> // pBlink
#include <frmtool.hxx> // DrawGraphic
#include <viewsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <doc.hxx>
#include <breakit.hxx>
#include <porrst.hxx>
@@ -93,7 +83,7 @@ SwFldPortion *SwFldPortion::Clone( const XubString &rExpand ) const
void SwFldPortion::TakeNextOffset( const SwFldPortion* pFld )
{
- ASSERT( pFld, "TakeNextOffset: Missing Source" );
+ OSL_ENSURE( pFld, "TakeNextOffset: Missing Source" );
nNextOffset = pFld->GetNextOffset();
aExpand.Erase( 0, nNextOffset );
bFollow = sal_True;
@@ -464,7 +454,7 @@ void SwFldPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
SwFontSave aSave( rInf, pFnt );
- ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
+ OSL_ENSURE( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
if( Width() && ( !bPlaceHolder || rInf.GetOpt().IsShowPlaceHolderFields() ) )
{
// Dies ist eine freizuegige Auslegung der Hintergrundbelegung ...
@@ -548,7 +538,6 @@ sal_Bool SwHiddenPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt
* class SwNumberPortion
*************************************************************************/
-// --> OD 2008-01-23 #newlistlevelattrs#
SwNumberPortion::SwNumberPortion( const XubString &rExpand,
SwFont *pFont,
const sal_Bool bLft,
@@ -558,9 +547,7 @@ SwNumberPortion::SwNumberPortion( const XubString &rExpand,
: SwFldPortion( rExpand, pFont ),
nFixWidth(0),
nMinDist( nMinDst ),
- // --> OD 2008-01-23 #newlistlevelattrs#
mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive )
- // <--
{
SetWhichPor( POR_NUMBER );
SetLeft( bLft );
@@ -578,10 +565,9 @@ SwFldPortion *SwNumberPortion::Clone( const XubString &rExpand ) const
SwFont *pNewFnt;
if( 0 != ( pNewFnt = pFnt ) )
pNewFnt = new SwFont( *pFnt );
- // --> OD 2008-01-23 #newlistlevelattrs#
+
return new SwNumberPortion( rExpand, pNewFnt, IsLeft(), IsCenter(),
nMinDist, mbLabelAlignmentPosAndSpaceModeActive );
- // <--
}
/*************************************************************************
@@ -604,10 +590,10 @@ sal_Bool SwNumberPortion::Format( SwTxtFormatInfo &rInf )
if( rInf.IsNumDone() )
{
// SetAscent( rInf.GetAscent() );
- ASSERT( Height() && nAscent, "NumberPortions without Height | Ascent" );
+ OSL_ENSURE( Height() && nAscent, "NumberPortions without Height | Ascent" );
long nDiff( 0 );
- // --> OD 2008-01-23 #newlistlevelattrs#
+
if ( !mbLabelAlignmentPosAndSpaceModeActive )
{
if ( !rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) &&
@@ -626,7 +612,6 @@ sal_Bool SwNumberPortion::Format( SwTxtFormatInfo &rInf )
nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
}
}
- // <--
// Ein Vorschlag von Juergen und Volkmar:
// Der Textteil hinter der Numerierung sollte immer
// mindestens beim linken Rand beginnen.
@@ -780,7 +765,7 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( bPaintSpace && nOldWidth > nSpaceOffs )
{
SwTxtPaintInfo aInf( rInf );
-static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+static sal_Char const sDoubleSpace[] = " ";
aInf.X( aInf.X() + nSpaceOffs );
// --> FME 2005-08-12 #i53199# Adjust position of underline:
@@ -807,7 +792,6 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
* class SwBulletPortion
*************************************************************************/
-// --> OD 2008-01-23 #newlistlevelattrs#
SwBulletPortion::SwBulletPortion( const xub_Unicode cBullet,
const XubString& rBulletFollowedBy,
SwFont *pFont,
@@ -818,7 +802,6 @@ SwBulletPortion::SwBulletPortion( const xub_Unicode cBullet,
: SwNumberPortion( XubString( rBulletFollowedBy ).Insert( cBullet, 0 ) ,
pFont, bLft, bCntr, nMinDst,
bLabelAlignmentPosAndSpaceModeActive )
-// <--
{
SetWhichPor( POR_BULLET );
}
@@ -829,7 +812,6 @@ SwBulletPortion::SwBulletPortion( const xub_Unicode cBullet,
#define GRFNUM_SECURE 10
-// --> OD 2008-01-23 #newlistlevelattrs#
SwGrfNumPortion::SwGrfNumPortion(
SwFrm*,
const XubString& rGraphicFollowedBy,
@@ -839,7 +821,6 @@ SwGrfNumPortion::SwGrfNumPortion(
const bool bLabelAlignmentPosAndSpaceModeActive ) :
SwNumberPortion( rGraphicFollowedBy, NULL, bLft, bCntr, nMinDst,
bLabelAlignmentPosAndSpaceModeActive ),
-// <--
pBrush( new SvxBrushItem(RES_BACKGROUND) ), nId( 0 )
{
SetWhichPor( POR_GRFNUM );
@@ -887,7 +868,6 @@ void SwGrfNumPortion::StopAnimation( OutputDevice* pOut )
sal_Bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
{
SetHide( sal_False );
- // --> OD 2008-01-29 #newlistlevelattrs#
// Width( nFixWidth );
KSHORT nFollowedByWidth( 0 );
if ( mbLabelAlignmentPosAndSpaceModeActive )
@@ -917,7 +897,6 @@ sal_Bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
}
}
rInf.SetNumDone( sal_True );
- // --> OD 2008-01-23 #newlistlevelattrs#
// long nDiff = rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
long nDiff = mbLabelAlignmentPosAndSpaceModeActive
? 0
@@ -967,11 +946,9 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
long nTmpWidth = Max( (long)0, (long)(nFixWidth - 2 * GRFNUM_SECURE) );
Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE );
- // --> OD 2008-02-05 #newlistlevelattrs#
const sal_Bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive ||
( IsLeft() && ! rInf.GetTxtFrm()->IsRightToLeft() ) ||
( ! IsLeft() && ! IsCenter() && rInf.GetTxtFrm()->IsRightToLeft() );
- // <--
if( nFixWidth < Width() && !bTmpLeft )
{
@@ -1102,7 +1079,7 @@ void SwGrfNumPortion::SetBase( long nLnAscent, long nLnDescent,
void SwTxtFrm::StopAnimation( OutputDevice* pOut )
{
- ASSERT( HasAnimation(), "SwTxtFrm::StopAnimation: Which Animation?" );
+ OSL_ENSURE( HasAnimation(), "SwTxtFrm::StopAnimation: Which Animation?" );
if( HasPara() )
{
SwLineLayout *pLine = GetPara();
@@ -1165,7 +1142,7 @@ SwCombinedPortion::SwCombinedPortion( const XubString &rTxt )
void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- ASSERT( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
+ OSL_ENSURE( GetLen() <= 1, "SwFldPortion::Paint: rest-portion polution?" );
if( Width() )
{
rInf.DrawBackBrush( *this );
@@ -1178,7 +1155,7 @@ void SwCombinedPortion::Paint( const SwTxtPaintInfo &rInf ) const
sal_uInt16 nCount = aExpand.Len();
if( !nCount )
return;
- ASSERT( nCount < 7, "Too much combined characters" );
+ OSL_ENSURE( nCount < 7, "Too much combined characters" );
// the first character of the second row
sal_uInt16 nTop = ( nCount + 1 ) / 2;
@@ -1230,7 +1207,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
return sal_False;
}
- ASSERT( nCount < 7, "Too much combined characters" );
+ OSL_ENSURE( nCount < 7, "Too much combined characters" );
// If there are leading "weak"-scripttyped characters in this portion,
// they get the actual scripttype.
sal_uInt16 i = 0;
@@ -1242,7 +1219,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
i = 0;
while( i < aExpand.Len() )
{
- ASSERT( aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
+ OSL_ENSURE( aScrType[i] < SW_SCRIPTS, "Combined: Script fault" );
if( !aWidth[ aScrType[i] ] )
{
rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( aScrType[i] ) );
@@ -1393,3 +1370,5 @@ KSHORT SwCombinedPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
return 0; // the combined portion doesn't fit.
return SwFldPortion::GetViewWidth( rInf );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index aa0cb4f1be14..47890c7d05ea 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -147,19 +148,15 @@ class SwNumberPortion : public SwFldPortion
protected:
KSHORT nFixWidth; // vgl. Glues
KSHORT nMinDist; // minimaler Abstand zum Text
- // --> OD 2008-01-23 #newlistlevelattrs#
bool mbLabelAlignmentPosAndSpaceModeActive;
- // <--
public:
- // --> OD 2008-01-23 #newlistlevelattrs#
SwNumberPortion( const XubString &rExpand,
SwFont *pFnt,
const sal_Bool bLeft,
const sal_Bool bCenter,
const KSHORT nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive );
- // <--
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual xub_StrLen GetCrsrOfst( const MSHORT nOfst ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
@@ -178,7 +175,6 @@ public:
class SwBulletPortion : public SwNumberPortion
{
public:
- // --> OD 2008-01-23 #newlistlevelattrs#
SwBulletPortion( const xub_Unicode cCh,
const XubString& rBulletFollowedBy,
SwFont *pFnt,
@@ -186,7 +182,6 @@ public:
const sal_Bool bCenter,
const KSHORT nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive );
- // <--
OUTPUT_OPERATOR
};
@@ -202,7 +197,6 @@ class SwGrfNumPortion : public SwNumberPortion
SwTwips nGrfHeight;
sal_Int16 eOrient;
public:
- // --> OD 2008-01-23 #newlistlevelattrs#
SwGrfNumPortion( SwFrm *pFrm,
const XubString& rGraphicFollowedBy,
const SvxBrushItem* pGrfBrush,
@@ -212,7 +206,6 @@ public:
const sal_Bool bCenter,
const KSHORT nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive );
- // <--
~SwGrfNumPortion();
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
@@ -272,3 +265,5 @@ CLASSIO( SwCombinedPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 976f4fbeadbc..c608fba00389 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,7 +69,7 @@ void SwFlyPortion::Paint( const SwTxtPaintInfo& ) const
*************************************************************************/
sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf )
{
- ASSERT( Fix() >= rInf.X(), "SwFlyPortion::Format: rush hour" );
+ OSL_ENSURE( Fix() >= rInf.X(), "SwFlyPortion::Format: rush hour" );
// 8537: Tabs muessen expandiert werden.
if( rInf.GetLastTab() )
((SwLinePortion*)rInf.GetLastTab())->FormatEOL( rInf );
@@ -78,7 +79,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf )
PrtWidth( static_cast<sal_uInt16>(Fix() - rInf.X() + PrtWidth()) );
if( !Width() )
{
- ASSERT( Width(), "+SwFlyPortion::Format: a fly is a fly is a fly" );
+ OSL_ENSURE( Width(), "+SwFlyPortion::Format: a fly is a fly is a fly" );
Width(1);
}
@@ -204,7 +205,7 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd
xub_StrLen SwTxtFrm::CalcFlyPos( SwFrmFmt* pSearch )
{
SwpHints* pHints = GetTxtNode()->GetpSwpHints();
- ASSERT( pHints, "CalcFlyPos: Why me?" );
+ OSL_ENSURE( pHints, "CalcFlyPos: Why me?" );
if( !pHints )
return STRING_LEN;
SwTxtAttr* pFound = NULL;
@@ -218,7 +219,7 @@ xub_StrLen SwTxtFrm::CalcFlyPos( SwFrmFmt* pSearch )
pFound = pHt;
}
}
- ASSERT( pHints, "CalcFlyPos: Not Found!" );
+ OSL_ENSURE( pHints, "CalcFlyPos: Not Found!" );
if( !pFound )
return STRING_LEN;
return *pFound->GetStart();
@@ -276,8 +277,8 @@ void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const
((SwTxtPaintInfo&)rInf).SelectFont();
// I want to know if this can really happen. So here comes a new
- ASSERT( ! rInf.GetVsh() || rInf.GetVsh()->GetOut() == rInf.GetOut(),
- "SwFlyCntPortion::Paint: Outdev has changed" )
+ OSL_ENSURE( ! rInf.GetVsh() || rInf.GetVsh()->GetOut() == rInf.GetOut(),
+ "SwFlyCntPortion::Paint: Outdev has changed" );
if( rInf.GetVsh() )
((SwTxtPaintInfo&)rInf).SetOut( rInf.GetVsh()->GetOut() );
}
@@ -301,7 +302,7 @@ SwFlyCntPortion::SwFlyCntPortion( const SwTxtFrm& rFrm,
bMax( sal_False ),
nAlign( 0 )
{
- ASSERT( pFly, "SwFlyCntPortion::SwFlyCntPortion: no SwFlyInCntFrm!" );
+ OSL_ENSURE( pFly, "SwFlyCntPortion::SwFlyCntPortion: no SwFlyInCntFrm!" );
nLineLength = 1;
nFlags |= AS_CHAR_ULSPACE | AS_CHAR_INIT;
SetBase( rFrm, rBase, nLnAscent, nLnDescent, nFlyAsc, nFlyDesc, nFlags );
@@ -319,7 +320,7 @@ SwFlyCntPortion::SwFlyCntPortion( const SwTxtFrm& rFrm,
bMax( sal_False ),
nAlign( 0 )
{
- ASSERT( pDrawContact, "SwFlyCntPortion::SwFlyCntPortion: no SwDrawContact!" );
+ OSL_ENSURE( pDrawContact, "SwFlyCntPortion::SwFlyCntPortion: no SwDrawContact!" );
if( !pDrawContact->GetAnchorFrm() )
{
// OD 2004-04-01 #i26791# - no direct positioning needed any more
@@ -364,7 +365,7 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm& rFrm, const Point &rBase,
pSdrObj = GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm );
if ( !pSdrObj )
{
- ASSERT( false, "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm )>" );
+ OSL_ENSURE( false, "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm )>" );
pSdrObj = GetDrawContact()->GetMaster();
}
// --> OD 2007-11-29 #i65798#
@@ -448,7 +449,8 @@ xub_StrLen SwFlyCntPortion::GetFlyCrsrOfst( const KSHORT nOfst,
xub_StrLen SwFlyCntPortion::GetCrsrOfst( const KSHORT nOfst ) const
{
- // ASSERT( !this, "SwFlyCntPortion::GetCrsrOfst: use GetFlyCrsrOfst()" );
+ // OSL_ENSURE( !this, "SwFlyCntPortion::GetCrsrOfst: use GetFlyCrsrOfst()" );
return SwLinePortion::GetCrsrOfst( nOfst );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 48590ec55100..ed2a7d5d8e65 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,3 +107,5 @@ CLASSIO( SwFlyCntPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index fef27b065278..384577d627ab 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,9 +72,7 @@ class SwFtnNumPortion : public SwNumberPortion
{
public:
inline SwFtnNumPortion( const XubString &rExpand, SwFont *pFntL )
- // --> OD 2008-01-23 #newlistlevelattrs#
: SwNumberPortion( rExpand, pFntL, sal_True, sal_False, 0, false )
- // <--
{ SetWhichPor( POR_FTNNUM ); }
OUTPUT_OPERATOR
@@ -128,3 +127,5 @@ CLASSIO( SwErgoSumPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 28207fb8b936..f36a2e9d6539 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,10 +34,8 @@
#include "swrect.hxx"
#include "paratr.hxx" // pTabStop, ADJ*
#include "viewopt.hxx" // SwViewOptions
-#include "errhdl.hxx" // ASSERT
#include <SwPortionHandler.hxx>
-#include "txtcfg.hxx"
#include "porglue.hxx"
#include "inftxt.hxx"
#include "porlay.hxx" // SwParaPortion, SetFull
@@ -111,9 +110,9 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.OnWin() && rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const xub_Unicode cChar = rInf.GetChar( rInf.GetIdx() );
- ASSERT( CH_BLANK == cChar || CH_BULLET == cChar,
+ OSL_ENSURE( CH_BLANK == cChar || CH_BULLET == cChar,
"SwGluePortion::Paint: blank expected" );
#endif
if( 1 == GetLen() )
@@ -224,7 +223,6 @@ void SwMarginPortion::AdjustRight( const SwLineLayout *pCurr )
SwGluePortion *pLeft = 0;
while( pPos )
{
- DBG_LOOP;
if( pPos->InFixMargGrp() )
pLeft = (SwGluePortion*)pPos;
pPos = pPos->GetPortion();
@@ -268,8 +266,6 @@ void SwMarginPortion::AdjustRight( const SwLineLayout *pCurr )
}
while( pPrev != pLeft )
{
- DBG_LOOP;
-
if( bNoMove || pPrev->PrtWidth() >= nRightGlue ||
pPrev->InHyphGrp() || pPrev->IsKernPortion() )
{
@@ -316,3 +312,4 @@ void SwMarginPortion::AdjustRight( const SwLineLayout *pCurr )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index 010b3488be52..a498c46cbb7e 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,6 @@
#ifndef _PORGLUE_HXX
#define _PORGLUE_HXX
-//#include <stdlib.h>
-
#include "porlin.hxx"
class SwRect;
@@ -132,3 +131,4 @@ CLASSIO( SwMarginPortion )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx
index 5d8f2c8007e8..c3f2934cedc8 100644
--- a/sw/source/core/text/porhyph.hxx
+++ b/sw/source/core/text/porhyph.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,3 +118,5 @@ CLASSIO( SwSoftHyphStrPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index ff90b8a3ed5c..984b8f3ce580 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include "errhdl.hxx" // ASSERT
-
-#include "txtcfg.hxx"
#include "porlay.hxx"
#include "itrform2.hxx"
#include "porglue.hxx"
@@ -71,7 +68,6 @@
using namespace ::com::sun::star;
using namespace i18n::ScriptType;
-//#ifdef BIDI
#include <unicode/ubidi.h>
#include <i18nutil/unicode.hxx> //unicode::getUnicodeScriptType
@@ -341,7 +337,6 @@ SwMarginPortion *SwLineLayout::CalcLeftMargin()
SwLinePortion *pPos = pLeft->GetPortion();
while( pPos )
{
- DBG_LOOP;
if( pPos->IsFlyPortion() )
{
// Die FlyPortion wird ausgesogen ...
@@ -452,8 +447,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
// Fix-Portion.
while( pPos )
{
- DBG_LOOP;
- ASSERT( POR_LIN != pPos->GetWhichPor(),
+ OSL_ENSURE( POR_LIN != pPos->GetWhichPor(),
"SwLineLayout::CalcLine: don't use SwLinePortions !" );
// Null-Portions werden eliminiert. Sie koennen entstehen,
@@ -501,7 +495,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
KSHORT nPosHeight = pPos->Height();
KSHORT nPosAscent = pPos->GetAscent();
- ASSERT( nPosHeight >= nPosAscent,
+ OSL_ENSURE( nPosHeight >= nPosAscent,
"SwLineLayout::CalcLine: bad ascent or height" );
if( pPos->IsHangingPortion() )
@@ -655,7 +649,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
// Robust:
if( nLineWidth < Width() )
Width( nLineWidth );
- ASSERT( nLineWidth >= Width(), "SwLineLayout::CalcLine: line is bursting" );
+ OSL_ENSURE( nLineWidth >= Width(), "SwLineLayout::CalcLine: line is bursting" );
SetDummy( bTmpDummy );
SetRedline( rLine.GetRedln() &&
rLine.GetRedln()->CheckLine( rLine.GetStart(), rLine.GetEnd() ) );
@@ -760,7 +754,7 @@ SwScriptInfo::~SwScriptInfo()
*************************************************************************/
sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
{
- ASSERT( pTxt || pSI,"How should I determine the script type?" );
+ OSL_ENSURE( pTxt || pSI,"How should I determine the script type?" );
sal_uInt16 nScript;
// First we try to use our SwScriptInfo
@@ -776,7 +770,7 @@ sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const Sw
case i18n::ScriptType::COMPLEX : return SW_CTL;
}
- ASSERT( sal_False, "Somebody tells lies about the script type!" );
+ OSL_ENSURE( sal_False, "Somebody tells lies about the script type!" );
return SW_LATIN;
}
@@ -854,7 +848,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// if change position = 0 we do not use any data from the arrays
// because by deleting all characters of the first group at the beginning
// of a paragraph nScript is set to a wrong value
- ASSERT( CountScriptChg(), "Where're my changes of script?" );
+ OSL_ENSURE( CountScriptChg(), "Where're my changes of script?" );
while( nCnt < CountScriptChg() )
{
if ( nChg > GetScriptChg( nCnt ) )
@@ -914,9 +908,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
//
// remove invalid entries from script information arrays
- const size_t nScriptRemove = aScriptChg.size() - nCnt;
- aScriptChg.erase( aScriptChg.begin() + nCnt, aScriptChg.end() );
- aScriptType.erase( aScriptType.begin() + nCnt, aScriptType.begin() + (nCnt + nScriptRemove) );
+ aScriptChanges.erase( aScriptChanges.begin() + nCnt, aScriptChanges.end() );
// get the start of the last compression group
sal_uInt16 nLastCompression = nChg;
@@ -932,10 +924,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
// remove invalid entries from compression information arrays
- const size_t nCompRemove = aCompChg.size() - nCntComp;
- aCompChg.erase( aCompChg.begin() + nCntComp, aCompChg.end() );
- aCompLen.erase( aCompLen.begin() + nCntComp, aCompLen.begin() + (nCntComp + nCompRemove) );
- aCompType.erase( aCompType.begin() + nCntComp, aCompType.end() );
+ aCompressionChanges.erase(aCompressionChanges.begin() + nCntComp, aCompressionChanges.end() );
// get the start of the last kashida group
sal_uInt16 nLastKashida = nChg;
@@ -967,7 +956,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
- ASSERT( i18n::ScriptType::LATIN == nScript ||
+ OSL_ENSURE( i18n::ScriptType::LATIN == nScript ||
i18n::ScriptType::ASIAN == nScript ||
i18n::ScriptType::COMPLEX == nScript, "Wrong default language" );
@@ -980,8 +969,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( nScript != nNextScript )
{
- aScriptChg.insert( aScriptChg.begin() + nCnt, nEnd );
- aScriptType.insert( aScriptType.begin() + nCnt, nScript );
+ aScriptChanges.push_back( ScriptChangeInfo(nEnd, nScript) );
nCnt++;
nScript = nNextScript;
}
@@ -991,11 +979,11 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// UPDATE THE SCRIPT INFO ARRAYS:
//
- while ( nChg < rTxt.Len() || ( aScriptChg.empty() && !rTxt.Len() ) )
+ while ( nChg < rTxt.Len() || ( aScriptChanges.empty() && !rTxt.Len() ) )
{
- ASSERT( i18n::ScriptType::WEAK != nScript,
+ OSL_ENSURE( i18n::ScriptType::WEAK != nScript,
"Inserting WEAK into SwScriptInfo structure" );
- ASSERT( STRING_LEN != nChg, "65K? Strange length of script section" );
+ OSL_ENSURE( STRING_LEN != nChg, "65K? Strange length of script section" );
xub_StrLen nSearchStt = nChg;
nChg = (xub_StrLen)pBreakIt->GetBreakIter()->endOfScript( rTxt, nSearchStt, nScript );
@@ -1032,19 +1020,18 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
nType == U_COMBINING_SPACING_MARK )
{
- aScriptChg.insert( aScriptChg.begin() + nCnt, nChg - 1 );
+ aScriptChanges.push_back( ScriptChangeInfo(nChg-1, nScript) );
}
else
{
- aScriptChg.insert( aScriptChg.begin() + nCnt, nChg );
+ aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) );
}
}
else
{
- aScriptChg.insert( aScriptChg.begin() + nCnt, nChg );
+ aScriptChanges.push_back( ScriptChangeInfo(nChg, nScript) );
}
- aScriptType.insert( aScriptType.begin() + nCnt, nScript );
- nCnt++;
+ ++nCnt;
// if current script is asian, we search for compressable characters
// in this range
@@ -1088,11 +1075,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
ePrevState != KANA )
{
- aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg );
- sal_uInt8 nTmpType = ePrevState;
- aCompType.insert( aCompType.begin() + nCntComp, nTmpType );
- aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg );
- nCntComp++;
+ aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
}
}
@@ -1110,11 +1093,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
ePrevState != KANA )
{
- aCompChg.insert( aCompChg.begin() + nCntComp, nPrevChg );
- sal_uInt8 nTmpType = ePrevState;
- aCompType.insert( aCompType.begin() + nCntComp, nTmpType );
- aCompLen.insert( aCompLen.begin() + nCntComp, nLastCompression - nPrevChg );
- nCntComp++;
+ aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
}
}
}
@@ -1178,7 +1157,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
( isHahChar ( cCh ) && nIdx == nWordLen - 1)) // Hah (dual joining) only at end of word
{
- ASSERT( 0 != cPrevCh, "No previous character" )
+ OSL_ENSURE( 0 != cPrevCh, "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
@@ -1198,7 +1177,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
isGafChar ( cCh ) )
&& nIdx == nWordLen - 1)) // only at end of word
{
- ASSERT( 0 != cPrevCh, "No previous character" )
+ OSL_ENSURE( 0 != cPrevCh, "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
@@ -1218,7 +1197,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
xub_Unicode cNextCh = rWord.GetChar( nIdx + 1 );
if ( isRehChar ( cNextCh ) || isYehChar ( cNextCh ))
{
- ASSERT( 0 != cPrevCh, "No previous character" )
+ OSL_ENSURE( 0 != cPrevCh, "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
@@ -1240,7 +1219,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
isFeChar ( cCh ) ) // Feh (dual joining)
&& nIdx == nWordLen - 1)) // only at end of word
{
- ASSERT( 0 != cPrevCh, "No previous character" )
+ OSL_ENSURE( 0 != cPrevCh, "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
@@ -1260,7 +1239,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
( 0x60C <= cCh && 0x6FE >= cCh // all others
&& nIdx == nWordLen - 1)) // only at end of word
{
- ASSERT( 0 != cPrevCh, "No previous character" )
+ OSL_ENSURE( 0 != cPrevCh, "No previous character" );
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
@@ -1292,9 +1271,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nLastCompression = nChg;
nLastKashida = nChg;
- };
+ }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// check kashida data
long nTmpKashidaPos = -1;
sal_Bool bWrongKash = sal_False;
@@ -1308,12 +1287,11 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
nTmpKashidaPos = nCurrKashidaPos;
}
- ASSERT( ! bWrongKash, "Kashida array contains wrong data" )
+ OSL_ENSURE( ! bWrongKash, "Kashida array contains wrong data" );
#endif
// remove invalid entries from direction information arrays
- aDirChg.clear();
- aDirType.clear();
+ aDirectionChanges.clear();
// Perform Unicode Bidi Algorithm for text direction information
bool bPerformUBA = UBIDI_LTR != nDefaultDir;
@@ -1333,7 +1311,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// 1. All text in RTL runs will use the CTL font
// #i89825# change the script type also to CTL (hennerdrewes)
// 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!)
- for ( size_t nDirIdx = 0; nDirIdx < aDirChg.size(); ++nDirIdx )
+ for ( sal_uInt32 nDirIdx = 0; nDirIdx < aDirectionChanges.size(); ++nDirIdx )
{
const sal_uInt8 nCurrDirType = GetDirType( nDirIdx );
// nStart ist start of RTL run:
@@ -1357,45 +1335,41 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
const xub_StrLen nStartPosOfGroup = nScriptIdx ? GetScriptChg( nScriptIdx - 1 ) : 0;
const sal_uInt8 nScriptTypeOfGroup = GetScriptType( nScriptIdx );
- ASSERT( nStartPosOfGroup <= nStart && GetScriptChg( nScriptIdx ) > nStart,
- "Script override with CTL font trouble" )
+ OSL_ENSURE( nStartPosOfGroup <= nStart && GetScriptChg( nScriptIdx ) > nStart,
+ "Script override with CTL font trouble" );
// Check if we have to insert a new script change at
// position nStart. If nStartPosOfGroup < nStart,
// we have to insert a new script change:
if ( nStart > 0 && nStartPosOfGroup < nStart )
{
- aScriptChg.insert( aScriptChg.begin() + nScriptIdx, nStart );
- aScriptType.insert( aScriptType.begin() + nScriptIdx, nScriptTypeOfGroup );
+ aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
+ ScriptChangeInfo(nStart, nScriptTypeOfGroup) );
++nScriptIdx;
}
// Remove entries in ScriptArray which end inside the RTL run:
- while ( nScriptIdx < aScriptChg.size() && GetScriptChg( nScriptIdx ) <= nEnd )
+ while ( nScriptIdx < aScriptChanges.size() && GetScriptChg( nScriptIdx ) <= nEnd )
{
- aScriptChg.erase( aScriptChg.begin() + nScriptIdx );
- aScriptType.erase( aScriptType.begin() + nScriptIdx );
+ aScriptChanges.erase(aScriptChanges.begin() + nScriptIdx);
}
// Insert a new entry in ScriptArray for the end of the RTL run:
- aScriptChg.insert( aScriptChg.begin() + nScriptIdx, nEnd );
- aScriptType.insert( aScriptType.begin() + nScriptIdx, i18n::ScriptType::COMPLEX );
+ aScriptChanges.insert(aScriptChanges.begin() + nScriptIdx,
+ ScriptChangeInfo(nEnd, i18n::ScriptType::COMPLEX) );
#if OSL_DEBUG_LEVEL > 1
- sal_uInt8 nScriptType;
- sal_uInt8 nLastScriptType = i18n::ScriptType::WEAK;
- xub_StrLen nScriptChg;
- xub_StrLen nLastScriptChg = 0;
- (void) nLastScriptChg;
- (void) nLastScriptType;
-
- for ( size_t i2 = 0; i2 < aScriptChg.size(); ++i2 )
+ // Check that ScriptChangeInfos are in increasing order of
+ // position and that we don't have "empty" changes.
+ sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
+ xub_StrLen nLastPos = 0;
+ for (std::vector<ScriptChangeInfo>::const_iterator i2 = aScriptChanges.begin(); i2 < aScriptChanges.end(); ++i2)
{
- nScriptChg = GetScriptChg( i2 );
- nScriptType = GetScriptType( i2 );
- ASSERT( nLastScriptType != nScriptType &&
- nLastScriptChg < nScriptChg,
- "Heavy InitScriptType() confusion" )
+ OSL_ENSURE( nLastTyp != i2->type &&
+ nLastPos < i2->position,
+ "Heavy InitScriptType() confusion" );
+ nLastPos = i2->position;
+ nLastTyp = i2->type;
}
#endif
}
@@ -1406,9 +1380,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
{
// remove invalid entries from direction information arrays
- aDirChg.clear();
- aDirType.clear();
-
+ aDirectionChanges.clear();
//
// Bidi functions from icu 2.0
//
@@ -1423,13 +1395,10 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
int32_t nStart = 0;
int32_t nEnd;
UBiDiLevel nCurrDir;
- // counter for direction information arrays
-
for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
- aDirChg.push_back( (sal_uInt16)nEnd );
- aDirType.push_back( (sal_uInt8)nCurrDir );
+ aDirectionChanges.push_back( DirectionChangeInfo(nEnd, nCurrDir) );
nStart = nEnd;
}
@@ -1514,7 +1483,7 @@ sal_uInt16 SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rT
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar )
{
- ASSERT( rNode.GetTxt().Len() == rText.Len(), "MaskHiddenRanges, string len mismatch" )
+ OSL_ENSURE( rNode.GetTxt().Len() == rText.Len(), "MaskHiddenRanges, string len mismatch" );
PositionList aList;
xub_StrLen nHiddenStart;
@@ -1765,8 +1734,8 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
Point* pPoint ) const
{
- ASSERT( nCompress, "Compression without compression?!" );
- ASSERT( nLen, "Compression without text?!" );
+ OSL_ENSURE( nCompress, "Compression without compression?!" );
+ OSL_ENSURE( nLen, "Compression without text?!" );
sal_uInt16 nCompCount = CountCompChg();
// In asian typography, there are full width and half width characters.
@@ -1801,7 +1770,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
{
sal_uInt16 nType = GetCompType( nCompIdx );
#if OSL_DEBUG_LEVEL > 1
- ASSERT( nType == CompType( nIdx ), "Gimme the right type!" );
+ OSL_ENSURE( nType == CompType( nIdx ), "Gimme the right type!" );
#endif
nCompLen = nCompLen + nIdx;
if( nCompLen > nLen )
@@ -1816,7 +1785,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
{
while( nIdx < nCompLen )
{
- ASSERT( SwScriptInfo::NONE != nType, "None compression?!" );
+ OSL_ENSURE( SwScriptInfo::NONE != nType, "None compression?!" );
// nLast is width of current character
nLast -= pKernArray[ nI ];
@@ -1888,7 +1857,7 @@ sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
xub_StrLen nLen,
long nSpaceAdd ) const
{
- ASSERT( nLen, "Kashida justification without text?!" )
+ OSL_ENSURE( nLen, "Kashida justification without text?!" );
if( !IsKashidaLine(nStt))
return STRING_LEN;
@@ -2168,7 +2137,7 @@ void SwScriptInfo::ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen )
// mark the given character indices as invalid kashida positions
bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPositions )
{
- ASSERT( pKashidaPositions && nCnt > 0, "Where are kashidas?" )
+ OSL_ENSURE( pKashidaPositions && nCnt > 0, "Where are kashidas?" );
sal_uInt16 nCntKash = 0;
xub_StrLen nKashidaPosIdx = 0;
@@ -2201,7 +2170,7 @@ sal_uInt16 SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArr
xub_StrLen nLen, xub_StrLen nNumberOfBlanks,
long nSpaceAdd )
{
- ASSERT( nStt + nLen <= rTxt.Len(), "String in ThaiJustify too small" )
+ OSL_ENSURE( nStt + nLen <= rTxt.Len(), "String in ThaiJustify too small" );
SwTwips nNumOfTwipsToDistribute = nSpaceAdd * nNumberOfBlanks /
SPACING_PRECISION_FACTOR;
@@ -2289,7 +2258,6 @@ xub_StrLen SwParaPortion::GetParLen() const
const SwLineLayout *pLay = this;
while( pLay )
{
- DBG_LOOP;
nLen = nLen + pLay->GetLen();
pLay = pLay->GetNext();
}
@@ -2331,7 +2299,7 @@ void SwLineLayout::Init( SwLinePortion* pNextPortion )
SetPortion( pNextPortion );
}
-/*-----------------16.11.00 11:04-------------------
+/*--------------------------------------------------
* HangingMargin()
* looks for hanging punctuation portions in the paragraph
* and return the maximum right offset of them.
@@ -2364,7 +2332,7 @@ SwTwips SwLineLayout::_GetHangingMargin() const
SwTwips SwTxtFrm::HangingMargin() const
{
- ASSERT( HasPara(), "Don't call me without a paraportion" );
+ OSL_ENSURE( HasPara(), "Don't call me without a paraportion" );
if( !GetPara()->IsMargin() )
return 0;
const SwLineLayout* pLine = GetPara();
@@ -2461,3 +2429,4 @@ void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHi
rNode.SetHiddenCharAttribute( bNewHiddenCharsHidePara, bNewContainsHiddenChars );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 9dc56001c125..bc7e560ad1d6 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -255,9 +256,11 @@ public:
const SwLinePortion* _pDontConsiderPortion = NULL,
const bool _bNoFlyCntPorAndLinePor = false ) const;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void DebugPortions( SvStream &rOs, const XubString &rTxt,
const xub_StrLen nStart ); //$ ostream
+
+ void dumpLineAsXml(xmlTextWriter* writer, USHORT& ofs, String& aText);
#endif
OUTPUT_OPERATOR
@@ -367,6 +370,10 @@ public:
const SwDropPortion *FindDropPortion() const;
+#if OSL_DEBUG_LEVEL > 1
+ void dumpAsXml( xmlTextWriter* writer, SwTxtFrm* pTxtFrm );
+#endif
+
OUTPUT_OPERATOR
DECL_FIXEDMEMPOOL_NEWDEL(SwParaPortion)
};
@@ -425,3 +432,5 @@ CLASSIO( SwLineLayout )
CLASSIO( SwParaPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 1de04c82b43c..da677f83c077 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,22 +30,16 @@
#include "precompiled_sw.hxx"
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <SwPortionHandler.hxx>
-#include "errhdl.hxx" // ASSERT
-
-#include "txtcfg.hxx"
#include "porlin.hxx"
#include "inftxt.hxx"
#include "portxt.hxx"
#include "pormulti.hxx"
#include "porglue.hxx"
-#include "inftxt.hxx"
#include "blink.hxx"
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool ChkChain( SwLinePortion *pStart )
{
@@ -53,7 +48,7 @@ sal_Bool ChkChain( SwLinePortion *pStart )
while( pPor )
{
++nCount;
- ASSERT( nCount < 200 && pPor != pStart,
+ OSL_ENSURE( nCount < 200 && pPor != pStart,
"ChkChain(): lost in chains" );
if( nCount >= 200 || pPor == pStart )
{
@@ -108,8 +103,8 @@ SwLinePortion::SwLinePortion( ) :
void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
const SwLinePortion* pLast ) const
{
- ASSERT( rInf.OnWin(), "SwLinePortion::PrePaint: don't prepaint on a printer");
- ASSERT( !Width(), "SwLinePortion::PrePaint: For Width()==0 only!");
+ OSL_ENSURE( rInf.OnWin(), "SwLinePortion::PrePaint: don't prepaint on a printer");
+ OSL_ENSURE( !Width(), "SwLinePortion::PrePaint: For Width()==0 only!");
const KSHORT nViewWidth = GetViewWidth( rInf );
@@ -192,7 +187,7 @@ void SwLinePortion::_Truncate()
{
SwLinePortion *pPos = pPortion;
do
- { ASSERT( pPos != this, "SwLinePortion::Truncate: loop" );
+ { OSL_ENSURE( pPos != this, "SwLinePortion::Truncate: loop" );
SwLinePortion *pLast = pPos;
pPos = pPos->GetPortion();
pLast->SetPortion( 0 );
@@ -213,7 +208,7 @@ SwLinePortion *SwLinePortion::Insert( SwLinePortion *pIns )
{
pIns->FindLastPortion()->SetPortion( pPortion );
SetPortion( pIns );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ChkChain( this );
#endif
return pIns;
@@ -229,7 +224,6 @@ SwLinePortion *SwLinePortion::FindLastPortion()
// An das Ende wandern und pLinPortion an den letzten haengen ...
while( pPos->GetPortion() )
{
- DBG_LOOP;
pPos = pPos->GetPortion();
}
return pPos;
@@ -244,7 +238,7 @@ SwLinePortion *SwLinePortion::Append( SwLinePortion *pIns )
SwLinePortion *pPos = FindLastPortion();
pPos->SetPortion( pIns );
pIns->SetPortion( 0 );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ChkChain( this );
#endif
return pIns;
@@ -257,7 +251,7 @@ SwLinePortion *SwLinePortion::Append( SwLinePortion *pIns )
SwLinePortion *SwLinePortion::Cut( SwLinePortion *pVictim )
{
SwLinePortion *pPrev = pVictim->FindPrevPortion( this );
- ASSERT( pPrev, "SwLinePortion::Cut(): can't cut" );
+ OSL_ENSURE( pPrev, "SwLinePortion::Cut(): can't cut" );
pPrev->SetPortion( pVictim->GetPortion() );
pVictim->SetPortion(0);
return pVictim;
@@ -269,14 +263,13 @@ SwLinePortion *SwLinePortion::Cut( SwLinePortion *pVictim )
SwLinePortion *SwLinePortion::FindPrevPortion( const SwLinePortion *pRoot )
{
- ASSERT( pRoot != this, "SwLinePortion::FindPrevPortion(): invalid root" );
+ OSL_ENSURE( pRoot != this, "SwLinePortion::FindPrevPortion(): invalid root" );
SwLinePortion *pPos = (SwLinePortion*)pRoot;
while( pPos->GetPortion() && pPos->GetPortion() != this )
{
- DBG_LOOP;
pPos = pPos->GetPortion();
}
- ASSERT( pPos->GetPortion(),
+ OSL_ENSURE( pPos->GetPortion(),
"SwLinePortion::FindPrevPortion: blowing in the wind");
return pPos;
}
@@ -299,12 +292,12 @@ xub_StrLen SwLinePortion::GetCrsrOfst( const KSHORT nOfst ) const
SwPosSize SwLinePortion::GetTxtSize( const SwTxtSizeInfo & ) const
{
- ASSERT( !this, "SwLinePortion::GetTxtSize: don't ask me about sizes, "
+ OSL_ENSURE( !this, "SwLinePortion::GetTxtSize: don't ask me about sizes, "
"I'm only a stupid SwLinePortion" );
return SwPosSize();
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* virtual SwLinePortion::Check()
@@ -424,3 +417,4 @@ void SwLinePortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Special( GetLen(), aString, GetWhichPor() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 8301d397659e..efa942a4cbcc 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,10 @@
#include "possiz.hxx" // SwPosSize
+#if OSL_DEBUG_LEVEL > 1
+#include <libxml/xmlwriter.h>
+#endif
+
class XubString;
class SwTxtSizeInfo;
class SwTxtPaintInfo;
@@ -39,7 +44,7 @@ class SwPortionHandler;
// Das CLASSIO-Makro implementiert die 'freischwebende' Funktion.
// Auf diese Weise erhaelt man beide Vorteile: virtuelle Ausgabeoperatoren
// und allgemeine Verwendbarkeit.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#define OUTPUT_OPERATOR virtual SvStream &operator<<( SvStream & aOs ) const;
#else
#define OUTPUT_OPERATOR
@@ -174,7 +179,7 @@ public:
virtual void Paint( const SwTxtPaintInfo &rInf ) const = 0;
void PrePaint( const SwTxtPaintInfo &rInf, const SwLinePortion *pLast ) const;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
virtual sal_Bool Check( SvStream &rOs, SwTxtSizeInfo &rInfo ); //$ ostream
#endif
@@ -195,6 +200,9 @@ public:
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
+#if OSL_DEBUG_LEVEL > 1
+ void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+#endif
OUTPUT_OPERATOR
};
@@ -237,15 +245,10 @@ inline void SwLinePortion::Truncate()
//$ ostream
-#ifdef DBGTXT
-#define CLASSIO( class ) \
- inline SvStream &operator<<( SvStream &rOs, const class &rClass ) {\
- return rClass.operator<<( rOs );\
- }
-#else
#define CLASSIO( class )
-#endif
CLASSIO( SwLinePortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 368f0782b144..222a669bd44e 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@
using namespace ::com::sun::star;
extern sal_Bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
-/*-----------------10.10.00 15:23-------------------
+/*--------------------------------------------------
* class SwMultiPortion
*
* A SwMultiPortion is not a simple portion,
@@ -79,11 +80,11 @@ SwMultiPortion::~SwMultiPortion()
void SwMultiPortion::Paint( const SwTxtPaintInfo & ) const
{
- ASSERT( sal_False,
+ OSL_ENSURE( sal_False,
"Don't try SwMultiPortion::Paint, try SwTxtPainter::PaintMultiPortion" );
}
-/*-----------------13.10.00 16:21-------------------
+/*--------------------------------------------------
* Summarize the internal lines to calculate the (external) size.
* The internal line has to calculate first.
* --------------------------------------------------*/
@@ -153,7 +154,7 @@ void SwMultiPortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Text( GetLen(), GetWhichPor() );
}
-/*-----------------01.11.00 14:21-------------------
+/*--------------------------------------------------
* SwMultiPortion::ActualizeTabulator()
* sets the tabulator-flag, if there's any tabulator-portion inside.
* --------------------------------------------------*/
@@ -178,7 +179,7 @@ void SwMultiPortion::ActualizeTabulator()
}
}
-/*-----------------16.02.01 12:07-------------------
+/*--------------------------------------------------
* SwRotatedPortion::SwRotatedPortion(..)
* --------------------------------------------------*/
@@ -264,7 +265,7 @@ xub_StrLen SwBidiPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf ) const
return nBlanks;
}
-/*-----------------01.11.00 14:22-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::SwDoubleLinePortion(..)
* This constructor is for the continuation of a doubleline portion
* in the next line.
@@ -293,7 +294,7 @@ SwDoubleLinePortion::SwDoubleLinePortion( SwDoubleLinePortion& rDouble,
}
}
-/*-----------------01.11.00 14:22-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::SwDoubleLinePortion(..)
* This constructor uses the textattribut to get the right brackets.
* The textattribut could be a 2-line-attribute or a character- or
@@ -358,7 +359,7 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
}
-/*-----------------25.10.00 09:51-------------------
+/*--------------------------------------------------
* SwMultiPortion::PaintBracket paints the wished bracket,
* if the multiportion has surrounding brackets.
* The X-position of the SwTxtPaintInfo will be modified:
@@ -398,7 +399,7 @@ void SwDoubleLinePortion::PaintBracket( SwTxtPaintInfo &rInf,
rInf.X( rInf.X() + PreWidth() );
}
-/*-----------------25.10.00 16:26-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::SetBrackets creates the bracket-structur
* and fills it, if not both characters are 0x00.
* --------------------------------------------------*/
@@ -416,7 +417,7 @@ void SwDoubleLinePortion::SetBrackets( const SwDoubleLinePortion& rDouble )
}
}
-/*-----------------25.10.00 16:29-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::FormatBrackets
* calculates the size of the brackets => pBracket,
* reduces the nMaxWidth-parameter ( minus bracket-width )
@@ -486,7 +487,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi
nMaxWidth += rInf.X();
}
-/*-----------------26.10.00 10:36-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::CalcBlanks
* calculates the number of blanks in each line and
* the difference of the width of the two lines.
@@ -530,7 +531,7 @@ long SwDoubleLinePortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo & ) c
return HasTabulator() ? 0 : GetSpaceCnt() * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
-/*-----------------01.11.00 14:29-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::ChangeSpaceAdd(..)
* merges the spaces for text adjustment from the inner and outer part.
* Inside the doubleline portion the wider line has no spaceadd-array, the
@@ -576,7 +577,7 @@ sal_Bool SwDoubleLinePortion::ChgSpaceAdd( SwLineLayout* pCurr,
}
return bRet;
}
-/*-----------------01.11.00 14:29-------------------
+/*--------------------------------------------------
* SwDoubleLinePortion::ResetSpaceAdd(..)
* cancels the manipulation from SwDoubleLinePortion::ChangeSpaceAdd(..)
* --------------------------------------------------*/
@@ -593,7 +594,7 @@ SwDoubleLinePortion::~SwDoubleLinePortion()
delete pBracket;
}
-/*-----------------13.11.00 14:50-------------------
+/*--------------------------------------------------
* SwRubyPortion::SwRubyPortion(..)
* constructs a ruby portion, i.e. an additional text is displayed
* beside the main text, e.g. phonetic characters.
@@ -610,7 +611,7 @@ SwRubyPortion::SwRubyPortion( const SwRubyPortion& rRuby, xub_StrLen nEnd ) :
SetRuby();
}
-/*-----------------13.11.00 14:50-------------------
+/*--------------------------------------------------
* SwRubyPortion::SwRubyPortion(..)
* constructs a ruby portion, i.e. an additional text is displayed
* beside the main text, e.g. phonetic characters.
@@ -623,8 +624,8 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
: SwMultiPortion( nEnd )
{
SetRuby();
- ASSERT( SW_MC_RUBY == rCreate.nId, "Ruby expected" );
- ASSERT( RES_TXTATR_CJK_RUBY == rCreate.pAttr->Which(), "Wrong attribute" );
+ OSL_ENSURE( SW_MC_RUBY == rCreate.nId, "Ruby expected" );
+ OSL_ENSURE( RES_TXTATR_CJK_RUBY == rCreate.pAttr->Which(), "Wrong attribute" );
const SwFmtRuby& rRuby = rCreate.pAttr->GetRuby();
nAdjustment = rRuby.GetAdjustment();
nRubyOffset = nOffs;
@@ -677,7 +678,7 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
SetDirection( DIR_LEFT2RIGHT );
}
-/*-----------------13.11.00 14:56-------------------
+/*--------------------------------------------------
* SwRubyPortion::_Adjust(..)
* In ruby portion there are different alignments for
* the ruby text and the main text.
@@ -748,7 +749,7 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
}
break;
}
- default: ASSERT( sal_False, "New ruby adjustment" );
+ default: OSL_ENSURE( sal_False, "New ruby adjustment" );
}
if( nLeft || nRight )
{
@@ -773,7 +774,7 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
rInf.SetIdx( nOldIdx );
}
-/*-----------------08.11.00 14:14-------------------
+/*--------------------------------------------------
* CalcRubyOffset()
* has to change the nRubyOffset, if there's a fieldportion
* in the phonetic line.
@@ -807,7 +808,7 @@ void SwRubyPortion::CalcRubyOffset()
}
}
-/*-----------------13.10.00 16:22-------------------
+/*--------------------------------------------------
* SwTxtSizeInfo::GetMultiCreator(..)
* If we (e.g. the position rPos) are inside a two-line-attribute or
* a ruby-attribute, the attribute will be returned in a SwMultiCreator-struct,
@@ -820,7 +821,7 @@ void SwRubyPortion::CalcRubyOffset()
* with different brackets interrupts another 2-line-attribute.
* --------------------------------------------------*/
-/*-----------------13.11.00 15:38-------------------
+/*--------------------------------------------------
* lcl_Has2Lines(..)
* is a little help function for GetMultiCreator(..)
* It extracts the 2-line-format from a 2-line-attribute or a character style.
@@ -849,7 +850,7 @@ sal_Bool lcl_Has2Lines( const SwTxtAttr& rAttr, const SvxTwoLinesItem* &rpRef,
return sal_False;
}
-/*-----------------16.02.01 16:39-------------------
+/*--------------------------------------------------
* lcl_HasRotation(..)
* is a little help function for GetMultiCreator(..)
* It extracts the charrotation from a charrotate-attribute or a character style.
@@ -887,7 +888,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
sal_uInt8 nCurrLevel;
if ( pMulti )
{
- ASSERT( pMulti->IsBidi(), "Nested MultiPortion is not BidiPortion" )
+ OSL_ENSURE( pMulti->IsBidi(), "Nested MultiPortion is not BidiPortion" );
// level associated with bidi-portion;
nCurrLevel = ((SwBidiPortion*)pMulti)->GetLevel();
}
@@ -1265,7 +1266,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
return NULL;
}
-/*-----------------01.11.00 14:52-------------------
+/*--------------------------------------------------
* SwSpaceManipulator
* is a little helper class to manage the spaceadd-arrays of the text adjustment
* during a PaintMultiPortion.
@@ -1355,7 +1356,7 @@ SwSpaceManipulator::~SwSpaceManipulator()
rInfo.SetDirection( nOldDir );
}
-/*-----------------13.10.00 16:24-------------------
+/*--------------------------------------------------
* SwTxtPainter::PaintMultiPortion manages the paint for a SwMultiPortion.
* External, for the calling function, it seems to be a normal Paint-function,
* internal it is like a SwTxtFrm::Paint with multiple DrawTextLines
@@ -1366,13 +1367,11 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
{
GETGRID( pFrm->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
- sal_uInt16 nGridWidth = 0;
sal_uInt16 nRubyHeight = 0;
sal_Bool bRubyTop = sal_False;
if ( bHasGrid )
{
- nGridWidth = pGrid->GetBaseHeight();
nRubyHeight = pGrid->GetRubyHeight();
bRubyTop = ! pGrid->GetRubyTextBelow();
}
@@ -1397,8 +1396,8 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
{
// these values are needed for the calculation of the x coordinate
// and the layout mode
- ASSERT( ! pEnvPor || pEnvPor->IsBidi(),
- "Oh no, I expected a BidiPortion" )
+ OSL_ENSURE( ! pEnvPor || pEnvPor->IsBidi(),
+ "Oh no, I expected a BidiPortion" );
nFrmDir = GetInfo().GetTxtFrm()->IsRightToLeft() ? 1 : 0;
nEnvDir = pEnvPor ? ((SwBidiPortion*)pEnvPor)->GetLevel() % 2 : nFrmDir;
nThisDir = ((SwBidiPortion&)rMulti).GetLevel() % 2;
@@ -1502,8 +1501,8 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
sal_Bool bRest = pLay->IsRest();
sal_Bool bFirst = sal_True;
- ASSERT( 0 == GetInfo().GetUnderFnt() || rMulti.IsBidi(),
- " Only BiDi portions are allowed to use the common underlining font" )
+ OSL_ENSURE( 0 == GetInfo().GetUnderFnt() || rMulti.IsBidi(),
+ " Only BiDi portions are allowed to use the common underlining font" );
do
{
@@ -1595,7 +1594,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
if( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
{
// but we do allow nested bidi portions
- ASSERT( rMulti.IsBidi(), "Only nesting of bidi portions is allowed" )
+ OSL_ENSURE( rMulti.IsBidi(), "Only nesting of bidi portions is allowed" );
PaintMultiPortion( rPaint, (SwMultiPortion&)*pPor, &rMulti );
}
else
@@ -1794,7 +1793,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
// We set nTmpX (which is used for portion calculating) to the
// current Y value
const SwPageFrm* pPage = pFrm->FindPageFrm();
- ASSERT( pPage, "No page in frame!");
+ OSL_ENSURE( pPage, "No page in frame!");
const SwLayoutFrm* pUpperFrm = pPage;
if ( pFrm->IsInTab() )
@@ -1802,7 +1801,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
pUpperFrm = pFrm->GetUpper();
while ( pUpperFrm && !pUpperFrm->IsCellFrm() )
pUpperFrm = pUpperFrm->GetUpper();
- ASSERT( pUpperFrm, "pFrm is in table but does not have an upper cell frame" )
+ OSL_ENSURE( pUpperFrm, "pFrm is in table but does not have an upper cell frame" );
const SwTableLine* pLine = ((SwRowFrm*)pUpperFrm->GetUpper())->GetTabLine();
const SwFmtFrmSize& rFrmFmtSize = pLine->GetFrmFmt()->GetFrmSize();
if ( ATT_VAR_SIZE == rFrmFmtSize.GetHeightSizeType() )
@@ -1873,16 +1872,10 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
GETGRID( pFrm->FindPageFrm() )
const sal_Bool bHasGrid = pGrid && GRID_LINES_CHARS == pGrid->GetGridType();
- sal_uInt16 nGridWidth = 0;
- sal_uInt16 nRubyHeight = 0;
sal_Bool bRubyTop = sal_False;
if ( bHasGrid )
- {
- nGridWidth = pGrid->GetBaseHeight();
- nRubyHeight = pGrid->GetRubyHeight();
bRubyTop = ! pGrid->GetRubyTextBelow();
- }
do
{
@@ -1899,7 +1892,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
if( pFirstRest )
{
- ASSERT( pFirstRest->InFldGrp(), "BuildMulti: Fieldrest expected");
+ OSL_ENSURE( pFirstRest->InFldGrp(), "BuildMulti: Fieldrest expected");
SwFldPortion *pFld =
((SwFldPortion*)pFirstRest)->Clone(
((SwFldPortion*)pFirstRest)->GetExp() );
@@ -1946,7 +1939,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
pNextFirst = aInf.GetRest();
if( pSecondRest )
{
- ASSERT( pSecondRest->InFldGrp(), "Fieldrest expected");
+ OSL_ENSURE( pSecondRest->InFldGrp(), "Fieldrest expected");
SwFldPortion *pFld = ((SwFldPortion*)pSecondRest)->Clone(
((SwFldPortion*)pSecondRest)->GetExp() );
pFld->SetFollow( sal_True );
@@ -2084,7 +2077,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
// line break has to be performed!
if( bRet )
{
- ASSERT( !pNextFirst || pNextFirst->InFldGrp(),
+ OSL_ENSURE( !pNextFirst || pNextFirst->InFldGrp(),
"BuildMultiPortion: Surprising restportion, field expected" );
SwMultiPortion *pTmp;
if( rMulti.IsDouble() )
@@ -2092,7 +2085,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
nMultiLen + rInf.GetIdx() );
else if( rMulti.IsRuby() )
{
- ASSERT( !pNextSecond || pNextSecond->InFldGrp(),
+ OSL_ENSURE( !pNextSecond || pNextSecond->InFldGrp(),
"BuildMultiPortion: Surprising restportion, field expected" );
if ( rInf.GetIdx() == rInf.GetLineStart() )
@@ -2185,7 +2178,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
return bRet;
}
-/*-----------------08.11.00 09:29-------------------
+/*--------------------------------------------------
* SwTxtFormatter::MakeRestPortion(..)
* When a fieldportion at the end of line breaks and needs a following
* fieldportion in the next line, then the "restportion" of the formatinfo
@@ -2229,7 +2222,7 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
}
else if( pPor->IsMultiPortion() )
{
- ASSERT( !pHelpMulti || pHelpMulti->IsBidi(),
+ OSL_ENSURE( !pHelpMulti || pHelpMulti->IsBidi(),
"Nested multiportions are forbidden." );
pFld = NULL;
@@ -2289,12 +2282,15 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
if ( !pCreate )
{
- ASSERT( !pHelpMulti->GetLen(), "Multiportion without attribut?" );
+ OSL_ENSURE( !pHelpMulti->GetLen(), "Multiportion without attribut?" );
if ( nMultiPos )
--nMultiPos;
pCreate = GetInfo().GetMultiCreator( --nMultiPos, 0 );
}
+ if (!pCreate)
+ return pRest;
+
if( pRest || nMultiPos > nPosition || ( pHelpMulti->IsRuby() &&
((SwRubyPortion*)pHelpMulti)->GetRubyOffset() < STRING_LEN ) )
{
@@ -2349,7 +2345,7 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
-/*-----------------23.10.00 10:47-------------------
+/*--------------------------------------------------
* SwTxtCursorSave notes the start and current line of a SwTxtCursor,
* sets them to the values for GetCrsrOfst inside a multiportion
* and restores them in the destructor.
@@ -2413,3 +2409,4 @@ SwTxtCursorSave::~SwTxtCursorSave()
pTxtCrsr->SetPropFont( nOldProp );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index b292f1163e1d..4facac70a342 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@ class SwTxtAttr;
class SfxPoolItem;
class SwFont;
-/*-----------------02.02.01 15:01-------------------
+/*--------------------------------------------------
* SwMultiCreator is a small structur to create a multiportion.
* It contains the kind of multiportion and a textattribute
* or a poolitem.
@@ -60,7 +61,7 @@ struct SwMultiCreator
sal_uInt8 nLevel;
};
-/*-----------------25.10.00 16:19-------------------
+/*--------------------------------------------------
* A two-line-portion (SwMultiPortion) could have surrounding brackets,
* in this case the structur SwBracket will be used.
* --------------------------------------------------*/
@@ -78,7 +79,7 @@ struct SwBracket
sal_uInt8 nPostScript; // Script of the final character
};
-/*-----------------16.10.00 12:45-------------------
+/*--------------------------------------------------
* The SwMultiPortion is line portion inside a line portion,
* it's a group of portions,
* e.g. a double line portion in a line
@@ -266,3 +267,5 @@ inline sal_Bool SwMultiPortion::HasBrackets() const
CLASSIO( SwMultiPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porref.cxx b/sw/source/core/text/porref.cxx
index 6794d7c1ed0d..6b28b0a445d6 100644
--- a/sw/source/core/text/porref.cxx
+++ b/sw/source/core/text/porref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include <SwPortionHandler.hxx>
#include "viewopt.hxx" // SwViewOptions
-#include "txtcfg.hxx"
#include "porref.hxx"
#include "inftxt.hxx" // GetTxtSize()
@@ -113,3 +113,4 @@ void SwIsoRefPortion::HandlePortion( SwPortionHandler& rPH ) const
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porref.hxx b/sw/source/core/text/porref.hxx
index aee1e46c66ad..67c64dad83d0 100644
--- a/sw/source/core/text/porref.hxx
+++ b/sw/source/core/text/porref.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ CLASSIO( SwIsoRefPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 52acbe4e2e95..75bc6831035e 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,6 @@
#include <pagefrm.hxx> // SwPageFrm
#include <paratr.hxx>
#include <SwPortionHandler.hxx>
-#include <txtcfg.hxx>
#include <porrst.hxx>
#include <inftxt.hxx>
#include <txtpaint.hxx> // ClipVout
@@ -58,6 +58,8 @@
#include <IDocumentSettingAccess.hxx>
#include <IDocumentDeviceAccess.hxx>
+#include <crsrsh.hxx>
+
/*************************************************************************
* class SwTmpEndPortion
*************************************************************************/
@@ -172,7 +174,7 @@ void SwKernPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.GetFont()->IsPaintBlank() )
{
- static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+ static sal_Char const sDoubleSpace[] = " ";
XubString aTxtDouble( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
// --> FME 2006-07-12 #b6439097#
SwRect aClipRect;
@@ -228,7 +230,21 @@ SwLinePortion *SwArrowPortion::Compress() { return this; }
SwTwips SwTxtFrm::EmptyHeight() const
{
- ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::EmptyHeight with swapped frame" );
+ if (IsCollapse()) {
+ ViewShell *pSh = GetShell();
+ if ( pSh->IsA( TYPE(SwCrsrShell) ) ) {
+ SwCrsrShell *pCrSh=(SwCrsrShell*)pSh;
+ SwCntntFrm *pCurrFrm=pCrSh->GetCurrFrm();
+ if (pCurrFrm==(SwCntntFrm*)this) {
+ // do nothing
+ } else {
+ return 1;
+ }
+ } else {
+ return 1;
+ }
+ }
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::EmptyHeight with swapped frame" );
SwFont *pFnt;
const SwTxtNode& rTxtNode = *GetTxtNode();
@@ -291,7 +307,7 @@ SwTwips SwTxtFrm::EmptyHeight() const
sal_Bool SwTxtFrm::FormatEmpty()
{
- ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::FormatEmpty with swapped frame" );
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::FormatEmpty with swapped frame" );
if ( HasFollow() || GetTxtNode()->GetpSwpHints() ||
0 != GetTxtNode()->GetNumRule() ||
@@ -425,8 +441,8 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff )
rRegDiff = rSpace.GetLineHeight();
break;
}
- default: ASSERT(
- sal_False, ": unknown LineSpaceRule" );
+ default:
+ OSL_ENSURE( sal_False, ": unknown LineSpaceRule" );
}
switch( rSpace.GetInterLineSpaceRule() )
{
@@ -451,7 +467,7 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff )
nNettoHeight = rRegDiff;
break;
}
- default: ASSERT( sal_False, ": unknown InterLineSpaceRule" );
+ default: OSL_ENSURE( sal_False, ": unknown InterLineSpaceRule" );
}
pDesc->SetRegHeight( rRegDiff );
pDesc->SetRegAscent( rRegDiff - nNettoHeight +
@@ -577,3 +593,5 @@ KSHORT SwControlCharPortion::GetViewWidth( const SwTxtSizeInfo& rInf ) const
return mnViewWidth;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx
index 1eaaa442b9b0..1c1d2dd48893 100644
--- a/sw/source/core/text/porrst.hxx
+++ b/sw/source/core/text/porrst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -185,3 +186,5 @@ CLASSIO( SwKernPortion )
CLASSIO( SwArrowPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx
index 00b061230a46..3cda7b9d1f96 100644
--- a/sw/source/core/text/portab.hxx
+++ b/sw/source/core/text/portab.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -155,3 +156,5 @@ CLASSIO( SwTabDecimalPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/portox.cxx b/sw/source/core/text/portox.cxx
index 91a8fcd5eff0..39dab8101301 100644
--- a/sw/source/core/text/portox.cxx
+++ b/sw/source/core/text/portox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#include <SwPortionHandler.hxx>
#include "viewopt.hxx" // SwViewOptions
-#include "txtcfg.hxx"
#include "portox.hxx"
#include "inftxt.hxx" // GetTxtSize()
@@ -113,3 +113,4 @@ void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Special( GetLen(), aString, GetWhichPor() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/portox.hxx b/sw/source/core/text/portox.hxx
index 848fc9ecf6f1..9c867701d7cc 100644
--- a/sw/source/core/text/portox.hxx
+++ b/sw/source/core/text/portox.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#define _PORTOX_HXX
#include "portxt.hxx"
-//#include "porglue.hxx"
/*************************************************************************
* class SwToxPortion
@@ -73,3 +73,5 @@ CLASSIO( SwIsoToxPortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index f123f6c42c6b..43a0e126f121 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,13 +32,9 @@
#include <ctype.h>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <hintids.hxx> // CH_TXTATR
-#include <errhdl.hxx> // ASSERT
#include <SwPortionHandler.hxx>
-#include <txtcfg.hxx>
#include <porlay.hxx>
#include <inftxt.hxx>
#include <guess.hxx> // SwTxtGuess, Zeilenumbruch
@@ -328,7 +325,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
// this should usually be true but
aGuess.AlternativeSpelling( rInf, rInf.GetSoftHyphPos() - 1 );
bFull = CreateHyphen( rInf, aGuess );
- ASSERT( bFull, "Problem with hyphenation!!!" );
+ OSL_ENSURE( bFull, "Problem with hyphenation!!!" );
}
rInf.ChgHyph( bHyph );
rInf.SetSoftHyphPos( 0 );
@@ -436,7 +433,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
SetLen( aGuess.BreakPos() - rInf.GetIdx() );
- ASSERT( aGuess.BreakStart() >= aGuess.FieldDiff(),
+ OSL_ENSURE( aGuess.BreakStart() >= aGuess.FieldDiff(),
"Trouble with expanded field portions during line break" );
const xub_StrLen nRealStart = aGuess.BreakStart() - aGuess.FieldDiff();
if( aGuess.BreakPos() < nRealStart && !InExpGrp() )
@@ -492,9 +489,9 @@ sal_Bool SwTxtPortion::Format( SwTxtFormatInfo &rInf )
return sal_True;
}
- ASSERT( rInf.RealWidth() || (rInf.X() == rInf.Width()),
+ OSL_ENSURE( rInf.RealWidth() || (rInf.X() == rInf.Width()),
"SwTxtPortion::Format: missing real width" );
- ASSERT( Height(), "SwTxtPortion::Format: missing height" );
+ OSL_ENSURE( Height(), "SwTxtPortion::Format: missing height" );
return _Format( rInf );
}
@@ -552,7 +549,7 @@ void SwTxtPortion::FormatEOL( SwTxtFormatInfo &rInf )
xub_StrLen SwTxtPortion::GetCrsrOfst( const KSHORT nOfst ) const
{
- ASSERT( !this, "SwTxtPortion::GetCrsrOfst: don't use this method!" );
+ OSL_ENSURE( !this, "SwTxtPortion::GetCrsrOfst: don't use this method!" );
return SwLinePortion::GetCrsrOfst( nOfst );
}
@@ -791,12 +788,12 @@ namespace {
{
const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters();
sal_Int32 nCurrentIdx = 0;
- const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT));
+ const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT)));
if(pResult != pParameters->end())
pResult->second >>= nCurrentIdx;
if(io_pCurrentText)
{
- const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY));
+ const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY)));
if(pListEntries != pParameters->end())
{
uno::Sequence< ::rtl::OUString > vListEntries;
@@ -825,17 +822,18 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
if ( pBM != NULL )
{
- if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{ // a checkbox...
ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM);
bool checked = pCheckboxFm->IsChecked();
rInf.DrawCheckBox(*this, checked);
}
- else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ else if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) )
{ // a list...
rtl::OUString aTxt;
+ getCurrentListIndex( pBM, &aTxt );
rInf.DrawViewOpt( *this, POR_FLD );
- rInf.DrawText( aTxt, *this, 0, 0/*aTxt.getLength()*/, false );
+ rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false );
}
else
{
@@ -852,16 +850,16 @@ sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf )
SwIndex aIndex( pNd, rInf.GetIdx( ) );
SwPosition aPosition( *pNd, aIndex );
IFieldmark *pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition );
- ASSERT( pBM != NULL, "Where is my form field bookmark???" );
+ OSL_ENSURE( pBM != NULL, "Where is my form field bookmark???" );
if ( pBM != NULL )
{
- if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) )
{
Width( rInf.GetTxtHeight( ) );
Height( rInf.GetTxtHeight( ) );
SetAscent( rInf.GetAscent( ) );
}
- else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ else if ( pBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) )
{
::rtl::OUString aTxt;
getCurrentListIndex( pBM, &aTxt );
@@ -879,3 +877,4 @@ sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 2d4d5faf9e98..3b00ec7ffedb 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,6 +67,10 @@ public:
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
+#if OSL_DEBUG_LEVEL > 1
+ void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+#endif
+
OUTPUT_OPERATOR
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtPortion)
};
@@ -115,3 +120,5 @@ CLASSIO( SwTxtPortion )
CLASSIO( SwHolePortion )
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/possiz.hxx b/sw/source/core/text/possiz.hxx
index a8f735c7b33a..c97d122da2ff 100644
--- a/sw/source/core/text/possiz.hxx
+++ b/sw/source/core/text/possiz.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ inline SwPosSize &SwPosSize::operator=( const Size &rSize )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 2de77f4f9d21..78ec78789c52 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include "hintids.hxx"
#include <svl/whiter.hxx>
#include <tools/shl.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <swmodule.hxx>
#include <redline.hxx> // SwRedline
#include <txtatr.hxx> // SwTxt ...
@@ -48,9 +47,7 @@
#include <vcl/cmdevt.hxx>
#include <vcl/settings.hxx>
#include <txtfrm.hxx> // SwTxtFrm
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <redlnitr.hxx>
#include <extinput.hxx>
#include <sfx2/printer.hxx>
@@ -103,7 +100,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
aMagicNo[SW_LATIN] = aMagicNo[SW_CJK] = aMagicNo[SW_CTL] = NULL;
// determine script changes if not already done for current paragraph
- ASSERT( pScriptInfo, "No script info available");
+ OSL_ENSURE( pScriptInfo, "No script info available");
if ( pScriptInfo->GetInvalidity() != STRING_LEN )
pScriptInfo->InitScriptInfo( rTxtNode, bRTL );
@@ -321,7 +318,7 @@ void SwRedlineItr::FillHints( MSHORT nAuthor, RedlineType_t eType )
void SwRedlineItr::ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg )
{
- ASSERT( IsOn(), "SwRedlineItr::ChangeTxtAttr: Off?" );
+ OSL_ENSURE( IsOn(), "SwRedlineItr::ChangeTxtAttr: Off?" );
if( !bShow && !pExt )
return;
@@ -335,14 +332,14 @@ void SwRedlineItr::ChangeTxtAttr( SwFont* pFnt, SwTxtAttr &rHt, sal_Bool bChg )
}
else
{
- ASSERT( ! pExt || ! pExt->IsOn(), "Pop of attribute during opened extension" )
+ OSL_ENSURE( ! pExt || ! pExt->IsOn(), "Pop of attribute during opened extension" );
rAttrHandler.PopAndChg( rHt, *pFnt );
}
}
void SwRedlineItr::_Clear( SwFont* pFnt )
{
- ASSERT( bOn, "SwRedlineItr::Clear: Off?" );
+ OSL_ENSURE( bOn, "SwRedlineItr::Clear: Off?" );
bOn = sal_False;
while( aHints.Count() )
{
@@ -448,8 +445,8 @@ void SwExtend::ActualizeFont( SwFont &rFnt, MSHORT nAttr )
short SwExtend::Enter( SwFont& rFnt, xub_StrLen nNew )
{
- ASSERT( !Inside(), "SwExtend: Enter without Leave" );
- ASSERT( !pFnt, "SwExtend: Enter with Font" );
+ OSL_ENSURE( !Inside(), "SwExtend: Enter without Leave" );
+ OSL_ENSURE( !pFnt, "SwExtend: Enter with Font" );
nPos = nNew;
if( Inside() )
{
@@ -462,7 +459,7 @@ short SwExtend::Enter( SwFont& rFnt, xub_StrLen nNew )
sal_Bool SwExtend::_Leave( SwFont& rFnt, xub_StrLen nNew )
{
- ASSERT( Inside(), "SwExtend: Leave without Enter" );
+ OSL_ENSURE( Inside(), "SwExtend: Leave without Enter" );
MSHORT nOldAttr = rArr[ nPos - nStart ];
nPos = nNew;
if( Inside() )
@@ -503,3 +500,5 @@ xub_StrLen SwExtend::Next( xub_StrLen nNext )
}
return nNext;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index c288d427e92c..0fd14acd302f 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "ndhints.hxx"
-#ifndef IDOCUMENTREDLINEACCESS_HXX_INCLUDED
#include <IDocumentRedlineAccess.hxx>
-#endif
#include "swfont.hxx"
#ifndef _SVSTDARR_USHORTS
@@ -114,10 +113,11 @@ public:
{ return pExt->Leave(rFnt, nNew ); }
inline sal_Bool ExtOn() { if( pExt ) return pExt->IsOn(); return sal_False; }
inline void UpdateExtFont( SwFont &rFnt ) {
- ASSERT( ExtOn(), "UpdateExtFont without ExtOn" )
+ OSL_ENSURE( ExtOn(), "UpdateExtFont without ExtOn" );
pExt->UpdateFont( rFnt ); }
};
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx
index 6a54639390dd..b6995b4e2b08 100644
--- a/sw/source/core/text/txtcache.cxx
+++ b/sw/source/core/text/txtcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
-#include "errhdl.hxx"
#include "txtcache.hxx"
#include "txtfrm.hxx"
@@ -40,9 +40,6 @@
|*
|* SwTxtLine::SwTxtLine(), ~SwTxtLine()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 16. Mar. 94
-|*
|*************************************************************************/
SwTxtLine::SwTxtLine( SwTxtFrm *pFrm, SwParaPortion *pNew ) :
@@ -60,9 +57,6 @@ SwTxtLine::~SwTxtLine()
|*
|* SwTxtLineAccess::NewObj()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 16. Mar. 94
-|*
|*************************************************************************/
SwCacheObj *SwTxtLineAccess::NewObj()
@@ -74,9 +68,6 @@ SwCacheObj *SwTxtLineAccess::NewObj()
|*
|* SwTxtLineAccess::GetPara()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 16. Mar. 94
-|*
|*************************************************************************/
SwParaPortion *SwTxtLineAccess::GetPara()
@@ -99,9 +90,6 @@ SwParaPortion *SwTxtLineAccess::GetPara()
|*
|* SwTxtLineAccess::SwTxtLineAccess()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 16. Mar. 94
-|*
|*************************************************************************/
SwTxtLineAccess::SwTxtLineAccess( const SwTxtFrm *pOwn ) :
@@ -113,9 +101,6 @@ SwTxtLineAccess::SwTxtLineAccess( const SwTxtFrm *pOwn ) :
|*
|* SwTxtLineAccess::IsAvailable
|*
-|* Ersterstellung MA 23. Mar. 94
-|* Letzte Aenderung MA 23. Mar. 94
-|*
|*************************************************************************/
sal_Bool SwTxtLineAccess::IsAvailable() const
@@ -129,9 +114,6 @@ sal_Bool SwTxtLineAccess::IsAvailable() const
|*
|* SwTxtFrm::HasPara()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 22. Aug. 94
-|*
|*************************************************************************/
sal_Bool SwTxtFrm::_HasPara() const
@@ -153,9 +135,6 @@ sal_Bool SwTxtFrm::_HasPara() const
|*
|* SwTxtFrm::GetPara()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 22. Aug. 94
-|*
|*************************************************************************/
SwParaPortion *SwTxtFrm::GetPara()
@@ -176,14 +155,11 @@ SwParaPortion *SwTxtFrm::GetPara()
|*
|* SwTxtFrm::ClearPara()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 22. Aug. 94
-|*
|*************************************************************************/
void SwTxtFrm::ClearPara()
{
- ASSERT( !IsLocked(), "+SwTxtFrm::ClearPara: this is locked." );
+ OSL_ENSURE( !IsLocked(), "+SwTxtFrm::ClearPara: this is locked." );
if ( !IsLocked() && GetCacheIdx() != MSHRT_MAX )
{
SwTxtLine *pTxtLine = (SwTxtLine*)SwTxtFrm::GetTxtCache()->
@@ -202,9 +178,6 @@ void SwTxtFrm::ClearPara()
|*
|* SwTxtFrm::SetPara()
|*
-|* Ersterstellung MA 16. Mar. 94
-|* Letzte Aenderung MA 22. Aug. 94
-|*
|*************************************************************************/
void SwTxtFrm::SetPara( SwParaPortion *pNew, sal_Bool bDelete )
@@ -222,7 +195,7 @@ void SwTxtFrm::SetPara( SwParaPortion *pNew, sal_Bool bDelete )
}
else
{
- ASSERT( !pNew, "+SetPara: Losing SwParaPortion" );
+ OSL_ENSURE( !pNew, "+SetPara: Losing SwParaPortion" );
nCacheIdx = MSHRT_MAX;
}
}
@@ -233,9 +206,10 @@ void SwTxtFrm::SetPara( SwParaPortion *pNew, sal_Bool bDelete )
nCacheIdx = pTxtLine->GetCachePos();
else
{
- ASSERT( sal_False, "+SetPara: InsertCache failed." );
+ OSL_ENSURE( sal_False, "+SetPara: InsertCache failed." );
}
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtcache.hxx b/sw/source/core/text/txtcache.hxx
index d484f8f1c7f5..46276d5d9700 100644
--- a/sw/source/core/text/txtcache.hxx
+++ b/sw/source/core/text/txtcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,5 @@ inline SwTxtLine &SwTxtLineAccess::GetTxtLine()
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtcfg.hxx b/sw/source/core/text/txtcfg.hxx
deleted file mode 100644
index b72fbfb1bd47..000000000000
--- a/sw/source/core/text/txtcfg.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * 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 _TXTCFG_HXX
-#define _TXTCFG_HXX
-
-#if OSL_DEBUG_LEVEL > 1
-#include "dbgloop.hxx" // DBG_LOOP
-#else
-#ifdef DBG_LOOP //kann per precompiled hereinkommen
-#undef DBG_LOOP
-#undef DBG_LOOP_RESET
-#endif
-#define DBG_LOOP
-#define DBG_LOOP_RESET
-#endif
-
-// Toleranzwert in der Formatierung und Textausgabe.
-#define SLOPPY_TWIPS 5
-
-#define CONSTCHAR( name, string ) static const sal_Char __FAR_DATA name[] = string
-
-// Allgemeines ...
-
-#ifndef CONST
-#define CONST const
-#endif
-
-
-#endif
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 19d888153542..2012d2c221e8 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,9 +44,7 @@
#include <txtpaint.hxx> // SwSaveClip
#include <blink.hxx> // pBlink
#include <breakit.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <com/sun/star/i18n/WordType.hpp>
#include <editeng/langitem.hxx>
#include <charatr.hxx>
@@ -243,7 +242,7 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
if ( !((SwTxtFrm*)pLastFrm)->IsEmpty() )
{
const SwParaPortion* pPara = ((SwTxtFrm*)pLastFrm)->GetPara();
- ASSERT( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" )
+ OSL_ENSURE( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" );
if ( pPara )
{
@@ -294,7 +293,7 @@ void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const
!rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() )
rInf.DrawBackground( *this );
- ASSERT( nDropHeight && pPart && nLines != 1, "Drop Portion painted twice" );
+ OSL_ENSURE( nDropHeight && pPart && nLines != 1, "Drop Portion painted twice" );
const SwDropPortionPart* pCurrPart = GetPart();
const xub_StrLen nOldLen = GetLen();
@@ -528,7 +527,7 @@ void SwTxtFormatter::CalcDropHeight( const MSHORT nLines )
{
if( !Next() )
{
- ASSERT( !this, "SwTxtFormatter::_CalcDropHeight: left Toulouse" );
+ OSL_ENSURE( !this, "SwTxtFormatter::_CalcDropHeight: left Toulouse" );
break;
}
}
@@ -546,7 +545,7 @@ void SwTxtFormatter::CalcDropHeight( const MSHORT nLines )
void SwTxtFormatter::GuessDropHeight( const MSHORT nLines )
{
- ASSERT( nLines, "GuessDropHeight: Give me more Lines!" );
+ OSL_ENSURE( nLines, "GuessDropHeight: Give me more Lines!" );
KSHORT nAscent = 0;
KSHORT nHeight = 0;
SetDropLines( nLines );
@@ -607,7 +606,7 @@ SwDropPortion *SwTxtFormatter::NewDropPortion( SwTxtFormatInfo &rInf )
}
// build DropPortionParts:
- ASSERT( ! rInf.GetIdx(), "Drop Portion not at 0 position!" );
+ OSL_ENSURE( ! rInf.GetIdx(), "Drop Portion not at 0 position!" );
xub_StrLen nNextChg = 0;
const SwCharFmt* pFmt = pDropFmt->GetCharFmt();
SwDropPortionPart* pCurrPart = 0;
@@ -661,7 +660,7 @@ SwDropPortion *SwTxtFormatter::NewDropPortion( SwTxtFormatInfo &rInf )
void SwTxtPainter::PaintDropPortion()
{
const SwDropPortion *pDrop = GetInfo().GetParaPortion()->FindDropPortion();
- ASSERT( pDrop, "DrapCop-Portion not available." );
+ OSL_ENSURE( pDrop, "DrapCop-Portion not available." );
if( !pDrop )
return;
@@ -688,17 +687,6 @@ void SwTxtPainter::PaintDropPortion()
}
Point aLineOrigin( GetTopLeft() );
-#ifdef NIE
- // Retusche nachholen...
- if( nX )
- {
- const Point aPoint( Left(), Y() );
- const Size aSize( nX - 1, GetDropHeight()+GetDropDescent() );
- SwRect aRetouche( aPoint, aSize );
- GetInfo().DrawRect( aRetouche );
- }
-#endif
-
aLineOrigin.X() += nX;
KSHORT nTmpAscent, nTmpHeight;
CalcAscentAndHeight( nTmpAscent, nTmpHeight );
@@ -759,7 +747,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
const void* pFntNo = 0;
MSHORT nTmpIdx = 0;
- ASSERT( pDrop->GetPart(),"DropPortion without part during font calculation");
+ OSL_ENSURE( pDrop->GetPart(),"DropPortion without part during font calculation");
SwDropPortionPart* pCurrPart = pDrop->GetPart();
const sal_Bool bUseCache = ! pCurrPart->GetFollow();
@@ -1103,3 +1091,4 @@ sal_Bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
return bFull;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index b91436a72832..f99a2e334387 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,6 @@
#include "flyfrm.hxx" //IsInBody()
#include "viewimp.hxx"
#include "txtatr.hxx" // SwTxtFld
-#include "txtcfg.hxx"
#include "swfont.hxx" // NewFldPortion, new SwFont
#include "fntcache.hxx" // NewFldPortion, SwFntAccess
#include "porfld.hxx"
@@ -225,20 +225,6 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
{
SwDBField* pDBFld = (SwDBField*)pFld;
pDBFld->ChgBodyTxtFlag( ::lcl_IsInBody( pFrame ) );
-/* Solange das ChangeExpansion auskommentiert ist.
- * Aktualisieren in Kopf/Fuszeilen geht aktuell nicht.
- if( !::lcl_IsInBody( pFrame ) )
- {
- pDBFld->ChgBodyTxtFlag( sal_False );
- pDBFld->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
- }
- else if( !pDBFld->IsInBodyTxt() )
- {
- // war vorher anders, also erst expandieren, dann umsetzen!!
- pDBFld->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
- pDBFld->ChgBodyTxtFlag( sal_True );
- }
-*/
}
{
String const str( (bName)
@@ -373,9 +359,6 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
SwLinePortion *pRet = 0;
if( !pHint )
{
-#if OSL_DEBUG_LEVEL > 1
-// aDbstream << "NewExtraPortion: hint not found?" << endl;
-#endif
pRet = new SwTxtPortion;
pRet->SetLen( 1 );
rInf.SetLen( 1 );
@@ -418,9 +401,6 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
}
if( !pRet )
{
-#if OSL_DEBUG_LEVEL > 1
-// aDbstream << "NewExtraPortion: unknown hint" << endl;
-#endif
const XubString aNothing;
pRet = new SwFldPortion( aNothing );
rInf.SetLen( 1 );
@@ -449,16 +429,13 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
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#
const bool bLabelAlignmentPosAndSpaceModeActive(
rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT );
const KSHORT nMinDist = bLabelAlignmentPosAndSpaceModeActive
? 0 : rNumFmt.GetCharTextDistance();
- // <--
if( SVX_NUM_BITMAP == rNumFmt.GetNumberingType() )
{
- // --> OD 2008-01-23 #newlistlevelattrs#
pRet = new SwGrfNumPortion( (SwFrm*)GetTxtFrm(),
pTxtNd->GetLabelFollowedBy(),
rNumFmt.GetBrush(),
@@ -466,7 +443,6 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
rNumFmt.GetGraphicSize(),
bLeft, bCenter, nMinDist,
bLabelAlignmentPosAndSpaceModeActive );
- // <--
long nTmpA = rInf.GetLast()->GetAscent();
long nTmpD = rInf.GetLast()->Height() - nTmpA;
if( !rInf.IsTest() )
@@ -542,12 +518,10 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
else
{
XubString aTxt( pTxtNd->GetNumString() );
- // --> OD 2008-01-23 #newlistlevelattrs#
if ( aTxt.Len() > 0 )
{
aTxt.Insert( pTxtNd->GetLabelFollowedBy() );
}
- // <--
// 7974: Nicht nur eine Optimierung...
// Eine Numberportion ohne Text wird die Breite von 0
@@ -582,11 +556,9 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
// we do not allow a vertical font
pNumFnt->SetVertical( pNumFnt->GetOrientation(), pFrm->IsVertical() );
- // --> OD 2008-01-23 #newlistlevelattrs#
pRet = new SwNumberPortion( aTxt, pNumFnt,
bLeft, bCenter, nMinDist,
bLabelAlignmentPosAndSpaceModeActive );
- // <--
}
}
}
@@ -594,3 +566,4 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
return pRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 68283e988ca1..9b61ccf76d14 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,7 +50,6 @@
#include "txtfly.hxx" // SwTxtFly
#include "txtpaint.hxx" // SwSaveClip
#include "txtatr.hxx" // SwTxtFlyCnt
-#include "txtcfg.hxx"
#include "notxtfrm.hxx"
#include "flyfrms.hxx"
#include "fmtcnct.hxx" // SwFmtChain
@@ -73,22 +73,13 @@
#include <IDocumentDrawModelAccess.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentSettingAccess.hxx>
-#include <svx/obj3d.hxx>
-#include <editeng/txtrange.hxx>
-#include <editeng/lrspitem.hxx>
-#include <editeng/ulspitem.hxx>
-#include <editeng/lspcitem.hxx>
#include <svx/svdoedge.hxx>
#include "doc.hxx"
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2)
#endif
-#ifdef VERT_DISTANCE
-#include <math.h>
-#endif
-
using namespace ::com::sun::star;
@@ -128,8 +119,8 @@ using namespace ::com::sun::star;
void SwTxtFormatter::CalcUnclipped( SwTwips& rTop, SwTwips& rBottom )
{
- ASSERT( ! pFrm->IsVertical() || pFrm->IsSwapped(),
- "SwTxtFormatter::CalcUnclipped with unswapped frame" )
+ OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
+ "SwTxtFormatter::CalcUnclipped with unswapped frame" );
long nFlyAsc, nFlyDesc;
// OD 08.01.2004 #i11859# - use new method <SwLineLayout::MaxAscentDescent(..)>
@@ -149,8 +140,8 @@ void SwTxtFormatter::CalcUnclipped( SwTwips& rTop, SwTwips& rBottom )
void SwTxtFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
xub_StrLen nStartIdx, sal_Bool bAllWays ) const
{
- ASSERT( ! pFrm->IsVertical() || pFrm->IsSwapped(),
- "SwTxtFormatter::UpdatePos with unswapped frame" )
+ OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
+ "SwTxtFormatter::UpdatePos with unswapped frame" );
if( GetInfo().IsTest() )
return;
@@ -236,14 +227,14 @@ void SwTxtFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
}
if( pPos->IsMultiPortion() && ((SwMultiPortion*)pPos)->HasFlyInCntnt() )
{
- ASSERT( !GetMulti(), "Too much multi" );
+ OSL_ENSURE( !GetMulti(), "Too much multi" );
((SwTxtFormatter*)this)->pMulti = (SwMultiPortion*)pPos;
SwLineLayout *pLay = &GetMulti()->GetRoot();
Point aSt( aTmpInf.X(), aStart.Y() );
if ( GetMulti()->HasBrackets() )
{
- ASSERT( GetMulti()->IsDouble(), "Brackets only for doubles");
+ OSL_ENSURE( GetMulti()->IsDouble(), "Brackets only for doubles");
aSt.X() += ((SwDoubleLinePortion*)GetMulti())->PreWidth();
}
else if( GetMulti()->HasRotation() )
@@ -280,8 +271,8 @@ void SwTxtFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
void SwTxtFormatter::AlignFlyInCntBase( long nBaseLine ) const
{
- ASSERT( ! pFrm->IsVertical() || pFrm->IsSwapped(),
- "SwTxtFormatter::AlignFlyInCntBase with unswapped frame" )
+ OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
+ "SwTxtFormatter::AlignFlyInCntBase with unswapped frame" );
if( GetInfo().IsTest() )
return;
@@ -339,7 +330,7 @@ void SwTxtFormatter::AlignFlyInCntBase( long nBaseLine ) const
sal_Bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
{
- ASSERT( rInf.GetTxtFly()->IsOn(), "SwTxtFormatter::ChkFlyUnderflow: why?" );
+ OSL_ENSURE( rInf.GetTxtFly()->IsOn(), "SwTxtFormatter::ChkFlyUnderflow: why?" );
if( GetCurr() )
{
// Erst pruefen wir, ob ueberhaupt ein Fly mit der Zeile ueberlappt.
@@ -754,12 +745,9 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf,
SwTxtFly::SwTxtFly( const SwTxtFly& rTxtFly )
{
pPage = rTxtFly.pPage;
- // --> OD 2006-08-15 #i68520#
mpCurrAnchoredObj = rTxtFly.mpCurrAnchoredObj;
- // <--
pCurrFrm = rTxtFly.pCurrFrm;
pMaster = rTxtFly.pMaster;
- // --> OD 2006-08-15 #i68520#
if( rTxtFly.mpAnchoredObjList )
{
mpAnchoredObjList = new SwAnchoredObjList( *(rTxtFly.mpAnchoredObjList) );
@@ -768,11 +756,16 @@ SwTxtFly::SwTxtFly( const SwTxtFly& rTxtFly )
{
mpAnchoredObjList = NULL;
}
- // <--
bOn = rTxtFly.bOn;
bLeftSide = rTxtFly.bLeftSide;
bTopRule = rTxtFly.bTopRule;
+ nMinBottom = rTxtFly.nMinBottom;
+ nNextTop = rTxtFly.nNextTop;
+ nIndex = rTxtFly.nIndex;
+ mbIgnoreCurrentFrame = rTxtFly.mbIgnoreCurrentFrame;
+ mbIgnoreContour = rTxtFly.mbIgnoreContour;
+ mbIgnoreObjsInHeaderFooter = rTxtFly.mbIgnoreObjsInHeaderFooter;
}
void SwTxtFly::CtorInitTxtFly( const SwTxtFrm *pFrm )
@@ -847,7 +840,7 @@ sal_Bool SwTxtFly::IsAnyFrm() const
{
SWAP_IF_SWAPPED( pCurrFrm )
- ASSERT( bOn, "IsAnyFrm: Why?" );
+ OSL_ENSURE( bOn, "IsAnyFrm: Why?" );
SwRect aRect( pCurrFrm->Frm().Pos() + pCurrFrm->Prt().Pos(),
pCurrFrm->Prt().SSize() );
@@ -868,7 +861,7 @@ sal_Bool SwTxtFly::IsAnyFrm() const
sal_Bool SwTxtFly::IsAnyObj( const SwRect &rRect ) const
{
- ASSERT ( bOn, "SwTxtFly::IsAnyObj: Who's knocking?" );
+ OSL_ENSURE( bOn, "SwTxtFly::IsAnyObj: Who's knocking?" );
SwRect aRect( rRect );
if ( aRect.IsEmpty() )
@@ -955,7 +948,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
? mpCurrAnchoredObj->GetDrawObj()->GetOrdNum()
: SAL_MAX_UINT32;
// <--
- ASSERT( !bTopRule, "DrawTextOpaque: Wrong TopRule" );
+ OSL_ENSURE( !bTopRule, "DrawTextOpaque: Wrong TopRule" );
// --> OD 2006-08-15 #i68520#
SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
@@ -1061,7 +1054,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
const SwTxtPaintInfo &rInf, sal_Bool bNoGraphic )
{
SwRegionRects aRegion( rRect );
- ASSERT( !bTopRule, "DrawFlyRect: Wrong TopRule" );
+ OSL_ENSURE( !bTopRule, "DrawFlyRect: Wrong TopRule" );
// --> OD 2006-08-15 #i68520#
SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
if ( bOn && nCount > 0 )
@@ -1120,7 +1113,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
pOut->DrawRect( aRegion[i].SVRect() );
else
{
- ASSERT( ((SvxBrushItem*)-1) != rInf.GetBrushItem(),
+ OSL_ENSURE( ((SvxBrushItem*)-1) != rInf.GetBrushItem(),
"DrawRect: Uninitialized BrushItem!" );
::DrawGraphic( rInf.GetBrushItem(), pOut, rInf.GetBrushRect(),
aRegion[i] );
@@ -1270,7 +1263,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// --> OD 2004-10-06 #i26945#
const SwFmtAnchor& rNewA = _pAnchoredObj->GetFrmFmt().GetAnchor();
// <--
- ASSERT( FLY_AS_CHAR != rNewA.GetAnchorId(),
+ OSL_ENSURE( FLY_AS_CHAR != rNewA.GetAnchorId(),
"Don't call GetTop with a FlyInCntFrm" );
if (FLY_AT_PAGE == rNewA.GetAnchorId())
return sal_True; // Seitengebundenen wird immer ausgewichen.
@@ -1412,9 +1405,9 @@ struct AnchoredObjOrder
// --> OD 2006-08-15 #i68520#
SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
{
- ASSERT( pCurrFrm, "InitFlyList: No Frame, no FlyList" );
+ OSL_ENSURE( pCurrFrm, "InitFlyList: No Frame, no FlyList" );
// --> OD 2006-08-15 #i68520#
- ASSERT( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" );
+ OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" );
// <--
SWAP_IF_SWAPPED( pCurrFrm )
@@ -1673,7 +1666,7 @@ SwContourCache::~SwContourCache()
void SwContourCache::ClrObject( MSHORT nPos )
{
- ASSERT( pTextRanger[ nPos ], "ClrObject: Allready cleared. Good Bye!" );
+ OSL_ENSURE( pTextRanger[ nPos ], "ClrObject: Allready cleared. Good Bye!" );
nPntCnt -= pTextRanger[ nPos ]->GetPointCount();
delete pTextRanger[ nPos ];
--nObjCnt;
@@ -1803,7 +1796,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
delete pPolyPolygon;
// UPPER_LOWER_TEST
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const SwRootFrm* pTmpRootFrm = pFmt->getIDocumentLayoutAccess()->GetRootFrm();
if( pTmpRootFrm->GetCurrShell() )
{
@@ -1876,7 +1869,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
* SwContourCache::ShowContour()
* zeichnet die PolyPolygone des Caches zu Debugzwecken.
*************************************************************************/
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj,
const Color& rClosedColor, const Color& rOpenColor )
@@ -1898,7 +1891,6 @@ void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj,
pOut->SetLineColor( rClosedColor );
pOut->DrawPolygon( rPol );
}
-#if OSL_DEBUG_LEVEL > 1
static KSHORT nRadius = 0;
if( nRadius )
{
@@ -1918,7 +1910,6 @@ void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj,
}
}
}
-#endif
}
}
#endif
@@ -1927,7 +1918,7 @@ void SwContourCache::ShowContour( OutputDevice* pOut, const SdrObject* pObj,
* SwTxtFly::ShowContour()
* zeichnet die PolyPolygone des Caches zu Debugzwecken.
*************************************************************************/
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void SwTxtFly::ShowContour( OutputDevice* pOut )
{
@@ -2083,8 +2074,8 @@ void SwTxtFly::CalcRightMargin( SwRect &rFly,
const SwRect &rLine ) const
{
// Normalerweise ist der rechte Rand der rechte Rand der Printarea.
- ASSERT( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
- "SwTxtFly::CalcRightMargin with swapped frame" )
+ OSL_ENSURE( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
+ "SwTxtFly::CalcRightMargin with swapped frame" );
SWRECTFN( pCurrFrm )
// --> OD 2004-12-14 #118796# - correct determination of right of printing area
SwTwips nRight = (pCurrFrm->*fnRect->fnGetPrtRight)();
@@ -2187,8 +2178,8 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
SwAnchoredObjList::size_type nFlyPos,
const SwRect &rLine ) const
{
- ASSERT( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
- "SwTxtFly::CalcLeftMargin with swapped frame" )
+ OSL_ENSURE( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
+ "SwTxtFly::CalcLeftMargin with swapped frame" );
SWRECTFN( pCurrFrm )
// --> OD 2004-12-14 #118796# - correct determination of left of printing area
SwTwips nLeft = (pCurrFrm->*fnRect->fnGetPrtLeft)();
@@ -2422,9 +2413,11 @@ sal_Bool SwTxtFly::IsAnyFrm( const SwRect &rLine ) const
SWAP_IF_SWAPPED( pCurrFrm )
- ASSERT( bOn, "IsAnyFrm: Why?" );
+ OSL_ENSURE( bOn, "IsAnyFrm: Why?" );
const sal_Bool bRet = ForEach( rLine, NULL, sal_False );
UNDO_SWAP( pCurrFrm )
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtfly.hxx b/sw/source/core/text/txtfly.hxx
index 6bfb4e9afa0e..5372c5d9bc9f 100644
--- a/sw/source/core/text/txtfly.hxx
+++ b/sw/source/core/text/txtfly.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,20 +41,12 @@ class SwTxtPaintInfo;
class SwFmt;
class TextRanger;
class Color;
-// --> OD 2004-10-06 #i26945#
class SwAnchoredObject;
-// <--
-// --> OD 2006-08-15 #i68520# - refactoring
-//typedef MSHORT _FlyCntnt;
#include <fmtsrndenum.hxx>
-// <--
-// --> OD 2006-08-15 #i68520#
-//SV_DECL_PTRARR( SwFlyList, SdrObject*, 10, 10 )
#include <vector>
typedef std::vector< SwAnchoredObject* > SwAnchoredObjList;
-// <--
/*************************************************************************
* class SwFlyIter
@@ -89,17 +82,15 @@ class SwContourCache
public:
SwContourCache();
~SwContourCache();
- const SdrObject* GetObject( MSHORT nPos ){ return pSdrObj[ nPos ]; }
+ const SdrObject* GetObject( MSHORT nPos ) const{ return pSdrObj[ nPos ]; }
MSHORT GetCount() const { return nObjCnt; }
void ClrObject( MSHORT nPos );
- // --> OD 2006-08-15 #i68520#
static const SwRect CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine,
const SwTxtFrm* pFrm,
const long nXPos,
const sal_Bool bRight );
- // <--
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void ShowContour( OutputDevice* pOut, const SdrObject* pObj,
const Color& rClosedColor, const Color& rOpenColor );
#endif
@@ -112,17 +103,10 @@ public:
class SwTxtFly
{
const SwPageFrm *pPage;
- // --> OD 2006-08-15 #i68520#
const SwAnchoredObject* mpCurrAnchoredObj;
- // <--
-
const SwTxtFrm *pCurrFrm;
-
const SwCntntFrm *pMaster;
- // --> OD 2006-08-15 #i68520#
SwAnchoredObjList* mpAnchoredObjList;
- // <--
-
long nMinBottom;
long nNextTop; // Hier wird die Oberkante des "naechsten" Rahmens gespeichert
sal_uLong nIndex;
@@ -131,12 +115,10 @@ class SwTxtFly
sal_Bool bTopRule: 1;
sal_Bool mbIgnoreCurrentFrame: 1;
sal_Bool mbIgnoreContour: 1;
- // --> OD 2004-12-17 #118809# - boolean, indicating if objects in page
- // header|footer are considered for text frames not in page header|footer.
+ // boolean, indicating if objects in page header|footer are considered for
+ // text frames not in page header|footer.
sal_Bool mbIgnoreObjsInHeaderFooter: 1;
- // <--
SwRect _GetFrm( const SwRect &rPortion, sal_Bool bTop ) const;
- // --> OD 2006-08-15 #i68520#
SwAnchoredObjList* InitAnchoredObjList();
inline SwAnchoredObjList* GetAnchoredObjList() const
{
@@ -154,37 +136,20 @@ class SwTxtFly
SwAnchoredObjList::size_type nPos,
const SwRect &rLine ) const;
SwAnchoredObjList::size_type GetPos( const SwAnchoredObject* pAnchoredObj ) const;
- // <--
- // --> OD 2004-10-06 #i26945# - change first parameter:
- // Now it's the <SwAnchoredObject> instance of the floating screen object
sal_Bool GetTop( const SwAnchoredObject* _pAnchoredObj,
const sal_Bool bInFtn,
const sal_Bool bInFooterOrHeader );
- // <--
SwTwips CalcMinBottom() const;
const SwCntntFrm* _GetMaster();
public:
- inline SwTxtFly()
- {
- mbIgnoreCurrentFrame = sal_False;
- mbIgnoreCurrentFrame = sal_False;
- // --> OD 2004-12-17 #118809#
- mbIgnoreObjsInHeaderFooter = sal_False;
- // <--
- // --> OD 2006-08-15 #i68520#
- mpCurrAnchoredObj = 0;
- mpAnchoredObjList = 0;
- // <--
- pMaster = 0;
- }
+ inline SwTxtFly() : pPage(0), mpCurrAnchoredObj(0), pCurrFrm(0), pMaster(0), mpAnchoredObjList(0), nMinBottom(0), nNextTop(0),
+ nIndex(0) {}
inline SwTxtFly( const SwTxtFrm *pFrm )
{ CtorInitTxtFly( pFrm ); }
SwTxtFly( const SwTxtFly& rTxtFly );
- // --> OD 2006-08-15 #i68520#
inline ~SwTxtFly() { delete mpAnchoredObjList; }
- // <--
void CtorInitTxtFly( const SwTxtFrm *pFrm );
void SetTopRule(){ bTopRule = sal_False; }
@@ -193,9 +158,7 @@ public:
inline sal_Bool Relax( const SwRect &rRect );
inline sal_Bool Relax();
inline SwTwips GetMinBottom() const
- // --> OD 2006-08-15 #i68520#
{ return mpAnchoredObjList ? nMinBottom : CalcMinBottom(); }
- // <--
inline const SwCntntFrm* GetMaster() const
{ return pMaster ? pMaster : ((SwTxtFly*)this)->_GetMaster(); }
inline long GetNextTop() const { return nNextTop; }
@@ -203,12 +166,10 @@ public:
inline void SetNextTop( long nNew ) const
{ ((SwTxtFly*)this)->nNextTop = nNew; }
- // --> OD 2006-08-15 #i68520#
// determines the demanded rectangle for an anchored object,
// considering its surround for text wrapping.
SwRect AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
const SwRect& rRect ) const;
- // <--
// Die Drawmethoden stellen sicher, dass ueberlappende Frames
// (ausser bei transparenten Frames) nicht uebergepinselt werden.
@@ -225,14 +186,12 @@ public:
void SetIgnoreCurrentFrame( sal_Bool bNew ) { mbIgnoreCurrentFrame = bNew; }
void SetIgnoreContour( sal_Bool bNew ) { mbIgnoreContour = bNew; }
- // --> OD 2004-12-17 #118809#
inline void SetIgnoreObjsInHeaderFooter( const sal_Bool _bNew )
{
mbIgnoreObjsInHeaderFooter = _bNew;
}
- // <--
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
void ShowContour( OutputDevice* pOut );
#endif
};
@@ -257,3 +216,5 @@ inline SwRect SwTxtFly::GetFrm( const SwRect &rRect, sal_Bool bTop ) const
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 25b425df729c..29483f3e249e 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,7 +66,6 @@
#include <fmtline.hxx>
#include <txtfrm.hxx> // SwTxtFrm
#include <sectfrm.hxx> // SwSectFrm
-#include <txtcfg.hxx> // DBG_LOOP
#include <itrform2.hxx> // Iteratoren
#include <widorp.hxx> // SwFrmBreak
#include <txtcache.hxx>
@@ -82,9 +82,7 @@
#include <fmtflcnt.hxx> // SwFmtFlyCnt
#include <fmtcntnt.hxx> // SwFmtCntnt
// <--
-// --> OD 2008-01-31 #newlistlevelattrs#
#include <numrule.hxx>
-// <--
#include <swtable.hxx>
#include <fldupde.hxx>
#include <IGrammarContact.hxx>
@@ -356,7 +354,7 @@ SwDigitModeModifier::~SwDigitModeModifier()
void SwTxtFrm::Init()
{
- ASSERT( !IsLocked(), "+SwTxtFrm::Init: this ist locked." );
+ OSL_ENSURE( !IsLocked(), "+SwTxtFrm::Init: this ist locked." );
if( !IsLocked() )
{
ClearPara();
@@ -383,9 +381,7 @@ void SwTxtFrm::InitCtor()
mnFtnLine = 0;
// OD 2004-03-17 #i11860#
mnHeightOfLastLine = 0;
- // --> OD 2008-01-31 #newlistlevelattrs#
mnAdditionalFirstLineOffset = 0;
- // <--
nType = FRMC_TXT;
bLocked = bFormatted = bWidow = bUndersized = bJustWidow =
@@ -438,7 +434,7 @@ sal_Bool SwTxtFrm::IsHiddenNow() const
if( !Frm().Width() && IsValid() && GetUpper()->IsValid() )
//bei Stackueberlauf (StackHack) invalid!
{
-// ASSERT( false, "SwTxtFrm::IsHiddenNow: thin frame" );
+// OSL_ENSURE( false, "SwTxtFrm::IsHiddenNow: thin frame" );
return sal_True;
}
@@ -470,7 +466,7 @@ sal_Bool SwTxtFrm::IsHiddenNow() const
void SwTxtFrm::HideHidden()
{
- ASSERT( !GetFollow() && IsHiddenNow(),
+ OSL_ENSURE( !GetFollow() && IsHiddenNow(),
"HideHidden on visible frame of hidden frame has follow" );
const xub_StrLen nEnd = STRING_LEN;
@@ -650,7 +646,7 @@ void SwTxtFrm::HideAndShowObjects()
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwTxtFrm::HideAndShowObjects()> - object not anchored at/inside paragraph!?" );
}
}
@@ -783,8 +779,8 @@ void SwTxtFrm::_InvalidateRange( const SwCharRange &aRange, const long nD)
void SwTxtFrm::CalcLineSpace()
{
- ASSERT( ! IsVertical() || ! IsSwapped(),
- "SwTxtFrm::CalcLineSpace with swapped frame!" )
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
+ "SwTxtFrm::CalcLineSpace with swapped frame!" );
if( IsLocked() || !HasPara() )
return;
@@ -1425,7 +1421,7 @@ sal_Bool SwTxtFrm::GetInfo( SfxPoolItem &rHnt ) const
void SwTxtFrm::PrepWidows( const MSHORT nNeed, sal_Bool bNotify )
{
- ASSERT(GetFollow() && nNeed, "+SwTxtFrm::Prepare: lost all friends");
+ OSL_ENSURE(GetFollow() && nNeed, "+SwTxtFrm::Prepare: lost all friends");
SwParaPortion *pPara = GetPara();
if ( !pPara )
@@ -1579,7 +1575,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( !HasPara() && PREP_MUST_FIT != ePrep )
{
SetInvalidVert( sal_True ); // Test
- ASSERT( !IsLocked(), "SwTxtFrm::Prepare: three of a perfect pair" );
+ OSL_ENSURE( !IsLocked(), "SwTxtFrm::Prepare: three of a perfect pair" );
if ( bNotify )
InvalidateSize();
else
@@ -1822,7 +1818,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
// letzte Zeile formatiert werden, damit ggf. die erste Zeile des Follows
// hochrutschen kann, die extra auf die naechste Seite gerutscht war, um mit
// der Fussnote zusammen zu sein, insbesondere bei spaltigen Bereichen.
- ASSERT( GetFollow(), "PREP_FTN_GONE darf nur vom Follow gerufen werden" );
+ OSL_ENSURE( GetFollow(), "PREP_FTN_GONE darf nur vom Follow gerufen werden" );
xub_StrLen nPos = GetFollow()->GetOfst();
if( IsFollow() && GetOfst() == nPos ) // falls wir gar keine Textmasse besitzen,
FindMaster()->Prepare( PREP_FTN_GONE ); // rufen wir das Prepare unseres Masters
@@ -1844,7 +1840,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( pVoid )
{
xub_StrLen nWhere = CalcFlyPos( (SwFrmFmt*)pVoid );
- ASSERT( STRING_LEN != nWhere, "Prepare: Why me?" );
+ OSL_ENSURE( STRING_LEN != nWhere, "Prepare: Why me?" );
InvalidateRange( SwCharRange( nWhere, 1 ) );
return;
}
@@ -1882,7 +1878,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
pPara->SetPrep( sal_True );
}
-/* -----------------11.02.99 17:56-------------------
+/* --------------------------------------------------
* Kleine Hilfsklasse mit folgender Funktion:
* Sie soll eine Probeformatierung vorbereiten.
* Der Frame wird in Groesse und Position angepasst, sein SwParaPortion zur Seite
@@ -1938,7 +1934,7 @@ SwTestFormat::SwTestFormat( SwTxtFrm* pTxtFrm, const SwFrm* pPre, SwTwips nMaxHe
pOldPara = pFrm->HasPara() ? pFrm->GetPara() : NULL;
pFrm->SetPara( new SwParaPortion(), sal_False );
- ASSERT( ! pFrm->IsSwapped(), "A frame is swapped before _Format" );
+ OSL_ENSURE( ! pFrm->IsSwapped(), "A frame is swapped before _Format" );
if ( pFrm->IsVertical() )
pFrm->SwapWidthAndHeight();
@@ -1951,7 +1947,7 @@ SwTestFormat::SwTestFormat( SwTxtFrm* pTxtFrm, const SwFrm* pPre, SwTwips nMaxHe
if ( pFrm->IsVertical() )
pFrm->SwapWidthAndHeight();
- ASSERT( ! pFrm->IsSwapped(), "A frame is swapped after _Format" );
+ OSL_ENSURE( ! pFrm->IsSwapped(), "A frame is swapped after _Format" );
}
SwTestFormat::~SwTestFormat()
@@ -1991,7 +1987,7 @@ sal_Bool SwTxtFrm::TestFormat( const SwFrm* pPrv, SwTwips &rMaxHeight, sal_Bool
sal_Bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, sal_Bool &bSplit, sal_Bool bTst )
{
- ASSERT( ! IsVertical() || ! IsSwapped(),
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
"SwTxtFrm::WouldFit with swapped frame" );
SWRECTFN( this );
@@ -2023,7 +2019,7 @@ sal_Bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, sal_Bool &bSplit, sal_Bool bTs
// In sehr unguenstigen Faellen kann GetPara immer noch 0 sein.
// Dann returnen wir sal_True, um auf der neuen Seite noch einmal
// anformatiert zu werden.
- ASSERT( HasPara() || IsHiddenNow(), "WouldFit: GetFormatted() and then !HasPara()" );
+ OSL_ENSURE( HasPara() || IsHiddenNow(), "WouldFit: GetFormatted() and then !HasPara()" );
if( !HasPara() || ( !(Frm().*fnRect->fnGetHeight)() && IsHiddenNow() ) )
return sal_True;
@@ -2097,8 +2093,8 @@ sal_Bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, sal_Bool &bSplit, sal_Bool bTs
KSHORT SwTxtFrm::GetParHeight() const
{
- ASSERT( ! IsVertical() || ! IsSwapped(),
- "SwTxtFrm::GetParHeight with swapped frame" )
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
+ "SwTxtFrm::GetParHeight with swapped frame" );
if( !HasPara() )
{ // Fuer nichtleere Absaetze ist dies ein Sonderfall, da koennen wir
@@ -2225,8 +2221,6 @@ SwTwips SwTxtFrm::CalcFitToContent()
line offset for the real text formatting due to the value of label
adjustment attribute of the list level.
- OD 2008-01-31 #newlistlevelattrs#
-
@author OD
*/
void SwTxtFrm::CalcAdditionalFirstLineOffset()
@@ -2315,7 +2309,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
// <--
// determine output device
ViewShell* pVsh = GetShell();
- ASSERT( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no ViewShell" );
+ OSL_ENSURE( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no ViewShell" );
// --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
// There could be no <ViewShell> instance in the case of loading a binary
// StarOffice file format containing an embedded Writer document.
@@ -2330,7 +2324,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
{
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
}
- ASSERT( pOut, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no OutputDevice" );
+ OSL_ENSURE( pOut, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no OutputDevice" );
// --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
if ( !pOut )
{
@@ -2393,7 +2387,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
if ( bCalcHeightOfLastLine )
{
- ASSERT( HasPara(),
+ OSL_ENSURE( HasPara(),
"<SwTxtFrm::_CalcHeightOfLastLine()> - missing paragraph portions." );
const SwLineLayout* pLineLayout = GetPara();
while ( pLineLayout && pLineLayout->GetNext() )
@@ -2753,8 +2747,8 @@ SwTwips lcl_CalcFlyBasePos( const SwTxtFrm& rFrm, SwRect aFlyRect,
void SwTxtFrm::CalcBaseOfstForFly()
{
- ASSERT( !IsVertical() || !IsSwapped(),
- "SwTxtFrm::CalcBasePosForFly with swapped frame!" )
+ OSL_ENSURE( !IsVertical() || !IsSwapped(),
+ "SwTxtFrm::CalcBasePosForFly with swapped frame!" );
const SwNode* pNode = GetTxtNode();
if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::ADD_FLY_OFFSETS) )
@@ -2802,3 +2796,5 @@ void SwTxtFrm::CalcBaseOfstForFly()
mnFlyAnchorOfst = nRet1 - nLeft;
mnFlyAnchorOfstNoWrap = nRet2 - nLeft;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index d6a0ce1dc6d0..5f474354be45 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,14 +44,11 @@
#include <editeng/brshitem.hxx>
#include <editeng/charrotateitem.hxx>
#include <breakit.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <tabfrm.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-#include "txtcfg.hxx"
#include "swfont.hxx" // new SwFont
#include "porftn.hxx"
#include "porfly.hxx"
@@ -103,10 +101,10 @@ SwTxtFrm *SwTxtFrm::FindFtnRef( const SwTxtFtn *pFtn )
* CalcFtnFlag()
*************************************************************************/
-#ifndef DBG_UTIL
-void SwTxtFrm::CalcFtnFlag()
+#if OSL_DEBUG_LEVEL > 1
+void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//For testing the SplitFrm
#else
-void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm
+void SwTxtFrm::CalcFtnFlag()
#endif
{
bFtn = sal_False;
@@ -117,11 +115,11 @@ void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm
const sal_uInt16 nSize = pHints->Count();
-#ifndef DBG_UTIL
- const xub_StrLen nEnd = GetFollow() ? GetFollow()->GetOfst() : STRING_LEN;
-#else
+#if OSL_DEBUG_LEVEL > 1
const xub_StrLen nEnd = nStop != STRING_LEN ? nStop
: GetFollow() ? GetFollow()->GetOfst() : STRING_LEN;
+#else
+ const xub_StrLen nEnd = GetFollow() ? GetFollow()->GetOfst() : STRING_LEN;
#endif
for ( sal_uInt16 i = 0; i < nSize; ++i )
@@ -147,7 +145,7 @@ void SwTxtFrm::CalcFtnFlag( xub_StrLen nStop )//Fuer den Test von SplitFrm
sal_Bool SwTxtFrm::CalcPrepFtnAdjust()
{
- ASSERT( HasFtn(), "Wer ruft mich da?" );
+ OSL_ENSURE( HasFtn(), "Wer ruft mich da?" );
SwFtnBossFrm *pBoss = FindFtnBossFrm( sal_True );
const SwFtnFrm *pFtn = pBoss->FindFirstFtn( this );
if( pFtn && FTNPOS_CHAPTER != GetNode()->GetDoc()->GetFtnInfo().ePos &&
@@ -196,7 +194,7 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
// containing the footnote.
SWRECTFN( pFrm )
- ASSERT( !pFrm->IsVertical() || !pFrm->IsSwapped(),
+ OSL_ENSURE( !pFrm->IsVertical() || !pFrm->IsSwapped(),
"lcl_GetFtnLower with swapped frame" );
SwTwips nAdd;
@@ -222,8 +220,8 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
pRow = pRow->GetUpper();
const SwTabFrm* pTabFrm = (SwTabFrm*)pRow->GetUpper();
- ASSERT( pTabFrm && pRow &&
- pRow->GetUpper()->IsTabFrm(), "Upper of row should be tab" )
+ OSL_ENSURE( pTabFrm && pRow &&
+ pRow->GetUpper()->IsTabFrm(), "Upper of row should be tab" );
const sal_Bool bDontSplit = !pTabFrm->IsFollow() &&
!pTabFrm->IsLayoutSplitAllowed();
@@ -253,11 +251,11 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
// #i10770#: If there are fly frames anchored at previous paragraphs,
// the deadline should consider their lower borders.
const SwFrm* pStartFrm = pFrm->GetUpper()->GetLower();
- ASSERT( pStartFrm, "Upper has no lower" )
+ OSL_ENSURE( pStartFrm, "Upper has no lower" );
SwTwips nFlyLower = bVert ? LONG_MAX : 0;
while ( pStartFrm != pFrm )
{
- ASSERT( pStartFrm, "Frame chain is broken" )
+ OSL_ENSURE( pStartFrm, "Frame chain is broken" );
if ( pStartFrm->GetDrawObjs() )
{
const SwSortedObjs &rObjs = *pStartFrm->GetDrawObjs();
@@ -294,8 +292,8 @@ SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower )
SwTwips SwTxtFrm::GetFtnLine( const SwTxtFtn *pFtn ) const
{
- ASSERT( ! IsVertical() || ! IsSwapped(),
- "SwTxtFrm::GetFtnLine with swapped frame" )
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
+ "SwTxtFrm::GetFtnLine with swapped frame" );
SwTxtFrm *pThis = (SwTxtFrm*)this;
@@ -337,7 +335,7 @@ SwTwips SwTxtFrm::GetFtnLine( const SwTxtFtn *pFtn ) const
SwTwips SwTxtFrm::_GetFtnFrmHeight() const
{
- ASSERT( !IsFollow() && IsInFtn(), "SwTxtFrm::SetFtnLine: moon walk" );
+ OSL_ENSURE( !IsFollow() && IsInFtn(), "SwTxtFrm::SetFtnLine: moon walk" );
const SwFtnFrm *pFtnFrm = FindFtnFrm();
const SwTxtFrm *pRef = (const SwTxtFrm *)pFtnFrm->GetRef();
@@ -361,7 +359,7 @@ SwTwips SwTxtFrm::_GetFtnFrmHeight() const
SwTwips nTmp = (*fnRect->fnYDiff)( (pCont->*fnRect->fnGetPrtBottom)(),
(Frm().*fnRect->fnGetTop)() );
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( nTmp < 0 )
{
sal_Bool bInvalidPos = sal_False;
@@ -374,7 +372,7 @@ SwTwips SwTxtFrm::_GetFtnFrmHeight() const
break;
pTmp = pTmp->GetUpper();
}
- ASSERT( bInvalidPos, "Hanging below FtnCont" );
+ OSL_ENSURE( bInvalidPos, "Hanging below FtnCont" );
}
#endif
@@ -511,7 +509,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
// Wir loeschen nicht, sondern wollen die Ftn verschieben.
// Drei Faelle koennen auftreten:
// 1) Es gibt weder Follow noch PrevFollow
- // -> RemoveFtn() (vielleicht sogar ein ASSERT wert)
+ // -> RemoveFtn() (vielleicht sogar ein OSL_ENSURE(wert)
// 2) nStart > GetOfst, ich habe einen Follow
// -> Ftn wandert in den Follow
// 3) nStart < GetOfst, ich bin ein Follow
@@ -539,7 +537,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
while( pDest->GetFollow() && ((SwTxtFrm*)pDest->
GetFollow())->GetOfst() <= nIdx )
pDest = pDest->GetFollow();
- ASSERT( !pDest->FindFtnBossFrm( !bEndn )->FindFtn(
+ OSL_ENSURE( !pDest->FindFtnBossFrm( !bEndn )->FindFtn(
pDest,pFtn),"SwTxtFrm::RemoveFtn: footnote exists");
//Nicht ummelden sondern immer Moven.
@@ -568,7 +566,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
}
((SwTxtFrm*)pDest)->SetFtn( sal_True );
- ASSERT( pDest->FindFtnBossFrm( !bEndn )->FindFtn( pDest,
+ OSL_ENSURE( pDest->FindFtnBossFrm( !bEndn )->FindFtn( pDest,
pFtn),"SwTxtFrm::RemoveFtn: footnote ChgRef failed");
}
else
@@ -582,7 +580,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
else
pFtnBoss->RemoveFtn( this, pFtn );
bRemove = bRemove || !bEndDoc;
- ASSERT( bEndn ? !pEndBoss->FindFtn( this, pFtn ) :
+ OSL_ENSURE( bEndn ? !pEndBoss->FindFtn( this, pFtn ) :
!pFtnBoss->FindFtn( this, pFtn ),
"SwTxtFrm::RemoveFtn: can't get off that footnote" );
}
@@ -632,7 +630,7 @@ void SwTxtFrm::RemoveFtn( const xub_StrLen nStart, const xub_StrLen nLen )
void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
{
- ASSERT( !IsVertical() || !IsSwapped(),
+ OSL_ENSURE( !IsVertical() || !IsSwapped(),
"SwTxtFrm::ConnectFtn with swapped frame" );
bFtn = sal_True;
@@ -850,7 +848,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
SwFtnPortion *SwTxtFormatter::NewFtnPortion( SwTxtFormatInfo &rInf,
SwTxtAttr *pHint )
{
- ASSERT( ! pFrm->IsVertical() || pFrm->IsSwapped(),
+ OSL_ENSURE( ! pFrm->IsVertical() || pFrm->IsSwapped(),
"NewFtnPortion with unswapped frame" );
if( !pFrm->IsFtnAllowed() )
@@ -997,7 +995,7 @@ SwFtnPortion *SwTxtFormatter::NewFtnPortion( SwTxtFormatInfo &rInf,
SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
{
- ASSERT( pFrm->IsInFtn() && !pFrm->GetIndPrev() && !rInf.IsFtnDone(),
+ OSL_ENSURE( pFrm->IsInFtn() && !pFrm->GetIndPrev() && !rInf.IsFtnDone(),
"This is the wrong place for a ftnnumber" );
if( rInf.GetTxtStart() != nStart ||
rInf.GetTxtStart() != rInf.GetIdx() )
@@ -1053,7 +1051,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
XubString lcl_GetPageNumber( const SwPageFrm* pPage )
{
- ASSERT( pPage, "GetPageNumber: Homeless TxtFrm" );
+ OSL_ENSURE( pPage, "GetPageNumber: Homeless TxtFrm" );
MSHORT nVirtNum = pPage->GetVirtPageNum();
const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType();
return rNum.GetNumStr( nVirtNum );
@@ -1094,7 +1092,7 @@ SwErgoSumPortion *SwTxtFormatter::NewErgoSumPortion( SwTxtFormatInfo &rInf ) con
xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
{
- ASSERT( ! pFrm->IsVertical() || ! pFrm->IsSwapped(),
+ OSL_ENSURE( ! pFrm->IsVertical() || ! pFrm->IsSwapped(),
"SwTxtFormatter::FormatQuoVadis with swapped frame" );
if( !pFrm->IsInFtn() || pFrm->ImplFindFtnFrm()->GetAttr()->GetFtn().IsEndNote() )
@@ -1168,8 +1166,8 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
rInf.SetRest( 0 );
pCurrPor->Move( rInf );
- ASSERT( pFollow->IsQuoVadisPortion(),
- "Quo Vadis, rest of QuoVadisPortion" )
+ OSL_ENSURE( pFollow->IsQuoVadisPortion(),
+ "Quo Vadis, rest of QuoVadisPortion" );
// format the rest and append it to the other QuoVadis parts
pFollow->Format( rInf );
@@ -1651,7 +1649,6 @@ void SwParaPortion::SetErgoSumNum( const XubString& rErgo )
SwLineLayout *pLay = this;
while( pLay->GetNext() )
{
- DBG_LOOP;
pLay = pLay->GetNext();
}
SwLinePortion *pPor = pLay;
@@ -1677,7 +1674,6 @@ sal_Bool SwParaPortion::UpdateQuoVadis( const XubString &rQuo )
SwLineLayout *pLay = this;
while( pLay->GetNext() )
{
- DBG_LOOP;
pLay = pLay->GetNext();
}
SwLinePortion *pPor = pLay;
@@ -1697,3 +1693,4 @@ sal_Bool SwParaPortion::UpdateQuoVadis( const XubString &rQuo )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index ab1e9e96b3d3..962b28a8d23e 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,8 +36,6 @@
#include <EnhancedPDFExportHelper.hxx>
#include <viewopt.hxx> // SwViewOptions
#include <viewsh.hxx>
-#include <errhdl.hxx>
-#include <txtcfg.hxx>
#include <SwPortionHandler.hxx>
#include <porhyph.hxx> //
#include <inftxt.hxx>
@@ -44,7 +43,7 @@
#include <guess.hxx> //
#include <splargs.hxx> // SwInterHyphInfo
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
extern const sal_Char *GetLangName( const MSHORT nLang );
#endif
@@ -64,7 +63,6 @@ Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord(
{
if( rTxt.Len() < 4 || pFnt->IsSymbol(pVsh) )
return 0;
-// ASSERT( IsHyphenate(), "SwTxtFormatter::HyphWord: why?" );
Reference< XHyphenator > xHyph = ::GetHyphenator();
Reference< XHyphenatedWord > xHyphWord;
@@ -84,12 +82,12 @@ Reference< XHyphenatedWord > SwTxtFormatInfo::HyphWord(
sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
{
- ASSERT( ! IsVertical() || ! IsSwapped(),"swapped frame at SwTxtFrm::Hyphenate" );
+ OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"swapped frame at SwTxtFrm::Hyphenate" );
if( !pBreakIt->GetBreakIter().is() )
return sal_False;;
// Wir machen den Laden erstmal dicht:
- ASSERT( !IsLocked(), "SwTxtFrm::Hyphenate: this is locked" );
+ OSL_ENSURE( !IsLocked(), "SwTxtFrm::Hyphenate: this is locked" );
// 4935: Der frame::Frame muss eine gueltige SSize haben!
Calc();
GetFormatted();
@@ -123,7 +121,6 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
const xub_StrLen nEnd = rHyphInf.GetEnd();
while( !bRet && aLine.GetStart() < nEnd )
{
- DBG_LOOP;
bRet = aLine.Hyphenate( rHyphInf );
if( !aLine.Next() )
break;
@@ -148,7 +145,7 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
void SetParaPortion( SwTxtInfo *pInf, SwParaPortion *pRoot )
{
- ASSERT( pRoot, "SetParaPortion: no root anymore" );
+ OSL_ENSURE( pRoot, "SetParaPortion: no root anymore" );
pInf->pPara = pRoot;
}
@@ -181,7 +178,7 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
SwParaPortion *pPara = new SwParaPortion();
SetParaPortion( &rInf, pPara );
pCurr = pPara;
- ASSERT( IsParaLine(), "SwTxtFormatter::Hyphenate: not the first" );
+ OSL_ENSURE( IsParaLine(), "SwTxtFormatter::Hyphenate: not the first" );
}
else
pCurr = new SwLineLayout();
@@ -234,7 +231,7 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
if( pOldCurr->IsParaPortion() )
{
SetParaPortion( &rInf, (SwParaPortion*)pOldCurr );
- ASSERT( IsParaLine(), "SwTxtFormatter::Hyphenate: even not the first" );
+ OSL_ENSURE( IsParaLine(), "SwTxtFormatter::Hyphenate: even not the first" );
}
if( nWrdStart )
@@ -259,22 +256,6 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
if( bRet )
{
XubString aSelTxt( rInf.GetTxt().Copy(nWrdStart, nLen) );
- xub_StrLen nCnt = 0;
-
-// these things should be handled by the dialog
-// for( xub_StrLen i = 0; i < nLen; ++i )
-// {
-// sal_Unicode cCh = aSelTxt.GetChar(i);
-// if( (CH_TXTATR_BREAKWORD == cCh || CH_TXTATR_INWORD == cCh )
-// && rInf.HasHint( nWrdStart + i ) )
-// {
-// aSelTxt.Erase( i , 1 );
-// nCnt++;
-// --nLen;
-// if( i )
-// --i;
-// }
-// }
{
MSHORT nMinTrail = 0;
@@ -292,21 +273,10 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
{
rHyphInf.SetHyphWord( xHyphWord );
rHyphInf.nWordStart = nWrdStart;
- rHyphInf.nWordLen = nLen+nCnt;
+ rHyphInf.nWordLen = nLen;
rHyphInf.SetNoLang( sal_False );
rHyphInf.SetCheck( sal_True );
}
-#ifdef DEBUGGY
- if( OPTDBG( rInf ) )
- {
- ASSERT( aSelTxt == aHyphWord,
- "!SwTxtFormatter::Hyphenate: different words, different planets" );
- aDbstream << "Diff: \"" << aSelTxt.GetStr() << "\" != \""
- << aHyphWord.GetStr() << "\"" << endl;
- ASSERT( bRet, "!SwTxtFormatter::Hyphenate: three of a perfect pair" );
- aDbstream << "Hyphenate: ";
- }
-#endif
}
}
return bRet;
@@ -320,8 +290,8 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
{
Reference< XHyphenatedWord > xHyphWord = rGuess.HyphWord();
- ASSERT( !pPortion, "SwTxtPortion::CreateHyphen(): another portion, another planet..." )
- ASSERT( xHyphWord.is(), "SwTxtPortion::CreateHyphen(): You are lucky! The code is robust here." )
+ OSL_ENSURE( !pPortion, "SwTxtPortion::CreateHyphen(): another portion, another planet..." );
+ OSL_ENSURE( xHyphWord.is(), "SwTxtPortion::CreateHyphen(): You are lucky! The code is robust here." );
if( rInf.IsHyphForbud() ||
pPortion || // robust
@@ -339,7 +309,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
{
SvxAlternativeSpelling aAltSpell;
aAltSpell = SvxGetAltSpelling( xHyphWord );
- ASSERT( aAltSpell.bIsAltSpelling, "no alternatve spelling" );
+ OSL_ENSURE( aAltSpell.bIsAltSpelling, "no alternatve spelling" );
XubString aAltTxt = aAltSpell.aReplacement;
nPorEnd = aAltSpell.nChangedPos + rGuess.BreakStart() - rGuess.FieldDiff();
@@ -693,3 +663,4 @@ SwSoftHyphStrPortion::SwSoftHyphStrPortion( const XubString &rStr )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtinit.cxx b/sw/source/core/text/txtinit.cxx
index 486eb1d3c242..79799512a998 100644
--- a/sw/source/core/text/txtinit.cxx
+++ b/sw/source/core/text/txtinit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-#include "errhdl.hxx"
-#include "txtcfg.hxx"
#include "swcache.hxx"
#include "fntcache.hxx" // pFntCache ( SwFont/ScrFont-PrtFont Cache )
#include "swfntcch.hxx" // pSwFontCache ( SwAttrSet/SwFont Cache )
@@ -76,7 +73,7 @@ void _TextInit()
pFntCache = new SwFntCache; // Cache for SwSubFont -> SwFntObj = { Font aFont, Font* pScrFont, Font* pPrtFont, OutputDevice* pPrinter, ... }
pSwFontCache = new SwFontCache; // Cache for SwTxtFmtColl -> SwFontObj = { SwFont aSwFont, SfxPoolItem* pDefaultArray }
SwCache *pTxtCache = new SwCache( 250, 100 // Cache for SwTxtFrm -> SwTxtLine = { SwParaPortion* pLine }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
, "static SwTxtFrm::pTxtCache"
#endif
);
@@ -99,3 +96,4 @@ void _TextFinit()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index 535c998b4cba..a3826ac4cc7e 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,8 +34,6 @@
#include "viewsh.hxx" // IsDbg()
#include "viewopt.hxx" // IsDbg()
#include "txtatr.hxx"
-#include "errhdl.hxx"
-#include "txtcfg.hxx"
#include "txtfrm.hxx" // IsDbg()
#include "flyfrms.hxx"
#include "inftxt.hxx"
@@ -55,224 +54,11 @@
#include "pormulti.hxx"
#include "ndhints.hxx"
-// So kann man die Layoutstruktur ausgeben lassen
-// #define AMA_LAYOUT
-#ifdef AMA_LAYOUT
-#include <stdio.h>
-#include <stdlib.h> // getenv()
-#include <flowfrm.hxx>
-#include <pagefrm.hxx>
-#include <svx/svdobj.hxx>
-#include <dflyobj.hxx>
-
-
-void lcl_OutFollow( XubString &rTmp, const SwFrm* pFrm )
-{
- if( pFrm->IsFlowFrm() )
- {
- const SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( pFrm );
- if( pFlow->IsFollow() || pFlow->GetFollow() )
- {
- rTmp += "(";
- if( pFlow->IsFollow() )
- rTmp += ".";
- if( pFlow->GetFollow() )
- {
- MSHORT nFrmId = pFlow->GetFollow()->GetFrm()->GetFrmId();
- rTmp += nFrmId;
- }
- rTmp += ")";
- }
- }
-}
-
-void lcl_OutFrame( SvFileStream& rStr, const SwFrm* pFrm, ByteString& rSp, sal_Bool bNxt )
-{
- if( !pFrm )
- return;
- KSHORT nSpc = 0;
- MSHORT nFrmId = pFrm->GetFrmId();
- ByteString aTmp;
- if( pFrm->IsLayoutFrm() )
- {
- if( pFrm->IsRootFrm() )
- aTmp = "R";
- else if( pFrm->IsPageFrm() )
- aTmp = "P";
- else if( pFrm->IsBodyFrm() )
- aTmp = "B";
- else if( pFrm->IsColumnFrm() )
- aTmp = "C";
- else if( pFrm->IsTabFrm() )
- aTmp = "Tb";
- else if( pFrm->IsRowFrm() )
- aTmp = "Rw";
- else if( pFrm->IsCellFrm() )
- aTmp = "Ce";
- else if( pFrm->IsSctFrm() )
- aTmp = "S";
- else if( pFrm->IsFlyFrm() )
- {
- aTmp = "F";
- const SwFlyFrm *pFly = (SwFlyFrm*)pFrm;
- if( pFly->IsFlyInCntFrm() )
- aTmp += "in";
- else if( pFly->IsFlyAtCntFrm() )
- {
- aTmp += "a";
- if( pFly->IsAutoPos() )
- aTmp += "u";
- else
- aTmp += "t";
- }
- else
- aTmp += "l";
- }
- else if( pFrm->IsHeaderFrm() )
- aTmp = "H";
- else if( pFrm->IsFooterFrm() )
- aTmp = "Fz";
- else if( pFrm->IsFtnContFrm() )
- aTmp = "Fc";
- else if( pFrm->IsFtnFrm() )
- aTmp = "Fn";
- else
- aTmp = "?L?";
- aTmp += nFrmId;
- lcl_OutFollow( aTmp, pFrm );
- aTmp += " ";
- rStr << aTmp;
- nSpc = aTmp.Len();
- rSp.Expand( nSpc + rSp.Len() );
- lcl_OutFrame( rStr, ((SwLayoutFrm*)pFrm)->Lower(), rSp, sal_True );
- }
- else
- {
- if( pFrm->IsTxtFrm() )
- aTmp = "T";
- else if( pFrm->IsNoTxtFrm() )
- aTmp = "N";
- else
- aTmp = "?C?";
- aTmp += nFrmId;
- lcl_OutFollow( aTmp, pFrm );
- aTmp += " ";
- rStr << aTmp;
- nSpc = aTmp.Len();
- rSp.Expand( nSpc + rSp.Len() );
- }
- if( pFrm->IsPageFrm() )
- {
- const SwPageFrm* pPg = (SwPageFrm*)pFrm;
- const SwSortedObjs *pSorted = pPg->GetSortedObjs();
- const MSHORT nCnt = pSorted ? pSorted->Count() : 0;
- if( nCnt )
- {
- for( MSHORT i=0; i < nCnt; ++i )
- {
- // --> OD 2004-07-07 #i28701# - consider changed type of
- // <SwSortedObjs> entries
- SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
- if( pAnchoredObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
- lcl_OutFrame( rStr, pFly, rSp, sal_False );
- }
- else
- {
- aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
- rStr << aTmp;
- }
- // <--
- if( i < nCnt - 1 )
- rStr << endl << rSp;
- }
- }
- }
- else if( pFrm->GetDrawObjs() )
- {
- MSHORT nCnt = pFrm->GetDrawObjs()->Count();
- if( nCnt )
- {
- for( MSHORT i=0; i < nCnt; ++i )
- {
- // --> OD 2004-07-07 #i28701# - consider changed type of
- // <SwSortedObjs> entries
- SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[ i ];
- if( pAnchoredObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
- lcl_OutFrame( rStr, pFly, rSp, sal_False );
- }
- else
- {
- aTmp = pAnchoredObj->GetDrawObj()->IsUnoObj() ? "UNO" : "Drw";
- rStr << aTmp;
- }
- if( i < nCnt - 1 )
- rStr << endl << rSp;
- }
- }
- }
- if( nSpc )
- rSp.Erase( rSp.Len() - nSpc );
- if( bNxt && pFrm->GetNext() )
- {
- do
- {
- pFrm = pFrm->GetNext();
- rStr << endl << rSp;
- lcl_OutFrame( rStr, pFrm, rSp, sal_False );
- } while ( pFrm->GetNext() );
- }
-}
-
-void LayOutPut( const SwFrm* pFrm )
-{
- static char* pOutName = 0;
- const sal_Bool bFirstOpen = pOutName ? sal_False : sal_True;
- if( bFirstOpen )
- {
- char *pPath = getenv( "TEMP" );
- char *pName = "layout.txt";
- if( !pPath )
- pOutName = pName;
- else
- {
- const int nLen = strlen(pPath);
- // fuer dieses new wird es kein delete geben.
- pOutName = new char[nLen + strlen(pName) + 3];
- if(nLen && (pPath[nLen-1] == '\\') || (pPath[nLen-1] == '/'))
- snprintf( pOutName, sizeof(pOutName), "%s%s", pPath, pName );
- else
- snprintf( pOutName, sizeof(pOutName), "%s/%s", pPath, pName );
- }
- }
- SvFileStream aStream( pOutName, (bFirstOpen
- ? STREAM_WRITE | STREAM_TRUNC
- : STREAM_WRITE ));
-
- if( !aStream.GetError() )
- {
- if ( bFirstOpen )
- aStream << "Layout-Struktur";
- else
- aStream.Seek( STREAM_SEEK_TO_END );
- aStream << endl;
- aStream << "---------------------------------------------" << endl;
- XubString aSpace;
- lcl_OutFrame( aStream, pFrm, aSpace, sal_False );
- }
-}
-
-#endif
+#define CONSTCHAR( name, string ) static const sal_Char name[] = string
SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream
{
rOs << " {HINTS:";
-
-// REMOVED
-
rOs << '}';
return rOs;
}
@@ -283,9 +69,14 @@ SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream
sal_Bool IsDbg( const SwTxtFrm *pFrm )
{
+// Hmm, so IsTest4 etc are defined only if OSL_DEBUG_LEVEL > 1,
+// but this file is compiled if DBG_UTIL is defined. So should the IsTest4 etc
+// then instead be conditional on DBG_UTIL? Such crack.
+#if OSL_DEBUG_LEVEL > 1
if( pFrm && pFrm->GetShell() )
return pFrm->GetShell()->GetViewOptions()->IsTest4();
else
+#endif
return sal_False;
}
@@ -295,7 +86,7 @@ static void Error()
{
// wegen PM und BCC
sal_Bool bFalse = sal_False;
- ASSERT( bFalse, "txtio: No debug version" );
+ OSL_ENSURE( bFalse, "txtio: No debug version" );
}
#define IMPL_OUTOP(class) \
@@ -369,10 +160,10 @@ const char *GetLangName( const MSHORT )
}
#else
-# include <limits.h>
-# include <stdlib.h>
-# include "swtypes.hxx" // ZTCCONST
-# include "swfont.hxx" // SwDropPortion
+#include <limits.h>
+#include <stdlib.h>
+#include "swtypes.hxx" // ZTCCONST
+#include "swfont.hxx" // SwDropPortion
CONSTCHAR( pClose, "} " );
@@ -456,7 +247,7 @@ const char *GetPrepName( const PrepareHint ePrep )
pPREP_UL_SPACE, pPREP_MUST_FIT, pPREP_WIDOWS, pPREP_QUOVADIS,
pPREP_PAGE
};
- ASSERT( ePrep < PREP_END, "GetPrepName: unknown PrepareHint" );
+ OSL_ENSURE( ePrep < PREP_END, "GetPrepName: unknown PrepareHint" );
return( ppNameArr[ePrep] );
}
@@ -483,7 +274,6 @@ void SwLineLayout::DebugPortions( SvStream &rOs, const XubString &/*rTxt*/, //$
while( pPortion2 )
{
- DBG_LOOP;
SwTxtPortion *pTxtPor = pPortion2->InTxtGrp() ?
(SwTxtPortion *)pPortion2 : NULL ;
(void)pTxtPor;
@@ -592,7 +382,6 @@ SvStream &SwLineLayout::operator<<( SvStream &rOs ) const //$ ostream
SwLinePortion *pPos = GetPortion();
while( pPos )
{
- DBG_LOOP;
rOs << "\t";
pPos->operator<<( rOs );
pPos = pPos->GetPortion();
@@ -945,3 +734,4 @@ SvStream &SwDropPortion::operator<<( SvStream &rOs ) const //$ ostream
#endif // DBG_UTIL
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtpaint.cxx b/sw/source/core/text/txtpaint.cxx
index efb05c0b836b..2d4e5fec170f 100644
--- a/sw/source/core/text/txtpaint.cxx
+++ b/sw/source/core/text/txtpaint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "txtpaint.hxx"
#include "swrect.hxx"
#include "rootfrm.hxx"
@@ -119,7 +118,6 @@ void SwSaveClip::_ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm,
#endif
}
#if OSL_DEBUG_LEVEL > 1
-#ifdef DBG_UTIL
static sal_Bool bDbg = sal_False;
if( bDbg )
{
@@ -127,7 +125,6 @@ void SwSaveClip::_ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm,
pOut->DrawRect( aRect );
}
#endif
-#endif
}
bChg = sal_True;
@@ -135,3 +132,4 @@ void SwSaveClip::_ChgClip( const SwRect &rRect, const SwTxtFrm* pFrm,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtpaint.hxx b/sw/source/core/text/txtpaint.hxx
index 37fbd6a9ac39..0a7a36beda48 100644
--- a/sw/source/core/text/txtpaint.hxx
+++ b/sw/source/core/text/txtpaint.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,7 +69,7 @@ inline SwSaveClip::~SwSaveClip()
Reset();
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* class SwDbgOut
@@ -189,3 +190,5 @@ inline DbgRect::DbgRect( OutputDevice* pOutDev, const Rectangle &rRect,
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index a83fe42c265d..d1091eaf9c86 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,15 +31,12 @@
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
#include <editeng/tstpitem.hxx>
-#endif
#include <IDocumentSettingAccess.hxx>
#include <frmatr.hxx>
#include <SwPortionHandler.hxx>
#include "viewopt.hxx" // SwViewOptions
-#include "txtcfg.hxx"
#include "portab.hxx"
#include "inftxt.hxx"
#include "itrform2.hxx"
@@ -216,7 +214,6 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
cFill = 0;
eAdj = SVX_TAB_ADJUST_LEFT;
}
- // --> OD 2008-02-07 #newlistlevelattrs#
long nForced = 0;
if ( !bTabsRelativeToIndent )
{
@@ -240,7 +237,6 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nForced += pPor->Width();
}
- // <--
// --> OD 2009-04-03 #i100732#
// correction of condition, when a tab stop at the left margin can
// be applied:
@@ -274,7 +270,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nNextPos = nForced;
}
nNextPos += bRTL ? nLinePos - nTabLeft : nTabLeft - nLinePos;
- ASSERT( nNextPos >= 0, "GetTabStop: Don't go back!" );
+ OSL_ENSURE( nNextPos >= 0, "GetTabStop: Don't go back!" );
nNewTabPos = KSHORT(nNextPos);
}
@@ -307,7 +303,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
}
default:
{
- ASSERT( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj,
+ OSL_ENSURE( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj,
"+SwTxtFormatter::NewTabPortion: unknown adjustment" );
pTabPor = new SwTabLeftPortion( nNewTabPos, cFill );
break;
@@ -334,10 +330,10 @@ SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillCh
: SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar)
{
nLineLength = 1;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( IsFilled() )
{
- ASSERT( ' ' != cFill, "SwTabPortion::CTOR: blanks ?!" );
+ OSL_ENSURE( ' ' != cFill, "SwTabPortion::CTOR: blanks ?!" );
}
#endif
SetWhichPor( POR_TAB );
@@ -379,7 +375,7 @@ void SwTabPortion::FormatEOL( SwTxtFormatInfo &rInf )
sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
{
- ASSERT( rInf.X() <= GetTabPos(), "SwTabPortion::PreFormat: rush hour" );
+ OSL_ENSURE( rInf.X() <= GetTabPos(), "SwTabPortion::PreFormat: rush hour" );
// Hier lassen wir uns nieder...
Fix( static_cast<sal_uInt16>(rInf.X()) );
@@ -451,7 +447,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
break;
}
- default: ASSERT( !this, "SwTabPortion::PreFormat: unknown adjustment" );
+ default: OSL_ENSURE( !this, "SwTabPortion::PreFormat: unknown adjustment" );
}
}
@@ -501,13 +497,12 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf )
KSHORT nPorWidth = 0;
while( pPor )
{
- DBG_LOOP;
nPorWidth = nPorWidth + pPor->Width();
pPor = pPor->GetPortion();
}
const MSHORT nWhich = GetWhichPor();
- ASSERT( POR_TABLEFT != nWhich, "SwTabPortion::PostFormat: already formatted" );
+ OSL_ENSURE( POR_TABLEFT != nWhich, "SwTabPortion::PostFormat: already formatted" );
const bool bTabCompat = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
// --> FME 2005-12-19 #127428# Abandon dec. tab position if line is full:
@@ -569,7 +564,7 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf )
void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// Wir wollen uns die Fixbreite anzeigen
if( rInf.OnWin() && OPTDBG( rInf ) &&
!rInf.GetOpt().IsPagePreview() && \
@@ -639,7 +634,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
XubString aTxt( cFill );
const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width();
#if OSL_DEBUG_LEVEL > 1
- ASSERT( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
+ OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
#endif
// robust:
if( nCharWidth )
@@ -670,3 +665,4 @@ void SwTabPortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Text( GetLen(), GetWhichPor() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index f0fe98e44987..55ec68509498 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,6 @@
#include <fmtftn.hxx>
#include <rowfrm.hxx>
-#include "txtcfg.hxx"
#include "widorp.hxx"
#include "txtfrm.hxx"
#include "itrtxt.hxx"
@@ -60,7 +60,7 @@
// Ein Follow, der auf der selben Seite steht, wie sein Master ist nasty.
inline sal_Bool IsNastyFollow( const SwTxtFrm *pFrm )
{
- ASSERT( !pFrm->IsFollow() || !pFrm->GetPrev() ||
+ OSL_ENSURE( !pFrm->IsFollow() || !pFrm->GetPrev() ||
((const SwTxtFrm*)pFrm->GetPrev())->GetFollow() == pFrm,
"IsNastyFollow: Was ist denn hier los?" );
return pFrm->IsFollow() && pFrm->GetPrev();
@@ -330,7 +330,7 @@ sal_Bool WidowsAndOrphans::FindBreak( SwTxtFrm *pFrame, SwTxtMargin &rLine,
{
// OD 2004-02-25 #i16128# - Why member <pFrm> _*and*_ parameter <pFrame>??
// Thus, assertion on situation, that these are different to figure out why.
- ASSERT( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" );
+ OSL_ENSURE( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" );
SWAP_IF_SWAPPED( pFrm )
@@ -385,8 +385,8 @@ sal_Bool WidowsAndOrphans::FindBreak( SwTxtFrm *pFrame, SwTxtMargin &rLine,
sal_Bool WidowsAndOrphans::FindWidows( SwTxtFrm *pFrame, SwTxtMargin &rLine )
{
- ASSERT( ! pFrame->IsVertical() || ! pFrame->IsSwapped(),
- "WidowsAndOrphans::FindWidows with swapped frame" )
+ OSL_ENSURE( ! pFrame->IsVertical() || ! pFrame->IsSwapped(),
+ "WidowsAndOrphans::FindWidows with swapped frame" );
if( !nWidLines || !pFrame->IsFollow() )
return sal_False;
@@ -395,7 +395,7 @@ sal_Bool WidowsAndOrphans::FindWidows( SwTxtFrm *pFrame, SwTxtMargin &rLine )
// Wir koennen noch was abzwacken
SwTxtFrm *pMaster = pFrame->FindMaster();
- ASSERT(pMaster, "+WidowsAndOrphans::FindWidows: Widows in a master?");
+ OSL_ENSURE(pMaster, "+WidowsAndOrphans::FindWidows: Widows in a master?");
if( !pMaster )
return sal_False;
@@ -519,7 +519,7 @@ sal_Bool WidowsAndOrphans::WouldFit( SwTxtMargin &rLine, SwTwips &rMaxHeight, sa
// IsInside() takes care for itself
// Wir erwarten, dass rLine auf der letzten Zeile steht!!
- ASSERT( !rLine.GetNext(), "WouldFit: aLine::Bottom missed!" );
+ OSL_ENSURE( !rLine.GetNext(), "WouldFit: aLine::Bottom missed!" );
MSHORT nLineCnt = rLine.GetLineNr();
// Erstmal die Orphansregel und den Initialenwunsch erfuellen ...
@@ -532,7 +532,6 @@ sal_Bool WidowsAndOrphans::WouldFit( SwTxtMargin &rLine, SwTwips &rMaxHeight, sa
while( nMinLines > rLine.GetLineNr() )
{
- DBG_LOOP;
if( !rLine.NextLine() )
return sal_False;
nLineSum += rLine.GetLineHeight();
@@ -572,3 +571,4 @@ sal_Bool WidowsAndOrphans::WouldFit( SwTxtMargin &rLine, SwTwips &rMaxHeight, sa
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/widorp.hxx b/sw/source/core/text/widorp.hxx
index 3ceef310b64e..a0730d1b171e 100644
--- a/sw/source/core/text/widorp.hxx
+++ b/sw/source/core/text/widorp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,3 +94,5 @@ public:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 152ed79b0cef..873ab995b0af 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include <tools/string.hxx>
#include <tools/debug.hxx>
-#include "errhdl.hxx"
#include "swtypes.hxx"
#include "txttypes.hxx"
@@ -186,7 +186,7 @@ xub_StrLen SwWrongList::NextWrong( xub_StrLen nChk ) const
MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const
{
- MSHORT nOben = Count(), nMitte = 0, nUnten = 0;
+ MSHORT nOben = Count(), nUnten = 0;
if( nOben > 0 )
{
@@ -211,6 +211,7 @@ MSHORT SwWrongList::GetWrongPos( xub_StrLen nValue ) const
}
--nOben;
+ MSHORT nMitte = 0;
while( nUnten <= nOben )
{
nMitte = nUnten + ( nOben - nUnten ) / 2;
@@ -560,7 +561,7 @@ void SwWrongList::Remove(sal_uInt16 nIdx, sal_uInt16 nLen )
maList.erase(i1, i2);
#if OSL_DEBUG_LEVEL > 1
- ASSERT( Count() + nLen == nOldSize, "SwWrongList::Remove() trouble" )
+ OSL_ENSURE( Count() + nLen == nOldSize, "SwWrongList::Remove() trouble" );
#endif
}
@@ -642,3 +643,4 @@ void SwWrongList::Insert( const rtl::OUString& rType,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
new file mode 100644
index 000000000000..a92bb46a4c99
--- /dev/null
+++ b/sw/source/core/text/xmldump.cxx
@@ -0,0 +1,316 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Florian Reuter <freuter@novell.com>
+ * Cedric Bosdonnat <cbosdonnat@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "precompiled_sw.hxx"
+
+#include "frame.hxx"
+#include "txtfrm.hxx"
+#include "porlin.hxx"
+#include "porlay.hxx"
+#include "portxt.hxx"
+#include <SwPortionHandler.hxx>
+
+
+
+class XmlPortionDumper:public SwPortionHandler
+{
+ private:
+ xmlTextWriterPtr writer;
+ USHORT ofs;
+ public:
+
+ XmlPortionDumper( xmlTextWriterPtr some_writer ):writer( some_writer ), ofs( 0 )
+ {
+ }
+
+ virtual ~ XmlPortionDumper( )
+ {
+ }
+
+ /**
+ @param nLength
+ length of this portion in the model string
+ @param rText
+ text which is painted on-screen
+ */
+ virtual void Text( USHORT nLength,
+ USHORT nType )
+ {
+ ofs += nLength;
+ xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nLength" ),
+ "%i", ( int ) nLength );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nType" ),
+ "%i", ( int ) nType );
+ xmlTextWriterEndElement( writer );
+ }
+
+ /**
+ @param nLength
+ length of this portion in the model string
+ @param rText
+ text which is painted on-screen
+ @param nType
+ type of this portion
+ */
+ virtual void Special( USHORT nLength,
+ const String & rText,
+ USHORT nType )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nLength" ),
+ "%i", ( int ) nLength );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nType" ),
+ "%i", ( int ) nType );
+ rtl::OUString sText( rText );
+ rtl::OString sText8 =::rtl::OUStringToOString( sText,
+ RTL_TEXTENCODING_UTF8 );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
+ "%s", sText8.getStr( ) );
+
+ xmlTextWriterEndElement( writer );
+ ofs += nLength;
+ }
+
+ virtual void LineBreak( )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "LineBreak" ) );
+ xmlTextWriterEndElement( writer );
+ }
+
+ /**
+ * @param nLength
+ * number of 'model string' characters to be skipped
+ */
+ virtual void Skip( USHORT nLength )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nLength" ),
+ "%i", ( int ) nLength );
+ xmlTextWriterEndElement( writer );
+ ofs += nLength;
+ }
+
+ virtual void Finish( )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "Finish" ) );
+ xmlTextWriterEndElement( writer );
+ }
+
+};
+
+
+void SwTxtPortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
+ xmlTextWriterPtr writer )
+{
+ xmlTextWriterStartElement( writer, BAD_CAST( "SwTxtPortion" ) );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
+ ( int ) this->GetLen( ) );
+
+ xmlTextWriterEndElement( writer );
+}
+
+void SwLinePortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
+ xmlTextWriterPtr writer )
+{
+ xmlTextWriterStartElement( writer, BAD_CAST( "SwLinePortion" ) );
+ xmlTextWriterWriteFormatAttribute( writer,
+ BAD_CAST( "nWhichPor" ),
+ "%04X",
+ ( int ) this->GetWhichPor( ) );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
+ ( int ) this->GetLen( ) );
+ xmlTextWriterEndElement( writer );
+}
+
+void SwLineLayout::dumpLineAsXml( xmlTextWriterPtr writer,
+ xub_StrLen & ofs, XubString & aText )
+{ // not used any longer...
+ xmlTextWriterStartElement( writer, BAD_CAST( "SwLineLayout" ) );
+ SwLinePortion *portion = this;
+ while ( portion != NULL )
+ {
+ portion->dumpPortionAsXml( ofs, aText, writer );
+ ofs += portion->GetLen( );
+ portion = portion->GetPortion( );
+ }
+ xmlTextWriterEndElement( writer );
+}
+
+
+void SwParaPortion::dumpAsXml( xmlTextWriterPtr writer, SwTxtFrm * pTxtFrm )
+{
+ xmlTextWriterStartElement( writer, BAD_CAST( "SwParaPortion" ) );
+ SwParaPortion *pPara = this;
+
+ if ( pPara && pTxtFrm )
+ {
+ xub_StrLen ofs = 0;
+ XubString & aText = ( String & ) pTxtFrm->GetTxt( );
+ if ( pTxtFrm->IsFollow( ) )
+ ofs += pTxtFrm->GetOfst( );
+
+ SwLineLayout *pLine = pPara;
+ while ( pLine )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "line" ) );
+ SwLinePortion *pPor = pLine->GetFirstPortion( );
+ while ( pPor )
+ {
+ pPor->dumpPortionAsXml( ofs, aText, writer );
+ ofs += pPor->GetLen( );
+ pPor = pPor->GetPortion( );
+ }
+
+ xmlTextWriterEndElement( writer ); // line
+ pLine = pLine->GetNext( );
+ }
+ }
+ xmlTextWriterEndElement( writer );
+}
+
+
+void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
+{
+ const char *name = NULL;
+
+ switch ( GetType( ) )
+ {
+ case FRM_ROOT:
+ name = "root";
+ break;
+ case FRM_PAGE:
+ name = "page";
+ break;
+ case FRM_COLUMN:
+ name = "column";
+ break;
+ case FRM_HEADER:
+ name = "header";
+ break;
+ case FRM_FOOTER:
+ name = "footer";
+ break;
+ case FRM_FTNCONT:
+ name = "ftncont";
+ break;
+ case FRM_FTN:
+ name = "ftn";
+ break;
+ case FRM_BODY:
+ name = "body";
+ break;
+ case FRM_FLY:
+ name = "fly";
+ break;
+ case FRM_SECTION:
+ name = "section";
+ break;
+ case FRM_UNUSED:
+ name = "unused";
+ break;
+ case FRM_TAB:
+ name = "tab";
+ break;
+ case FRM_ROW:
+ name = "row";
+ break;
+ case FRM_CELL:
+ name = "cell";
+ break;
+ case FRM_TXT:
+ name = "txt";
+ break;
+ case FRM_NOTXT:
+ name = "txt";
+ break;
+ };
+
+ if ( name != NULL )
+ {
+ xmlTextWriterStartElement( writer, ( const xmlChar * ) name );
+
+ dumpAsXmlAttributes( writer );
+
+ if ( IsTxtFrm( ) )
+ {
+ SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
+ rtl::OUString aTxt = pTxtFrm->GetTxt( );
+ for ( int i = 0; i < 32; i++ )
+ {
+ aTxt = aTxt.replace( i, '*' );
+ }
+ rtl::OString aTxt8 =::rtl::OUStringToOString( aTxt,
+ RTL_TEXTENCODING_UTF8 );
+ xmlTextWriterWriteString( writer,
+ ( const xmlChar * ) aTxt8.getStr( ) );
+ XmlPortionDumper pdumper( writer );
+ pTxtFrm->VisitPortions( pdumper );
+
+ }
+ else
+ {
+ dumpChildrenAsXml( writer );
+ }
+ xmlTextWriterEndElement( writer );
+ }
+}
+
+void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "next" ), "%p", GetNext() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "prev" ), "%p", GetPrev() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "upper" ), "%p", this->GetUpper() );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "lower" ), "%p", this->GetLower() );
+}
+
+void SwFrm::dumpChildrenAsXml( xmlTextWriterPtr writer )
+{
+ SwFrm *pFrm = GetLower( );
+ for ( ; pFrm != NULL; pFrm = pFrm->GetNext( ) )
+ {
+ pFrm->dumpAsXml( writer );
+ }
+}
+
+void SwTxtFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+ SwFrm::dumpAsXmlAttributes( writer );
+ if ( HasFollow() )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 47c03a776797..2ab959490252 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,14 +35,11 @@
#include <tools/resid.hxx>
#include <hintids.hxx>
#include <swtypes.hxx>
-#include <errhdl.hxx>
#include <txtatr.hxx>
#include <ndtxt.hxx>
#include <txttxmrk.hxx>
#include <tox.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <paratr.hxx>
@@ -81,9 +79,6 @@ SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
-/* -----------------23.09.99 13:59-------------------
-
- --------------------------------------------------*/
struct PatternIni
{
sal_uInt16 n1;
@@ -126,9 +121,7 @@ const PatternIni aPatternIni[] =
{AUTH_FIELD_AUTHOR, AUTH_FIELD_TITLE, AUTH_FIELD_YEAR, USHRT_MAX, USHRT_MAX}, //AUTH_FIELD_CUSTOM5,
{USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX}
};
-/* -----------------23.09.99 13:58-------------------
- --------------------------------------------------*/
// -> #i21237#
SwFormTokens lcl_GetAuthPattern(sal_uInt16 nTypeId)
{
@@ -221,7 +214,7 @@ SwTOXMark::~SwTOXMark()
int SwTOXMark::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return GetRegisteredIn() == ((SwTOXMark&)rAttr).GetRegisteredIn();
}
@@ -256,7 +249,7 @@ String SwTOXMark::GetText() const
else if( pTxtAttr && pTxtAttr->GetpTxtNd() )
{
xub_StrLen* pEndIdx = pTxtAttr->GetEnd();
- ASSERT( pEndIdx, "TOXMark ohne Mark!!");
+ OSL_ENSURE( pEndIdx, "TOXMark ohne Mark!!");
if( pEndIdx )
{
const xub_StrLen nStt = *pTxtAttr->GetStart();
@@ -314,7 +307,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
case TOX_TABLES : nPoolId = STR_POOLCOLL_TOX_TABLESH; break;
case TOX_AUTHORITIES : nPoolId = STR_POOLCOLL_TOX_AUTHORITIESH; break;
default:
- ASSERT( !this, "ungueltiger TOXTyp");
+ OSL_ENSURE( !this, "ungueltiger TOXTyp");
return ;
}
@@ -628,34 +621,6 @@ SwTOXBase & SwTOXBase::operator = (const SwTOXBase & rSource)
return *this;
}
-/* -----------------16.07.99 16:02-------------------
-
-SwTOXBase & SwTOXBase::operator = (const SwTOXBase & rSource)
-{
- aForm = rSource.aForm;
- aName = rSource.aName;
- aTitle = rSource.aTitle;
- sMainEntryCharStyle = rSource.sMainEntryCharStyle;
- sSequenceName = rSource.sSequenceName;
- eLanguage = rSource.eLanguage;
- sSortAlgorithm = rSource.sSortAlgorithm;
- aData = rSource.aData;
- nCreateType = rSource.nCreateType;
- nOLEOptions = rSource.nOLEOptions;
- eCaptionDisplay = rSource.eCaptionDisplay;
- bProtected = rSource.bProtected;
- bFromChapter = rSource.bFromChapter;
- bFromObjectNames = rSource.bFromObjectNames;
- bLevelFromChapter = rSource.bLevelFromChapter;
-
- if (rSource.GetAttrSet())
- SetAttrSet(*rSource.GetAttrSet());
-
- return *this;
-}
-
- --------------------------------------------------*/
-
String SwFormToken::GetString() const
{
String sRet;
@@ -897,7 +862,7 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
sal_uInt16 nLen;
sal_uInt16 nOffset;
FormTokenType eToken;
- } __READONLY_DATA aTokenArr[] = {
+ } const aTokenArr[] = {
{ SwForm::aFormTab, SwForm::nFormEntryLen, 1, TOKEN_TAB_STOP },
{ SwForm::aFormPageNums, SwForm::nFormPageNumsLen, 1, TOKEN_PAGE_NUMS },
{ SwForm::aFormLinkStt, SwForm::nFormLinkSttLen, 1, TOKEN_LINK_START },
@@ -923,7 +888,7 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
break;
}
- ASSERT( pNm, "wrong token" );
+ OSL_ENSURE( pNm, "wrong token" );
if (pTokenLen)
*pTokenLen = nTokenLen;
@@ -934,13 +899,13 @@ FormTokenType SwFormTokensHelper::GetTokenType(const String & sToken,
void SwForm::SetPattern(sal_uInt16 nLevel, const SwFormTokens& rTokens)
{
- ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
+ OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
aPattern[nLevel] = rTokens;
}
void SwForm::SetPattern(sal_uInt16 nLevel, const String & rStr)
{
- ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
+ OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
SwFormTokensHelper aHelper(rStr);
aPattern[nLevel] = aHelper.GetTokens();
@@ -948,7 +913,8 @@ void SwForm::SetPattern(sal_uInt16 nLevel, const String & rStr)
const SwFormTokens& SwForm::GetPattern(sal_uInt16 nLevel) const
{
- ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
+ OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
return aPattern[nLevel];
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx
index be86709adcd2..02364b36cf8a 100644
--- a/sw/source/core/tox/toxhlp.cxx
+++ b/sw/source/core/tox/toxhlp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
-#ifndef _COM_SUN_STAR_I18N_XINDEXENTRYSUPPLIER_HPP_
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
-#endif
#include <tools/string.hxx>
#include <tools/debug.hxx>
#include <toxwrap.hxx>
@@ -49,8 +48,8 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
try {
STAR_REFERENCE( uno::XInterface ) xI =
- rxMSF->createInstance( ::rtl::OUString::createFromAscii(
- "com.sun.star.i18n.IndexEntrySupplier" ) );
+ rxMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.i18n.IndexEntrySupplier")) );
if( xI.is() )
{
UNO_NMSPC::Any x = xI->queryInterface( ::getCppuType(
@@ -59,12 +58,12 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
}
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "IndexEntrySupplierWrapper: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -85,12 +84,12 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt,
sRet = xIES->getIndexKey( rTxt, rTxtReading, rLocale );
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getIndexKey: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -106,12 +105,12 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const
sRet = xIES->getIndexFollowPageWord( bMorePages, aLcl );
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getIndexFollowPageWord: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -129,12 +128,12 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc
sRet = xIES->getAlgorithmList( rLcl );
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getAlgorithmList: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -152,12 +151,12 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm(
bRet = xIES->loadAlgorithm( rLcl, sSortAlgorithm, nOptions );
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "loadAlgorithm: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -178,12 +177,12 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry(
rTxt2, rTxtReading2, rLocale2 );
}
catch ( UNO_NMSPC::Exception&
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
e
#endif
)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "compareIndexEntry: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
DBG_ERRORFILE( aMsg.GetBuffer() );
@@ -191,3 +190,5 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry(
}
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 121c79848e2d..7ca2ae0adbc0 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <tools/resid.hxx>
#include <unotools/charclass.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
@@ -186,8 +186,8 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
{
SwPosition aPos( *pNd );
const SwDoc& rDoc = *pNd->GetDoc();
-#ifdef DBG_UTIL
- ASSERT( GetBodyTxtNode( rDoc, aPos, *pFrm ),
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ),
"wo steht der Absatz" );
#else
GetBodyTxtNode( rDoc, aPos, *pFrm );
@@ -340,7 +340,7 @@ sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
if(GetLevel() != rCmp.GetLevel() || nKeyLevel != rCmp.nKeyLevel)
return sal_False;
- ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
+ OSL_ENSURE(pTxtMark, "pTxtMark == 0, Kein Stichwort");
String sMyTxt;
String sMyTxtReading;
@@ -363,14 +363,11 @@ sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase )
//
// kleiner haengt nur vom Text ab
-
-//
-
sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
{
SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase;
- ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
+ OSL_ENSURE(pTxtMark, "pTxtMark == 0, Kein Stichwort");
String sMyTxt;
String sMyTxtReading;
@@ -398,12 +395,9 @@ sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase )
//
// Das Stichwort selbst
-
-//
-
void SwTOXIndex::GetText_Impl( String& rTxt, String& rTxtReading ) const
{
- ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
+ OSL_ENSURE(pTxtMark, "pTxtMark == 0, Kein Stichwort");
const SwTOXMark& rTOXMark = pTxtMark->GetTOXMark();
switch(nKeyLevel)
{
@@ -461,7 +455,7 @@ void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 )
sal_uInt16 SwTOXIndex::GetLevel() const
{
- ASSERT(pTxtMark, "pTxtMark == 0, Kein Stichwort");
+ OSL_ENSURE(pTxtMark, "pTxtMark == 0, Kein Stichwort");
sal_uInt16 nForm = FORM_PRIMARY_KEY;
@@ -532,7 +526,6 @@ void SwTOXCustom::GetText_Impl( String& rTxt, String &rTxtReading ) const
{
rTxt = aKey;
rTxtReading = sReading;
- /// !!!!!!!!!!!!!!
}
@@ -620,13 +613,6 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const
case nsSwTOXElement::TOX_OUTLINELEVEL:
{
xub_StrLen nStt = nStartIndex;
-/* JP 22.01.98:
- Tabs ueberspringen - macht aber keinen Sinn, solange in der TOX-Form
- nicht die KapitelNummer eingestellt werden kann
- const String& rTmp = ((SwTxtNode*)pNd)->GetTxt();
- while( '\t' == rTmp.GetChar( nStt ) && nStt < rTmp.Len() )
- ++nStt;
-*/
rTxt = ((SwTxtNode*)pNd)->GetExpandTxt(
nStt,
STRING_NOTFOUND == nEndIndex ? STRING_LEN : nEndIndex - nStt);
@@ -643,7 +629,7 @@ void SwTOXPara::GetText_Impl( String& rTxt, String& ) const
rTxt = pFly->GetName();
else
{
- ASSERT( !this, "Grafik/Object ohne Namen" )
+ OSL_ENSURE( !this, "Grafik/Object ohne Namen" );
sal_uInt16 nId = nsSwTOXElement::TOX_OLE == eType
? STR_OBJECT_DEFNAME
: nsSwTOXElement::TOX_GRAPHIC == eType
@@ -663,13 +649,6 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) c
{
SwTxtNode* pSrc = (SwTxtNode*)aTOXSources[0].pNd;
xub_StrLen nStt = nStartIndex;
-/* JP 22.01.98:
- Tabs ueberspringen - macht aber keinen Sinn, solange in der TOX-Form
- nicht die KapitelNummer eingestellt werden kann
- const String& rTxt = pSrc->GetTxt();
- while( '\t' == rTxt.GetChar( nStt ) && nStt < rTxt.Len() )
- ++nStt;
-*/
pSrc->GetExpandTxt( rNd, &rInsPos, nStt,
nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt,
sal_False, sal_False, sal_True );
@@ -691,9 +670,6 @@ sal_uInt16 SwTOXPara::GetLevel() const
if( nsSwTOXElement::TOX_OUTLINELEVEL == eType && pNd->GetTxtNode() )
{
- //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<sal_uInt16>(nTmp);
@@ -713,41 +689,6 @@ String SwTOXPara::GetURL() const
{
const SwTxtNode * pTxtNd = static_cast<const SwTxtNode *>(pNd);
- // --> OD 2009-08-05 #i103265#
-// //if( MAXLEVEL >= pTxtNd->GetTxtColl()->GetOutlineLevel()) //#outline level,zhaojianwei
-// if ( pTxtNd->GetAttrOutlineLevel() > 0) //<-end,zhaojianwei
-// {
-// aTxt = '#';
-// const SwNumRule * pRule = pTxtNd->GetNumRule();
-// if( pRule )
-// {
-// // dann noch die rel. Nummer davor setzen
-// const sal_uInt16 nCurrLevel = static_cast<sal_uInt16>(pTxtNd->GetActualListLevel());
-// if(nCurrLevel <= MAXLEVEL)
-// {
-// // --> OD 2005-11-02 #i51089 - TUNING#
-// if ( pTxtNd->GetNum() )
-// {
-// SwNumberTree::tNumberVector aNumVector =
-// pTxtNd->GetNumberVector();
-
-// for( sal_uInt16 n = 0; n <= nCurrLevel; ++n )
-// {
-// int nNum = aNumVector[ n ];
-// nNum -= ( pRule->Get( n ).GetStart() - 1 );
-// ( aTxt += String::CreateFromInt32( nNum )) += '.';
-// }
-// }
-// else
-// {
-// ASSERT( false,
-// "<SwTOXPara::GetURL()> - text node with numbering rule, but without number. This is a serious defect -> inform OD" );
-// }
-// }
-// }
-// aTxt += pTxtNd->GetExpandTxt();
-// ( aTxt += cMarkSeperator ).AppendAscii( pMarkToOutline );
-// }
SwDoc* pDoc = const_cast<SwDoc*>( pTxtNd->GetDoc() );
::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getMarkForTxtNode(
*(pTxtNd),
@@ -755,7 +696,6 @@ String SwTOXPara::GetURL() const
aTxt = '#';
const String aMarkName( pMark->GetName() );
aTxt += aMarkName;
- // <--
}
break;
@@ -808,7 +748,7 @@ void SwTOXTable::GetText_Impl( String& rTxt, String& ) const
}
else
{
- ASSERT( !this, "Wo ist meine Tabelle geblieben?" )
+ OSL_ENSURE( !this, "Wo ist meine Tabelle geblieben?" );
rTxt = SW_RESSTR( STR_TABLE_DEFNAME );
}
}
@@ -834,9 +774,6 @@ String SwTOXTable::GetURL() const
}
return aTxt;
}
-/*-- 15.09.99 14:28:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd,
SwFmtFld& rField, const SwTOXInternational& rIntl ) :
@@ -863,9 +800,7 @@ sal_uInt16 SwTOXAuthority::GetLevel() const
nRet = 1;
return nRet;
}
-/*-- 15.09.99 14:28:08---------------------------------------------------
- -----------------------------------------------------------------------*/
static String lcl_GetText(SwFmtFld const& rField)
{
return rField.GetFld()->ExpandField(true);
@@ -876,9 +811,6 @@ void SwTOXAuthority::GetText_Impl( String& rTxt, String& ) const
rTxt = lcl_GetText(m_rField);
}
-/* -----------------21.09.99 12:50-------------------
-
- --------------------------------------------------*/
void SwTOXAuthority::FillText( SwTxtNode& rNd,
const SwIndex& rInsPos, sal_uInt16 nAuthField ) const
{
@@ -905,18 +837,14 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd,
sText = (pField->GetFieldText((ToxAuthorityField) nAuthField));
rNd.InsertText( sText, rInsPos );
}
-/* -----------------14.10.99 09:35-------------------
- --------------------------------------------------*/
sal_Bool SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp)
{
return nType == rCmp.nType &&
((SwAuthorityField*)m_rField.GetFld())->GetHandle() ==
((SwAuthorityField*)((SwTOXAuthority&)rCmp).m_rField.GetFld())->GetHandle();
}
-/* -----------------21.10.99 09:52-------------------
- --------------------------------------------------*/
sal_Bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase)
{
sal_Bool bRet = sal_False;
@@ -951,3 +879,5 @@ sal_Bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase)
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index 5a444161a702..a9ee7f529cdb 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -219,3 +220,4 @@ void finishGrammarCheck( SwTxtNode& rTxtNode )
pGrammarContact->finishGrammarCheck( rTxtNode );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index b4119504f71f..20d739bfc8b3 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -138,7 +139,7 @@ void SwFmtFld::SetFld(SwField * _pField)
int SwFmtFld::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
// OD 2004-05-14 #i29146# - correction: check, if <pField> and
// <((SwFmtFld&)rAttr).GetFld()> are set.
// OD 2004-05-14 #i29146# - items are equal, if both fields aren't set.
@@ -163,7 +164,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
return;
SwTxtNode* pTxtNd = (SwTxtNode*)&pTxtAttr->GetTxtNode();
- ASSERT( pTxtNd, "wo ist denn mein Node?" );
+ OSL_ENSURE( pTxtNd, "wo ist denn mein Node?" );
if( pNew )
{
switch( pNew->Which() )
@@ -254,8 +255,6 @@ sal_Bool SwFmtFld::IsProtect() const
|* SwTxtFld::SwTxtFld()
|*
|* Beschreibung Attribut fuer automatischen Text, Ctor
-|* Ersterstellung BP 30.04.92
-|* Letzte Aenderung JP 15.08.94
|*
*************************************************************************/
@@ -282,15 +281,13 @@ SwTxtFld::~SwTxtFld( )
|* SwTxtFld::Expand()
|*
|* Beschreibung exandiert das Feld und tauscht den Text im Node
-|* Ersterstellung BP 30.04.92
-|* Letzte Aenderung JP 15.08.94
|*
*************************************************************************/
void SwTxtFld::Expand() const
{
// Wenn das expandierte Feld sich nicht veraendert hat, wird returnt
- ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
+ OSL_ENSURE( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFld().GetFld();
XubString aNewExpand(
@@ -332,8 +329,8 @@ void SwTxtFld::Expand() const
void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
{
- ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
- ASSERT( pDest->m_pTxtNode, "SwTxtFld: where is pDest's TxtNode?" );
+ OSL_ENSURE( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
+ OSL_ENSURE( pDest->m_pTxtNode, "SwTxtFld: where is pDest's TxtNode?" );
IDocumentFieldsAccess* pIDFA = m_pTxtNode->getIDocumentFieldsAccess();
IDocumentFieldsAccess* pDestIDFA = pDest->m_pTxtNode->getIDocumentFieldsAccess();
@@ -362,7 +359,7 @@ void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
((SwDDEFieldType*)pFldType)->IncRefCnt();
}
- ASSERT( pFldType, "unbekannter FieldType" );
+ OSL_ENSURE( pFldType, "unbekannter FieldType" );
pFldType->Add( &rFmtFld ); // ummelden
rFmtFld.GetFld()->ChgTyp( pFldType );
}
@@ -385,9 +382,6 @@ void SwTxtFld::CopyFld( SwTxtFld *pDest ) const
}
}
-/* -----------------26.06.2003 13:54-----------------
-
- --------------------------------------------------*/
void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
{
//if not in undo section notify the change
@@ -398,3 +392,4 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index d3076e642ef5..59295172de57 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,15 +54,15 @@ SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt )
{
}
-int __EXPORT SwFmtFlyCnt::operator==( const SfxPoolItem& rAttr ) const
+int SwFmtFlyCnt::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return( pTxtAttr && ((SwFmtFlyCnt&)rAttr).pTxtAttr &&
*pTxtAttr->GetStart() == *((SwFmtFlyCnt&)rAttr).pTxtAttr->GetStart() &&
pFmt == ((SwFmtFlyCnt&)rAttr).GetFrmFmt() );
}
-SfxPoolItem* __EXPORT SwFmtFlyCnt::Clone( SfxItemPool* ) const
+SfxPoolItem* SwFmtFlyCnt::Clone( SfxItemPool* ) const
{
return new SwFmtFlyCnt( pFmt );
}
@@ -111,7 +112,7 @@ SwTxtFlyCnt::SwTxtFlyCnt( SwFmtFlyCnt& rAttr, xub_StrLen nStartPos )
void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
{
SwFrmFmt* pFmt = GetFlyCnt().GetFrmFmt();
- ASSERT( pFmt, "von welchem Format soll ich eine Kopie erzeugen?" )
+ OSL_ENSURE( pFmt, "von welchem Format soll ich eine Kopie erzeugen?" );
// Das FlyFrmFmt muss dupliziert werden.
// In CopyLayoutFmt (siehe doclay.cxx) wird das FlyFrmFmt erzeugt
// und der Inhalt dupliziert.
@@ -139,7 +140,7 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc )
else
{
pPos->nContent.Assign( 0, 0 );
- ASSERT( !this, "CopyFlyFmt: Was fuer ein Anker?" );
+ OSL_ENSURE( !this, "CopyFlyFmt: Was fuer ein Anker?" );
}
}
@@ -228,12 +229,12 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
SwFrmFmt* pFrmFmt = GetFlyCnt().GetFrmFmt();
if( RES_DRAWFRMFMT == pFrmFmt->Which() )
{
- ASSERT( !this, "SwTxtFlyCnt::_GetFlyFrm: DrawInCnt-Baustelle!" );
+ OSL_ENSURE( !this, "SwTxtFlyCnt::_GetFlyFrm: DrawInCnt-Baustelle!" );
return NULL;
}
SwClientIter aIter( *GetFlyCnt().pFmt );
- ASSERT( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." );
+ OSL_ENSURE( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." );
if( aIter.GoStart() )
{
@@ -282,3 +283,4 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 5a4888da552e..3e67e6d759e2 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#include <doc.hxx>
-#include <cntfrm.hxx> // ASSERT in ~SwTxtFtn()
+#include <cntfrm.hxx> // OSL_ENSURE(in ~SwTxtFtn()
#include <pagefrm.hxx> // RemoveFtn()
#include <fmtftn.hxx>
#include <txtftn.hxx>
@@ -52,10 +53,6 @@
|*
|* class SwFmtFtn
|*
-|* Beschreibung
-|* Ersterstellung JP 09.08.94
-|* Letzte Aenderung JP 08.08.94
-|*
*************************************************************************/
@@ -70,7 +67,7 @@ SwFmtFtn::SwFmtFtn( bool bEndNote )
int SwFmtFtn::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return nNumber == ((SwFmtFtn&)rAttr).nNumber &&
aNumber == ((SwFmtFtn&)rAttr).aNumber &&
m_bEndNote == ((SwFmtFtn&)rAttr).m_bEndNote;
@@ -270,7 +267,7 @@ void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const XubString* pStr )
rFtn.aNumber = aEmptyStr;
}
- ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
+ OSL_ENSURE( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
SwNodes &rNodes = m_pTxtNode->GetDoc()->GetNodes();
m_pTxtNode->Modify( 0, &rFtn );
if ( m_pStartNode )
@@ -365,7 +362,7 @@ void SwTxtFtn::MakeNewTextSection( SwNodes& rNodes )
void SwTxtFtn::DelFrms()
{
// delete the FtnFrames from the pages
- ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
+ OSL_ENSURE( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
if ( !m_pTxtNode )
return;
@@ -404,7 +401,7 @@ void SwTxtFtn::DelFrms()
SwFtnFrm *pFtn = (SwFtnFrm*)pFrm;
while ( pFtn && pFtn->GetMaster() )
pFtn = pFtn->GetMaster();
- ASSERT( pFtn->GetAttr() == this, "Ftn mismatch error." );
+ OSL_ENSURE( pFtn->GetAttr() == this, "Ftn mismatch error." );
while ( pFtn )
{
@@ -541,3 +538,4 @@ void SwTxtFtn::CheckCondColl()
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index 979a810b018b..b9c66e4b782f 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,7 +62,7 @@ SwFmtRefMark::SwFmtRefMark( const SwFmtRefMark& rAttr )
int SwFmtRefMark::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return aRefName == ((SwFmtRefMark&)rAttr).aRefName;
}
@@ -101,3 +102,4 @@ xub_StrLen* SwTxtRefMark::GetEnd()
return m_pEnd;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx
index 8c64e4b2bd29..20d63bc495be 100644
--- a/sw/source/core/txtnode/atrtox.cxx
+++ b/sw/source/core/txtnode/atrtox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,5 @@ void SwTxtTOXMark::CopyTOXMark( SwDoc* pDoc )
//
((SwTOXType*)pType)->Add( &rTOX );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/chrfmt.cxx b/sw/source/core/txtnode/chrfmt.cxx
index eb2f4be5c3e8..71d7e48f6d74 100644
--- a/sw/source/core/txtnode/chrfmt.cxx
+++ b/sw/source/core/txtnode/chrfmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,3 +37,4 @@ TYPEINIT1( SwCharFmt, SwFmt ); //rtti fuer SwCharFmt
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 236a0bab3d72..cb01967ffcad 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,9 +71,6 @@ TYPEINIT1_AUTOFACTORY(SwFmtAutoFmt, SfxPoolItem);
/*************************************************************************
|*
|* class SwFmtCharFmt
-|* Beschreibung
-|* Ersterstellung JP 23.11.90
-|* Letzte Aenderung JP 09.08.94
|*
*************************************************************************/
@@ -100,7 +98,7 @@ SwFmtCharFmt::~SwFmtCharFmt() {}
int SwFmtCharFmt::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return GetCharFmt() == ((SwFmtCharFmt&)rAttr).GetCharFmt();
}
@@ -127,26 +125,23 @@ sal_Bool SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
{
return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : sal_False;
}
-sal_Bool SwFmtCharFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const
+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 sal_True;
+ return true;
}
-sal_Bool SwFmtCharFmt::PutValue( const uno::Any& , sal_uInt8 )
+bool SwFmtCharFmt::PutValue( const uno::Any& , sal_uInt8 )
{
- DBG_ERROR("Zeichenvorlage kann mit PutValue nicht gesetzt werden!");
- return sal_False;
+ OSL_FAIL("Zeichenvorlage kann mit PutValue nicht gesetzt werden!");
+ return false;
}
/*************************************************************************
|*
|* class SwFmtAutoFmt
-|* Beschreibung
-|* Ersterstellung AMA 12.05.06
-|* Letzte Aenderung AMA 12.05.06
|*
*************************************************************************/
@@ -166,7 +161,7 @@ SwFmtAutoFmt::~SwFmtAutoFmt()
int SwFmtAutoFmt::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "different attributes" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "different attributes" );
return mpHandle == ((SwFmtAutoFmt&)rAttr).mpHandle;
}
@@ -175,25 +170,22 @@ SfxPoolItem* SwFmtAutoFmt::Clone( SfxItemPool* ) const
return new SwFmtAutoFmt( *this );
}
-sal_Bool SwFmtAutoFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const
+bool SwFmtAutoFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const
{
String sCharFmtName = StylePool::nameOf( mpHandle );
rVal <<= OUString( sCharFmtName );
- return sal_True;
+ return true;
}
-sal_Bool SwFmtAutoFmt::PutValue( const uno::Any& , sal_uInt8 )
+bool SwFmtAutoFmt::PutValue( const uno::Any& , sal_uInt8 )
{
//the format is not renameable via API
- return sal_False;
+ return false;
}
/*************************************************************************
|*
|* class SwFmtINetFmt
-|* Beschreibung
-|* Ersterstellung AMA 02.08.96
-|* Letzte Aenderung AMA 02.08.96
|*
*************************************************************************/
@@ -241,7 +233,7 @@ SwFmtINetFmt::~SwFmtINetFmt()
int SwFmtINetFmt::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
sal_Bool bRet = SfxPoolItem::operator==( (SfxPoolItem&) rAttr )
&& aURL == ((SwFmtINetFmt&)rAttr).aURL
&& aName == ((SwFmtINetFmt&)rAttr).aName
@@ -331,9 +323,9 @@ const SvxMacro* SwFmtINetFmt::GetMacro( sal_uInt16 nEvent ) const
-sal_Bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
+bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
XubString sVal;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
@@ -379,9 +371,9 @@ sal_Bool SwFmtINetFmt::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= OUString(sVal);
return bRet;
}
-sal_Bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
+bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
nMemberId &= ~CONVERT_TWIPS;
// all properties except HyperlinkEvents are of type string, hence
@@ -403,14 +395,14 @@ sal_Bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
else
{
// wrong type!
- bRet = sal_False;
+ bRet = false;
}
}
else
{
// all string properties:
if(rVal.getValueType() != ::getCppuType((rtl::OUString*)0))
- return sal_False;
+ return false;
XubString sVal = *(rtl::OUString*)rVal.getValue();
switch(nMemberId)
{
@@ -441,7 +433,7 @@ sal_Bool SwFmtINetFmt::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
}
return bRet;
@@ -490,7 +482,7 @@ SwFmtRuby& SwFmtRuby::operator=( const SwFmtRuby& rAttr )
int SwFmtRuby::operator==( const SfxPoolItem& rAttr ) const
{
- ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
+ OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
return sRubyTxt == ((SwFmtRuby&)rAttr).sRubyTxt &&
sCharFmtName == ((SwFmtRuby&)rAttr).sCharFmtName &&
nCharFmtId == ((SwFmtRuby&)rAttr).nCharFmtId &&
@@ -503,10 +495,10 @@ SfxPoolItem* SwFmtRuby::Clone( SfxItemPool* ) const
return new SwFmtRuby( *this );
}
-sal_Bool SwFmtRuby::QueryValue( uno::Any& rVal,
+bool SwFmtRuby::QueryValue( uno::Any& rVal,
sal_uInt8 nMemberId ) const
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
{
@@ -526,14 +518,14 @@ sal_Bool SwFmtRuby::QueryValue( uno::Any& rVal,
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
-sal_Bool SwFmtRuby::PutValue( const uno::Any& rVal,
+bool SwFmtRuby::PutValue( const uno::Any& rVal,
sal_uInt8 nMemberId )
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
nMemberId &= ~CONVERT_TWIPS;
switch( nMemberId )
{
@@ -551,7 +543,7 @@ sal_Bool SwFmtRuby::PutValue( const uno::Any& rVal,
if(nSet >= 0 && nSet <= text::RubyAdjust_INDENT_BLOCK)
nAdjustment = nSet;
else
- bRet = sal_False;
+ bRet = false;
}
break;
case MID_RUBY_ABOVE:
@@ -573,7 +565,7 @@ sal_Bool SwFmtRuby::PutValue( const uno::Any& rVal,
}
break;
default:
- bRet = sal_False;
+ bRet = false;
}
return bRet;
}
@@ -593,7 +585,7 @@ SwFmtMeta::SwFmtMeta(const sal_uInt16 i_nWhich)
, m_pMeta()
, m_pTxtAttr( 0 )
{
- ASSERT((RES_TXTATR_META == i_nWhich) || (RES_TXTATR_METAFIELD == i_nWhich),
+ OSL_ENSURE((RES_TXTATR_META == i_nWhich) || (RES_TXTATR_METAFIELD == i_nWhich),
"ERROR: SwFmtMeta: invalid which id!");
}
@@ -603,9 +595,9 @@ SwFmtMeta::SwFmtMeta( ::boost::shared_ptr< ::sw::Meta > const & i_pMeta,
, m_pMeta( i_pMeta )
, m_pTxtAttr( 0 )
{
- ASSERT((RES_TXTATR_META == i_nWhich) || (RES_TXTATR_METAFIELD == i_nWhich),
+ OSL_ENSURE((RES_TXTATR_META == i_nWhich) || (RES_TXTATR_METAFIELD == i_nWhich),
"ERROR: SwFmtMeta: invalid which id!");
- ASSERT(m_pMeta, "SwFmtMeta: no Meta ?");
+ OSL_ENSURE(m_pMeta, "SwFmtMeta: no Meta ?");
// DO NOT call m_pMeta->SetFmtMeta(this) here; only from SetTxtAttr!
}
@@ -619,7 +611,7 @@ SwFmtMeta::~SwFmtMeta()
int SwFmtMeta::operator==( const SfxPoolItem & i_rOther ) const
{
- ASSERT( SfxPoolItem::operator==( i_rOther ), "i just copied this assert" );
+ OSL_ENSURE( SfxPoolItem::operator==( i_rOther ), "i just copied this assert" );
return SfxPoolItem::operator==( i_rOther )
&& (m_pMeta == static_cast<SwFmtMeta const &>( i_rOther ).m_pMeta);
}
@@ -633,12 +625,12 @@ SfxPoolItem * SwFmtMeta::Clone( SfxItemPool * /*pPool*/ ) const
void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr)
{
- ASSERT(!(m_pTxtAttr && i_pTxtAttr),
+ OSL_ENSURE(!(m_pTxtAttr && i_pTxtAttr),
"SwFmtMeta::SetTxtAttr: already has text attribute?");
- ASSERT( m_pTxtAttr || i_pTxtAttr ,
+ OSL_ENSURE( m_pTxtAttr || i_pTxtAttr ,
"SwFmtMeta::SetTxtAttr: no attribute to remove?");
m_pTxtAttr = i_pTxtAttr;
- ASSERT(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "inserted SwFmtMeta has no sw::Meta?");
// the sw::Meta must be able to find the current text attribute!
if (i_pTxtAttr && m_pMeta)
{
@@ -650,7 +642,7 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
{
// N.B.: do not reset m_pTxtAttr here: see call in nodes.cxx,
// where the hint is not deleted!
- ASSERT(m_pMeta, "NotifyRemoval: no meta ?");
+ OSL_ENSURE(m_pMeta, "NotifyRemoval: no meta ?");
if (m_pMeta)
{
if (!pTxtNode)
@@ -670,7 +662,7 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
// and if it is not called when copying, total chaos will undoubtedly ensue
void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta)
{
- ASSERT(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
+ OSL_ENSURE(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?");
if (m_pMeta)
{
const ::boost::shared_ptr< ::sw::Meta> pOriginal( m_pMeta );
@@ -906,3 +898,4 @@ MetaFieldManager::getMetaFields()
} // namespace sw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 755e8bf1026e..c92c795f51e7 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,24 +30,14 @@
#include "precompiled_sw.hxx"
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
-#ifndef _PRINT_HXX //autogen
#include <vcl/print.hxx>
-#endif
#include <vcl/lineinfo.hxx>
-#ifndef _METRIC_HXX //autogen
#include <vcl/metric.hxx>
-#endif
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
-#ifndef _COM_SUN_STAR_I18N_CHARACTERITERATORMODE_HDL_
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
-#endif
-#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL
#include <com/sun/star/i18n/WordType.hdl>
-#endif
#include <breakit.hxx>
#include <viewsh.hxx> // Bildschirmabgleich
#include <viewopt.hxx> // Bildschirmabgleich abschalten, ViewOption
@@ -68,9 +59,7 @@
#include <doc.hxx>
#include <editeng/fhgtitem.hxx>
#include <docsh.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
using namespace ::com::sun::star;
@@ -108,9 +97,6 @@ sal_uInt16 GetDefaultFontHeight( SwDrawTextInfo &rInf )
|*
|* SwFntCache::Flush()
|*
-|* Ersterstellung AMA 16. Dez. 94
-|* Letzte Aenderung AMA 16. Dez. 94
-|*
|*************************************************************************/
void SwFntCache::Flush( )
@@ -127,9 +113,6 @@ void SwFntCache::Flush( )
|*
|* SwFntObj::SwFntObj(), ~SwFntObj()
|*
-|* Ersterstellung AMA 7. Nov. 94
-|* Letzte Aenderung AMA 7. Nov. 94
-|*
|*************************************************************************/
SwFntObj::SwFntObj( const SwSubFont &rFont, const void *pOwn, ViewShell *pSh ) :
@@ -303,9 +286,6 @@ void lcl_calcLinePos( const CalcLinePosData &rData,
*
* sal_uInt16 SwFntObj::GetFontAscent( const OutputDevice& rOut )
*
- * Ersterstellung AMA 7. Nov. 94
- * Letzte Aenderung AMA 7. Nov. 94
- *
* Beschreibung: liefern den Ascent des Fonts auf dem
* gewuenschten Outputdevice zurueck, ggf. muss der Bildschirmfont erst
* erzeugt werden.
@@ -319,7 +299,7 @@ sal_uInt16 SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rO
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
{
CreateScrFont( *pSh, rOut );
- ASSERT( USHRT_MAX != nScrAscent, "nScrAscent is going berzerk" )
+ OSL_ENSURE( USHRT_MAX != nScrAscent, "nScrAscent is going berzerk" );
nRet = nScrAscent;
}
else
@@ -342,7 +322,7 @@ sal_uInt16 SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rO
nRet += GetFontLeading( pSh, rRefDev );
#endif
- ASSERT( USHRT_MAX != nRet, "GetFontAscent returned USHRT_MAX" )
+ OSL_ENSURE( USHRT_MAX != nRet, "GetFontAscent returned USHRT_MAX" );
return nRet;
}
@@ -350,9 +330,6 @@ sal_uInt16 SwFntObj::GetFontAscent( const ViewShell *pSh, const OutputDevice& rO
*
* sal_uInt16 SwFntObj::GetFontHeight( const OutputDevice* pOut )
*
- * Ersterstellung AMA 7. Nov. 94
- * Letzte Aenderung AMA 7. Nov. 94
- *
* Beschreibung: liefern die H?he des Fonts auf dem
* gewuenschten Outputdevice zurueck, ggf. muss der Bildschirmfont erst
* erzeugt werden.
@@ -366,7 +343,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rO
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
{
CreateScrFont( *pSh, rOut );
- ASSERT( USHRT_MAX != nScrHeight, "nScrHeight is going berzerk" )
+ OSL_ENSURE( USHRT_MAX != nScrHeight, "nScrHeight is going berzerk" );
nRet = nScrHeight + GetFontLeading( pSh, rRefDev );
}
else
@@ -384,7 +361,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rO
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,
+ OSL_ENSURE( abs(nTmpPrtHeight - nPrtHeight) < 3,
"GetTextHeight != Ascent + Descent" );
#endif
@@ -394,7 +371,7 @@ sal_uInt16 SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rO
nRet = nPrtHeight + GetFontLeading( pSh, rRefDev );
}
- ASSERT( USHRT_MAX != nRet, "GetFontHeight returned USHRT_MAX" )
+ OSL_ENSURE( USHRT_MAX != nRet, "GetFontHeight returned USHRT_MAX" );
return nRet;
}
@@ -426,7 +403,7 @@ sal_uInt16 SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& r
nRet = nGuessedLeading;
}
- ASSERT( USHRT_MAX != nRet, "GetFontLeading returned USHRT_MAX" )
+ OSL_ENSURE( USHRT_MAX != nRet, "GetFontLeading returned USHRT_MAX" );
return nRet;
}
@@ -435,9 +412,6 @@ sal_uInt16 SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& r
*
* SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
*
- * Ersterstellung AMA 7. Nov. 94
- * Letzte Aenderung AMA 7. Nov. 94
- *
* pOut is the output device, not the reference device
*
*************************************************************************/
@@ -590,7 +564,7 @@ void SwFntObj::GuessLeading( const ViewShell&
aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading );
if( nDiff > 0 )
{
- ASSERT( nPrtAscent < USHRT_MAX, "GuessLeading: PrtAscent-Fault" );
+ OSL_ENSURE( nPrtAscent < USHRT_MAX, "GuessLeading: PrtAscent-Fault" );
if ( nPrtAscent < USHRT_MAX )
nPrtAscent = nPrtAscent + (sal_uInt16)(( 2 * nDiff ) / 5);
}
@@ -614,9 +588,6 @@ void SwFntObj::GuessLeading( const ViewShell&
*
* void SwFntObj::SetDeviceFont( const OutputDevice *pOut ),
*
- * Ersterstellung AMA 7. Nov. 94
- * Letzte Aenderung AMA 7. Nov. 94
- *
* Beschreibung: stellt den Font am gewuenschten OutputDevice ein,
* am Bildschirm muss eventuell erst den Abgleich durchgefuehrt werden.
*
@@ -654,9 +625,6 @@ void SwFntObj::SetDevFont( const ViewShell *pSh, OutputDevice& rOut )
*
* void SwFntObj::DrawText( ... )
*
- * Ersterstellung AMA 16. Dez. 94
- * Letzte Aenderung AMA 16. Dez. 94
- *
* Beschreibung: Textausgabe
* auf dem Bildschirm => DrawTextArray
* auf dem Drucker, !Kerning => DrawText
@@ -828,7 +796,7 @@ static void lcl_DrawLineForWrongListData(
void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
- ASSERT( rInf.GetShell(), "SwFntObj::DrawText without shell" )
+ OSL_ENSURE( rInf.GetShell(), "SwFntObj::DrawText without shell" );
OutputDevice& rRefDev = rInf.GetShell()->GetRefDev();
OutputDevice* pWin = rInf.GetShell()->GetWin();
@@ -872,7 +840,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// a window. Therefore bUseSrcFont is always 0 in this case.
//
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const sal_Bool bNoAdjust = bPrt ||
( pWin &&
@@ -884,15 +852,15 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Printer output
if ( OUTDEV_PRINTER == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 1 && bUseScrFont == 0, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 1 && bUseScrFont == 0, "Outdev Check failed" );
}
else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" );
}
else
{
- ASSERT( sal_False, "Outdev Check failed" )
+ OSL_ENSURE( sal_False, "Outdev Check failed" );
}
}
else if ( OUTDEV_VIRDEV == rInf.GetOut().GetOutDevType() && ! pWin )
@@ -900,15 +868,15 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// PDF export
if ( OUTDEV_PRINTER == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" );
}
else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" );
}
else
{
- ASSERT( sal_False, "Outdev Check failed" )
+ OSL_ENSURE( sal_False, "Outdev Check failed" );
}
}
else if ( OUTDEV_WINDOW == rInf.GetOut().GetOutDevType() ||
@@ -917,30 +885,30 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// Window or virtual window
if ( OUTDEV_PRINTER == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" );
}
else if ( OUTDEV_VIRDEV == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 0 && bUseScrFont == 1, "Outdev Check failed" );
}
else if ( OUTDEV_WINDOW == rRefDev.GetOutDevType() )
{
- ASSERT( bNoAdjust == 1 && bUseScrFont == 0, "Outdev Check failed" )
+ OSL_ENSURE( bNoAdjust == 1 && bUseScrFont == 0, "Outdev Check failed" );
}
else
{
- ASSERT( sal_False, "Outdev Check failed" )
+ OSL_ENSURE( sal_False, "Outdev Check failed" );
}
}
else
{
- ASSERT( sal_False, "Outdev Check failed" )
+ OSL_ENSURE( sal_False, "Outdev Check failed" );
}
#endif
// robust: better use the printer font instead of using no font at all
- ASSERT( pTmpFont, "No screen or printer font?" );
+ OSL_ENSURE( pTmpFont, "No screen or printer font?" );
if ( ! pTmpFont )
pTmpFont = pPrtFont;
@@ -1468,7 +1436,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
rInf.GetIdx(), rInf.GetLen() );
// OLE: no printer available
- // ASSERT( pPrinter, "DrawText needs pPrinter" )
+ // OSL_ENSURE( pPrinter, "DrawText needs pPrinter" )
if ( pPrinter )
{
// pTmpFont has already been set as current font for rInf.GetOut()
@@ -1482,21 +1450,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
else
{
-// sal_Bool bRestore = sal_False;
-// MapMode aOld( rInf.GetOut().GetMapMode() );
-// if( rInf.GetZoom().GetNumerator() &&
-// rInf.GetZoom() != aOld.GetScaleX() )
-// {
-// MapMode aNew( aOld );
-// aNew.SetScaleX( rInf.GetZoom() );
-// aNew.SetScaleY( rInf.GetZoom() );
-// rInf.GetOut().SetMapMode( aNew );
-// bRestore = sal_True;
-// }
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
-// if( bRestore )
-// rInf.GetOut().SetMapMode( aOld );
}
//
@@ -1659,7 +1614,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
nCh = rInf.GetText().GetChar( rInf.GetIdx() + i );
- ASSERT( pScrArray, "Where is the screen array?" )
+ OSL_ENSURE( pScrArray, "Where is the screen array?" );
long nScr;
nScr = pScrArray[ i ] - pScrArray[ i - 1 ];
@@ -1669,11 +1624,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// linksbuendig zur Druckerposition.
if ( nCh == CH_BLANK )
{
-#ifdef FONT_TEST_DEBUG
- lcl_Pos( 3, nScrPos, nScr, pKernArray[i-1], pKernArray[i] );
-#else
nScrPos = pKernArray[i-1] + nScr;
-#endif
+
if ( cChPrev == CH_BLANK )
nSpaceSum += nOtherHalf;
if ( i + 1 == nCnt )
@@ -1685,28 +1637,17 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
if ( cChPrev == CH_BLANK )
{
-#ifdef FONT_TEST_DEBUG
- lcl_Pos( 6, nScrPos, nScr, pKernArray[i-1], pKernArray[i] );
-#else
nScrPos = pKernArray[i-1] + nScr;
-#endif
+
// kein Pixel geht verloren:
nSpaceSum += nOtherHalf;
}
else if ( cChPrev == '-' )
-#ifdef FONT_TEST_DEBUG
- lcl_Pos( 6, nScrPos, nScr, pKernArray[i-1], pKernArray[i] );
-#else
nScrPos = pKernArray[i-1] + nScr;
-#endif
else
{
-#ifdef FONT_TEST_DEBUG
- lcl_Pos( 0, nScrPos, nScr, pKernArray[i-1], pKernArray[i] );
-#else
nScrPos += nScr;
nScrPos = ( nMul * nScrPos + pKernArray[i] ) / nDiv;
-#endif
}
}
cChPrev = nCh;
@@ -1818,31 +1759,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
xub_StrLen nOffs = 0;
xub_StrLen nLen = rInf.GetLen();
-#ifdef COMING_SOON
- if( aPos.X() < rInf.GetLeft() )
- {
- while( nOffs < nLen &&
- aPos.X() + pKernArray[ nOffs ] < rInf.GetLeft() )
- ++nOffs;
- if( nOffs < nLen )
- {
- --nLen;
- while( nLen > nOffs &&
- aPos.X() + pKernArray[ nLen ] > rInf.GetRight() )
- --nLen;
- ++nLen;
- if( nOffs )
- --nOffs;
- }
- if( nOffs )
- {
- long nDiff = pKernArray[ nOffs - 1 ];
- aPos.X() += nDiff;
- for( xub_StrLen nX = nOffs; nX < nLen; ++nX )
- pKernArray[ nX ] -= nDiff;
- }
- }
-#endif
+
if( nOffs < nLen )
{
// If we paint bullets instead of spaces, we use a copy of
@@ -1880,9 +1797,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
* Size SwFntObj::GetTextSize( const OutputDevice *pOut, const String &rTxt,
* const sal_uInt16 nIdx, const sal_uInt16 nLen, const short nKern = 0 );
*
- * Ersterstellung AMA 16. Dez. 94
- * Letzte Aenderung AMA 16. Dez. 94
- *
* Beschreibung: ermittelt die TextSize (des Druckers)
*
*************************************************************************/
@@ -1923,9 +1837,9 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
aTxtSize.Width() =
pOutDev->GetTextWidth( rInf.GetText(), rInf.GetIdx(), nLn );
- ASSERT( !rInf.GetShell() ||
+ OSL_ENSURE( !rInf.GetShell() ||
( USHRT_MAX != GetGuessedLeading() && USHRT_MAX != GetExtLeading() ),
- "Leading values should be already calculated" )
+ "Leading values should be already calculated" );
aTxtSize.Height() = pOutDev->GetTextHeight() +
GetFontLeading( rInf.GetShell(), rInf.GetOut() );
@@ -1984,7 +1898,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
rInf.GetScriptInfo()->CountCompChg() &&
lcl_IsMonoSpaceFont( rInf.GetOut() );
- ASSERT( !bCompress || ( rInf.GetScriptInfo() && rInf.GetScriptInfo()->
+ OSL_ENSURE( !bCompress || ( rInf.GetScriptInfo() && rInf.GetScriptInfo()->
CountCompChg()), "Compression without info" );
// This is the part used e.g., for cursor travelling
@@ -2087,9 +2001,9 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
if ( rInf.GetKern() && nLn )
aTxtSize.Width() += ( nLn - 1 ) * long( rInf.GetKern() );
- ASSERT( !rInf.GetShell() ||
+ OSL_ENSURE( !rInf.GetShell() ||
( USHRT_MAX != GetGuessedLeading() && USHRT_MAX != GetExtLeading() ),
- "Leading values should be already calculated" )
+ "Leading values should be already calculated" );
aTxtSize.Height() += GetFontLeading( rInf.GetShell(), rInf.GetOut() );
return aTxtSize;
}
@@ -2308,9 +2222,6 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
|*
|* SwFntAccess::SwFntAccess()
|*
-|* Ersterstellung AMA 9. Nov. 94
-|* Letzte Aenderung AMA 9. Nov. 94
-|*
|*************************************************************************/
SwFntAccess::SwFntAccess( const void* &rMagic,
@@ -2389,14 +2300,14 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
// SwFont sein, spaeter wird als Owner die "MagicNumber" gehalten.
SwCacheAccess::pOwner = pOwn;
pFntObj = Get(); // hier wird via NewObj() angelegt und gelockt.
- ASSERT(pFntObj, "No Font, no Fun.");
+ OSL_ENSURE(pFntObj, "No Font, no Fun.");
}
else // Font has been found, so we lock it.
{
pFntObj->Lock();
if( pFntObj->pPrinter != pOut ) // Falls bis dato kein Drucker bekannt
{
- ASSERT( !pFntObj->pPrinter, "SwFntAccess: Printer Changed" );
+ OSL_ENSURE( !pFntObj->pPrinter, "SwFntAccess: Printer Changed" );
pFntObj->CreatePrtFont( *pOut );
pFntObj->pPrinter = pOut;
pFntObj->pScrFont = NULL;
@@ -2439,7 +2350,7 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
rInf.GetScriptInfo()->CountCompChg() &&
lcl_IsMonoSpaceFont( rInf.GetOut() );
- ASSERT( !bCompress || ( rInf.GetScriptInfo() && rInf.GetScriptInfo()->
+ OSL_ENSURE( !bCompress || ( rInf.GetScriptInfo() && rInf.GetScriptInfo()->
CountCompChg()), "Compression without info" );
sal_uInt16 nTxtBreak = 0;
@@ -2738,3 +2649,4 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
return sal_False;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 69426bcffa34..8a40614a3d93 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,21 +32,13 @@
#include <hintids.hxx>
#include <editeng/cmapitem.hxx>
+#include <editeng/svxfont.hxx>
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
-#ifndef _COM_SUN_STAR_I18N_CHARTYPE_HDL
#include <com/sun/star/i18n/CharType.hdl>
-#endif
-#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL
#include <com/sun/star/i18n/WordType.hdl>
-#endif
-#ifndef _PRINT_HXX //autogen
#include <vcl/print.hxx>
-#endif
-#include <errhdl.hxx>
#include <fntcache.hxx>
#include <swfont.hxx>
#include <breakit.hxx>
@@ -54,9 +47,6 @@
using namespace ::com::sun::star::i18n;
-
-#define KAPITAELCHENPROP 66
-
/*************************************************************************
* class SwCapitalInfo
*
@@ -95,7 +85,7 @@ xub_StrLen lcl_CalcCaseMap( const SwFont& rFnt,
{
int j = 0;
const xub_StrLen nEnd = nOfst + nLen;
- ASSERT( nEnd <= rOrigString.Len(), "lcl_CalcCaseMap: Wrong parameters" )
+ OSL_ENSURE( nEnd <= rOrigString.Len(), "lcl_CalcCaseMap: Wrong parameters" );
// special case for title case:
const bool bTitle = SVX_CASEMAP_TITEL == rFnt.GetCaseMap() &&
@@ -298,7 +288,7 @@ protected:
SwFntObj *pLowerFnt;
public:
SwDoDrawCapital( SwDrawTextInfo &rInfo ) :
- SwDoCapitals( rInfo )
+ SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0)
{ }
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
@@ -326,7 +316,7 @@ void SwDoDrawCapital::Do()
rInf.SetBullet( bOldBullet );
}
- ASSERT( pUpperFnt, "No upper font, dying soon!");
+ OSL_ENSURE( pUpperFnt, "No upper font, dying soon!");
rInf.Shift( pUpperFnt->GetFont()->GetOrientation() );
rInf.SetWidth( nOrgWidth );
}
@@ -337,7 +327,7 @@ void SwDoDrawCapital::Do()
void SwDoDrawCapital::DrawSpace( Point &rPos )
{
- static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+ static sal_Char const sDoubleSpace[] = " ";
long nDiff = rInf.GetPos().X() - rPos.X();
@@ -396,7 +386,7 @@ protected:
sal_uInt16 nOfst;
public:
SwDoCapitalCrsrOfst( SwDrawTextInfo &rInfo, const sal_uInt16 nOfs ) :
- SwDoCapitals( rInfo ), nCrsr( 0 ), nOfst( nOfs )
+ SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0), nCrsr( 0 ), nOfst( nOfs )
{ }
virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont );
virtual void Do();
@@ -564,7 +554,7 @@ void SwSubFont::DrawStretchCapital( SwDrawTextInfo &rInf )
void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
{
- ASSERT( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" );
+ OSL_ENSURE( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" );
Size aPartSize;
long nKana = 0;
@@ -633,7 +623,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pBigFont = pLastFont;
// Hier entsteht der Kleinbuchstabenfont:
- aFont.SetProportion( sal_uInt8( (aFont.GetPropr()*KAPITAELCHENPROP) / 100L) );
+ aFont.SetProportion( sal_uInt8 (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L);
pMagic2 = NULL;
nIndex2 = 0;
SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,
@@ -703,8 +693,8 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pBreakIt->GetLocale( eLng ), CharType::LOWERCASE_LETTER);
if( nPos == STRING_LEN || nPos > nMaxPos )
nPos = nMaxPos;
- ASSERT( nPos, "nextCharBlock not implemented?" );
-#ifdef DBG_UTIL
+ OSL_ENSURE( nPos, "nextCharBlock not implemented?" );
+#if OSL_DEBUG_LEVEL > 1
if( !nPos )
nPos = nMaxPos;
#endif
@@ -817,8 +807,8 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
pBreakIt->GetLocale( eLng ), CharType::LOWERCASE_LETTER);
if( nPos == STRING_LEN || nPos > nMaxPos )
nPos = nMaxPos;
- ASSERT( nPos, "endOfCharBlock not implemented?" );
-#ifdef DBG_UTIL
+ OSL_ENSURE( nPos, "endOfCharBlock not implemented?" );
+#if OSL_DEBUG_LEVEL > 1
if( !nPos )
nPos = nMaxPos;
#endif
@@ -853,3 +843,4 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index 723c12bddbdc..8d4940b1ec67 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,5 @@ ModelPosition ConvertToModelPosition( const ConversionMap* pMap, sal_uInt32 nVie
}
} // namespace ModelToViewStringConverter end
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index 70cd84706ca8..d0e0974f2ed0 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "txatbase.hxx"
#include "ndhints.hxx"
#include <txtatr.hxx>
-#ifndef PRODUCT
+#if OSL_DEBUG_LEVEL > 1
#include <pam.hxx>
#endif
@@ -42,40 +41,7 @@
_SV_IMPL_SORTAR_ALG( SwpHtStart, SwTxtAttr* )
_SV_IMPL_SORTAR_ALG( SwpHtEnd, SwTxtAttr* )
-#ifdef NIE
-
-void DumpHints( const SwpHtStart &rHtStart,
- const SwpHtEnd &rHtEnd )
-{
-#ifdef DBG_UTIL
- aDbstream << "DumpHints:" << endl;
- (aDbstream << "\tStarts:" ).WriteNumber(rHtStart.Count()) << endl;
- for( sal_uInt16 i = 0; i < rHtStart.Count(); ++i )
- {
- const SwTxtAttr *pHt = rHtStart[i];
- ((((aDbstream << '\t').WriteNumber( i )<< " [").WriteNumber( pHt->Which() )
- << ']' << '\t').WriteNumber( long( pHt ) )
- << '\t').WriteNumber( *pHt->GetStart() );
- if( pHt->GetEnd() )
- (aDbstream << " -> " ).WriteNumber( *pHt->GetEnd() );
- aDbstream << endl;
- }
- (aDbstream << "\tEnds:").WriteNumber( rHtEnd.Count() )<< endl;
- for( i = 0; i < rHtEnd.Count(); ++i )
- {
- const SwTxtAttr *pHt = rHtEnd[i];
- (((aDbstream << '\t').WriteNumber( i )<< " [").WriteNumber( pHt->Which() )
- << ']' << '\t' ).WriteNumber( long( pHt ) );
- if( pHt->GetEnd() )
- (aDbstream << '\t').WriteNumber( *pHt->GetEnd() )<< " <- ";
- aDbstream.WriteNumber( *pHt->GetStart() )<< endl;
- }
- aDbstream << endl;
-#endif
-}
-#else
inline void DumpHints(const SwpHtStart &, const SwpHtEnd &) { }
-#endif
/*************************************************************************
* inline IsEqual()
@@ -113,7 +79,7 @@ static sal_Bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
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" )
+ OSL_ENSURE( nS1 != nS2, "AUTOSTYLES: lcl_IsLessStart trouble" );
if ( nS1 != nS2 ) // robust
return nS1 < nS2;
}
@@ -149,7 +115,7 @@ static sal_Bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 )
{
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" )
+ OSL_ENSURE( nS1 != nS2, "AUTOSTYLES: lcl_IsLessEnd trouble" );
if ( nS1 != nS2 ) // robust
return nS1 > nS2;
}
@@ -244,21 +210,15 @@ sal_Bool SwpHtEnd::Seek_Entry( const SwTxtAttr *pElement, sal_uInt16 *pPos ) con
void SwpHintsArray::Insert( const SwTxtAttr *pHt )
{
Resort();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nPos;
- ASSERT(!m_HintStarts.Seek_Entry( pHt, &nPos ),
+ OSL_ENSURE(!m_HintStarts.Seek_Entry( pHt, &nPos ),
"Insert: hint already in HtStart");
- ASSERT(!m_HintEnds.Seek_Entry( pHt, &nPos ),
+ OSL_ENSURE(!m_HintEnds.Seek_Entry( pHt, &nPos ),
"Insert: hint already in HtEnd");
#endif
m_HintStarts.Insert( pHt );
m_HintEnds.Insert( pHt );
-#ifdef DBG_UTIL
-#ifdef NIE
- (aDbstream << "Insert: " ).WriteNumber( long( pHt ) ) << endl;
- DumpHints( m_HintStarts, m_HintEnds );
-#endif
-#endif
}
void SwpHintsArray::DeleteAtPos( const sal_uInt16 nPos )
@@ -272,15 +232,9 @@ void SwpHintsArray::DeleteAtPos( const sal_uInt16 nPos )
sal_uInt16 nEndPos;
m_HintEnds.Seek_Entry( pHt, &nEndPos );
m_HintEnds.Remove( nEndPos );
-#ifdef DBG_UTIL
-#ifdef NIE
- (aDbstream << "DeleteAtPos: " ).WriteNumber( long( pHt ) ) << endl;
- DumpHints( m_HintStarts, m_HintEnds );
-#endif
-#endif
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
/*************************************************************************
* SwpHintsArray::Check()
@@ -290,7 +244,7 @@ void SwpHintsArray::DeleteAtPos( const sal_uInt16 nPos )
#define CHECK_ERR(cond, text) \
if(!(cond)) \
{ \
- ASSERT(!this, text); \
+ OSL_ENSURE(!this, text); \
DumpHints(m_HintStarts, m_HintEnds); \
return !(const_cast<SwpHintsArray*>(this))->Resort(); \
}
@@ -368,7 +322,6 @@ bool SwpHintsArray::Check() const
"HintsCheck: Character attribute in end array" );
// 8) style portion check
-#if OSL_DEBUG_LEVEL > 1
const SwTxtAttr* pHtThis = m_HintStarts[i];
const SwTxtAttr* pHtLast = i > 0 ? m_HintStarts[i-1] : 0;
CHECK_ERR( 0 == i ||
@@ -418,7 +371,6 @@ bool SwpHintsArray::Check() const
}
}
}
-#endif
}
return true;
}
@@ -445,13 +397,6 @@ bool SwpHintsArray::Resort()
const SwTxtAttr *pHt = m_HintStarts[i];
if( pLast && !lcl_IsLessStart( *pLast, *pHt ) )
{
-#ifdef NIE
-#ifdef DBG_UTIL
-// ASSERT( bResort, "!Resort/Start: correcting hints-array" );
- aDbstream << "Resort: Starts" << endl;
- DumpHints( m_HintStarts, m_HintEnds );
-#endif
-#endif
m_HintStarts.Remove( i );
m_HintStarts.Insert( pHt );
pHt = m_HintStarts[i];
@@ -468,12 +413,6 @@ bool SwpHintsArray::Resort()
const SwTxtAttr *pHt = m_HintEnds[i];
if( pLast && !lcl_IsLessEnd( *pLast, *pHt ) )
{
-#ifdef NIE
-#ifdef DBG_UTIL
- aDbstream << "Resort: Ends" << endl;
- DumpHints( m_HintStarts, m_HintEnds );
-#endif
-#endif
m_HintEnds.Remove( i );
m_HintEnds.Insert( pHt );
pHt = m_HintEnds[i]; // normalerweise == pLast
@@ -485,13 +424,8 @@ bool SwpHintsArray::Resort()
}
pLast = pHt;
}
-#ifdef DBG_UTIL
-#ifdef NIE
- aDbstream << "Resorted:" << endl;
- DumpHints( m_HintStarts, m_HintEnds );
-#endif
-#endif
return bResort;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9a2767977d84..18a7b8094633 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <editeng/brkitem.hxx>
#include <editeng/escpitem.hxx>
#include <editeng/lrspitem.hxx>
-// --> OD 2008-01-17 #newlistlevelattrs#
#include <editeng/tstpitem.hxx>
-// <--
#include <svl/urihelper.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_ULONGS
@@ -68,7 +67,6 @@
#include <docary.hxx>
#include <pam.hxx> // fuer SwPosition
#include <fldbas.hxx>
-#include <errhdl.hxx>
#include <paratr.hxx>
#include <txtfrm.hxx>
#include <ftnfrm.hxx>
@@ -89,16 +87,11 @@
#include <SwStyleNameMapper.hxx>
#include <numrule.hxx>
-//--> #outlinelevel added by zhaojianwei
-#include <svl/intitem.hxx>
-//<--end
#include <swtable.hxx>
#include <docsh.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-02-25 #refactorlists#
#include <svl/intitem.hxx>
#include <list.hxx>
-// <--
using namespace ::com::sun::star;
@@ -113,7 +106,7 @@ SV_DECL_PTRARR(SwpHts,SwTxtAttr*,1,1)
// Leider ist das SwpHints nicht ganz wasserdicht:
// Jeder darf an den Hints rumfummeln, ohne die Sortierreihenfolge
// und Verkettung sicherstellen zu muessen.
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_SWPHINTS(pNd) { if( pNd->GetpSwpHints() && \
!pNd->GetDoc()->IsInReading() ) \
pNd->GetpSwpHints()->Check(); }
@@ -125,30 +118,20 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
SwTxtFmtColl *pColl,
SwAttrSet* pAutoAttr )
{
- ASSERT( pColl, "Collectionpointer ist 0." );
+ OSL_ENSURE( pColl, "Collectionpointer ist 0." );
SwTxtNode *pNode = new SwTxtNode( rWhere, pColl, pAutoAttr );
SwNodeIndex aIdx( *pNode );
- // --> OD 2005-11-03 #125329#
+ // #125329#
// call method <UpdateOutlineNode(..)> only for the document nodes array
if ( IsDocNodes() )
{
- //if ( pColl && NO_NUMBERING != pColl->GetOutlineLevel() ) //#outline level,removed by zhaojianwei
- //{
- // UpdateOutlineNode( *pNode, NO_NUMBERING, pColl->GetOutlineLevel() );
- //}
-// if ( pColl && 0 != pColl->GetAttrOutlineLevel() )//#outline level,added by zhaojianwei
-// {
-// UpdateOutlineNode( *pNode, 0, pColl->GetAttrOutlineLevel() );
-// }//<--end
-// else
{
UpdateOutlineNode(*pNode);
}
}
- // <--
//Wenn es noch kein Layout gibt oder in einer versteckten Section
// stehen, brauchen wir uns um das MakeFrms nicht bemuehen.
@@ -236,13 +219,10 @@ SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere,
mpNodeNum( 0 ),
m_bLastOutlineState( false ),
m_bNotifiable( false ),
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
mbEmptyListStyleSetDueToSetOutlineLevelAttr( false ),
- // <--
- // --> OD 2008-05-06 #refactorlists#
mbInSetOrResetAttr( false ),
mpList( 0 )
- // <--
{
InitSwParaStatistics( true );
@@ -250,11 +230,9 @@ SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere,
if( pAutoAttr )
SetAttr( *pAutoAttr );
- // --> OD 2008-03-13 #refactorlists# - no longed needed
-// SyncNumberAndNumRule();
if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
{
- // --> OD 2009-08-27 #i101516#
+ // #i101516#
// apply paragraph style's assigned outline style list level as
// list level of the paragraph, if it has none set already.
if ( !HasAttrListLevel() &&
@@ -262,10 +240,8 @@ SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere,
{
SetAttrListLevel( pTxtColl->GetAssignedOutlineStyleLevel() );
}
- // <--
AddToList();
}
- // <--
GetNodes().UpdateOutlineNode(*this);
m_bNotifiable = true;
@@ -292,15 +268,7 @@ SwTxtNode::~SwTxtNode()
delete pTmpHints;
}
- // --> OD 2008-03-13 #refactorlists#
-// if ( mpNodeNum )
-// {
-// mpNodeNum->RemoveMe();
-// delete mpNodeNum;
-// mpNodeNum = 0L;
-// }
RemoveFromList();
- // <--
InitSwParaStatistics( false );
}
@@ -346,7 +314,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
return;
}
SwTxtFtn *pAttr = (SwTxtFtn*)pHt;
- ASSERT( pAttr->GetStartNode(), "FtnAtr ohne StartNode." );
+ OSL_ENSURE( pAttr->GetStartNode(), "FtnAtr ohne StartNode." );
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
if ( !pNd )
@@ -358,14 +326,14 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm));
if( pCntnt )
{
- ASSERT( pCntnt->FindRootFrm() == pFrm->FindRootFrm(),
+ OSL_ENSURE( pCntnt->FindRootFrm() == pFrm->FindRootFrm(),
"lcl_ChangeFtnRef: Layout double?" );
SwFtnFrm *pFtn = pCntnt->FindFtnFrm();
if( pFtn && pFtn->GetAttr() == pAttr )
{
while( pFtn->GetMaster() )
pFtn = pFtn->GetMaster();
- // OD 07.11.2002 #104840# - remember footnote frame
+ // #104840# - remember footnote frame
pFirstFtnOfNode = pFtn;
while ( pFtn )
{
@@ -374,18 +342,18 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
((SwTxtFrm*)pFrm)->SetFtn( sal_True );
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
while( 0 != (pCntnt = (SwCntntFrm*)aIter.Next()) )
{
SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm();
- ASSERT( !pDbgFtn || pDbgFtn->GetRef() == pFrm,
+ OSL_ENSURE( !pDbgFtn || pDbgFtn->GetRef() == pFrm,
"lcl_ChangeFtnRef: Who's that guy?" );
}
#endif
}
}
} // end of for-loop on <SwpHints>
- // OD 08.11.2002 #104840# - invalidate
+ // #104840# - invalidate
if ( pFirstFtnOfNode )
{
SwCntntFrm* pCntnt = pFirstFtnOfNode->ContainsCntnt();
@@ -399,6 +367,8 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
{
+ bool parentIsOutline = IsOutline();
+
// lege den Node "vor" mir an
const xub_StrLen nSplitPos = rPos.nContent.GetIndex();
const xub_StrLen nTxtLen = m_Text.Len();
@@ -417,24 +387,14 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
}
}
- // --> OD 2008-03-27 #refactorlists#
-// // --> OD 2007-07-09 #i77372#
-// // reset numbering attribute at current node, only if it is numbered.
-// if ( GetNumRule() != NULL )
-// {
-// SetRestart(false);
-// SetStart(1);
-// SetCounted(true);
-// }
ResetAttr( RES_PARATR_LIST_ISRESTART );
ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
ResetAttr( RES_PARATR_LIST_ISCOUNTED );
- if ( GetNumRule() == 0 )
+ if ( GetNumRule() == 0 || (parentIsOutline && !IsOutline()) )
{
ResetAttr( RES_PARATR_LIST_ID );
ResetAttr( RES_PARATR_LIST_LEVEL );
}
- // <--
if ( GetDepends() && m_Text.Len() && (nTxtLen / 2) < nSplitPos )
{
@@ -651,7 +611,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
void SwTxtNode::MoveTxtAttr_To_AttrSet()
{
- ASSERT( m_pSwpHints, "MoveTxtAttr_To_AttrSet without SwpHints?" );
+ OSL_ENSURE( m_pSwpHints, "MoveTxtAttr_To_AttrSet without SwpHints?" );
for ( sal_uInt16 i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
{
SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i);
@@ -767,7 +727,7 @@ SwCntntNode *SwTxtNode::JoinNext()
InvalidateNumRule();
}
else {
- ASSERT( sal_False, "kein TxtNode." );
+ OSL_ENSURE( sal_False, "kein TxtNode." );
}
return this;
@@ -862,7 +822,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
InvalidateNumRule();
}
else {
- ASSERT( sal_False, "kein TxtNode." );
+ OSL_ENSURE( sal_False, "kein TxtNode." );
}
return this;
@@ -871,7 +831,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
// erzeugt einen AttrSet mit Bereichen fuer Frame-/Para/Char-Attributen
void SwTxtNode::NewAttrSet( SwAttrPool& rPool )
{
- ASSERT( !mpAttrSet.get(), "AttrSet ist doch gesetzt" );
+ OSL_ENSURE( !mpAttrSet.get(), "AttrSet ist doch gesetzt" );
SwAttrSet aNewAttrSet( rPool, aTxtNodeSetRange );
// put names of parent style and conditional style:
@@ -974,7 +934,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
sal_uInt16 nWhPos;
const sal_uInt16 nWhich = pHint->Which();
- ASSERT(!isCHRATR(nWhich), "Update: char attr hint?");
+ OSL_ENSURE(!isCHRATR(nWhich), "Update: char attr hint?");
if (isCHRATR(nWhich) || isTXTATR_WITHEND(nWhich))
{
nWhPos = static_cast<sal_uInt16>(nWhich -
@@ -1121,18 +1081,15 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
const SwTxtFmtColl *pNewColl)
{
SwDoc* pDoc = GetDoc();
- ASSERT( pDoc, "Kein Doc?" );
+ OSL_ENSURE( pDoc, "Kein Doc?" );
// erfrage die OutlineLevel und update gegebenenfalls das Nodes-Array,
// falls sich die Level geaendert haben !
- //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() ?
pNewColl->GetAssignedOutlineStyleLevel() : MAXLEVEL;
-// if ( NO_NUMBERING != nNewLevel ) //#outline level,zhaojianwei
- if ( MAXLEVEL != nNewLevel ) //<-end,zhaojianwei
+ if ( MAXLEVEL != nNewLevel )
{
SetAttrListLevel(nNewLevel);
}
@@ -1154,14 +1111,11 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
pDoc->GetFtnIdxs().UpdateFtn( aTmpIndex);
}
-//FEATURE::CONDCOLL
- if( /*pOldColl != pNewColl && pNewColl && */
- RES_CONDTXTFMTCOLL == pNewColl->Which() )
+ if( RES_CONDTXTFMTCOLL == pNewColl->Which() )
{
// Erfrage die akt. Condition des TextNodes:
ChkCondColl();
}
-//FEATURE::CONDCOLL
}
// Wenn man sich genau am Ende einer Text- bzw. INetvorlage befindet,
@@ -1250,7 +1204,7 @@ lcl_GetTxtAttrs(
}
xub_StrLen const*const pEndIdx = pHint->GetEnd();
- ASSERT(pEndIdx || pHint->HasDummyChar(),
+ OSL_ENSURE(pEndIdx || pHint->HasDummyChar(),
"hint with no end and no dummy char?");
// Wenn bExpand gesetzt ist, wird das Verhalten bei Eingabe
// simuliert, d.h. der Start wuede verschoben, das Ende expandiert,
@@ -1293,7 +1247,7 @@ SwTxtAttr *
SwTxtNode::GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich,
enum GetTxtAttrMode const eMode) const
{
- ASSERT( (nWhich == RES_TXTATR_META)
+ OSL_ENSURE( (nWhich == RES_TXTATR_META)
|| (nWhich == RES_TXTATR_METAFIELD)
|| (nWhich == RES_TXTATR_AUTOFMT)
|| (nWhich == RES_TXTATR_INETFMT)
@@ -1329,12 +1283,12 @@ SwCharFmt* lcl_FindCharFmt( const SwCharFmts* pCharFmts, const XubString& rName
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" );
+ OSL_ENSURE( nWhich == pHt->Which(), "Falsche Hint-Id" );
switch( nWhich )
{
// copy nodesarray section with footnote content
case RES_TXTATR_FTN :
- ASSERT(pDest, "lcl_CopyHint: no destination text node?");
+ OSL_ENSURE(pDest, "lcl_CopyHint: no destination text node?");
static_cast<const SwTxtFtn*>(pHt)->CopyFtn(
*static_cast<SwTxtFtn*>(pNewHt), *pDest);
break;
@@ -1435,8 +1389,8 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt,
}
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- ASSERT(pNewHt, "copying META should not fail! cannot call DoCopy");
- ASSERT(pDest && (CH_TXTATR_INWORD ==
+ OSL_ENSURE(pNewHt, "copying META should not fail! cannot call DoCopy");
+ OSL_ENSURE(pDest && (CH_TXTATR_INWORD ==
pDest->GetTxt().GetChar(*pNewHt->GetStart())),
"missing CH_TXTATR?");
if (pNewHt)
@@ -1526,7 +1480,6 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
SwIndex aIdx( pDest, pDest->m_Text.Len() );
CopyText( pDest, aIdx, rStart, nLen, bForceCopyOfAllAttrs );
}
-// <--
// --> OD 2008-11-18 #i96213#
// introduction of new optional parameter to control, if all attributes have to be copied.
@@ -1535,7 +1488,6 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
const SwIndex &rStart,
xub_StrLen nLen,
const bool bForceCopyOfAllAttrs )
-// <--
{
xub_StrLen nTxtStartIdx = rStart.GetIndex();
xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken
@@ -1780,8 +1732,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
const IDocumentContentOperations::InsertFlags nMode )
{
- ASSERT( rIdx <= m_Text.Len(), "SwTxtNode::InsertText: invalid index." );
- ASSERT( (sal_uLong)m_Text.Len() + (sal_uLong)rStr.Len() <= STRING_LEN,
+ OSL_ENSURE( rIdx <= m_Text.Len(), "SwTxtNode::InsertText: invalid index." );
+ OSL_ENSURE( (sal_uLong)m_Text.Len() + (sal_uLong)rStr.Len() <= STRING_LEN,
"SwTxtNode::InsertText: node text with insertion > STRING_LEN." );
xub_StrLen aPos = rIdx.GetIndex();
@@ -1881,8 +1833,6 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
|* SwTxtNode::Cut()
|*
|* Beschreibung text.doc
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung JP 11.08.94
|*
*************************************************************************/
@@ -1896,7 +1846,7 @@ void SwTxtNode::CutText( SwTxtNode * const pDest,
}
else
{
- ASSERT(false,
+ OSL_ENSURE(false,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
EraseText( rStart, nLen );
}
@@ -1904,11 +1854,11 @@ void SwTxtNode::CutText( SwTxtNode * const pDest,
void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
- const SwIndex & rStart, /*const*/ xub_StrLen nLen, const bool bUpdate )
+ const SwIndex & rStart, xub_StrLen nLen, const bool bUpdate )
{
if(!pDest)
{
- ASSERT(false,
+ OSL_ENSURE(false,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
EraseText( rStart, nLen );
return;
@@ -1917,7 +1867,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// nicht im Dokument verschieben ?
if( GetDoc() != pDest->GetDoc() )
{
- ASSERT(false,
+ OSL_ENSURE(false,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
CopyText( pDest, rDestStart, rStart, nLen);
EraseText(rStart, nLen);
@@ -1939,7 +1889,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// wird in sich selbst verschoben, muss es gesondert behandelt werden !!
if( pDest == this )
{
- ASSERT(false,
+ OSL_ENSURE(false,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
m_Text.Insert( m_Text, nTxtStartIdx, nLen, nDestStart );
m_Text.Erase( nTxtStartIdx + (nDestStart<nTxtStartIdx ? nLen : 0), nLen );
@@ -2018,24 +1968,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// Update aller Indizies
Update( rDestStart, nLen, sal_False, sal_True );
}
-#ifdef CUTNOEXPAND
- else
- // wird am Ende eingefuegt, nur die Attribut-Indizies verschieben
- if ( 0 < nLen && 0 < nInitSize && m_pSwpHints )
- {
- // check if there was the end of an attribute at the insertion
- // position: if it is not a field, it must be expanded
- for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); n++ )
- {
- SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(n);
- const xub_StrLen * const pEndIdx = pHt->GetEnd();
- if ( pEndIdx && (*pEndIdx == nInitSize) )
- {
- *pEndIdx = *pEndIdx + nLen;
- }
- }
- }
-#endif
+
CHECK_SWPHINTS(this);
Update( rStart, nLen, sal_True, sal_True );
@@ -2077,24 +2010,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// Update aller Indizies
pDest->Update( rDestStart, nLen, sal_False, sal_True);
}
-#ifdef CUTNOEXPAND
- else
- // wird am Ende eingefuegt, nur die Attribut-Indizies verschieben
- if ( 0 < nLen && 0 < nInitSize && pDest->m_pSwpHints )
- {
- // check if there was the end of an attribute at the insertion
- // position: if it is not a field, it must be expanded
- 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();
- if ( pEndIdx && (*pEndIdx == nInitSize) )
- {
- *pEndIdx = *pEndIdx + nLen;
- }
- }
- }
-#endif
+
CHECK_SWPHINTS(pDest);
const xub_StrLen nEnd = rStart.GetIndex() + nLen;
@@ -2103,7 +2019,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
bool const bUndoNodes = !pOtherDoc
&& GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(GetNodes());
- ASSERT(!pOtherDoc,
+ OSL_ENSURE(!pOtherDoc,
"mst: entering dead and bitrotted code; fasten your seatbelts!");
// harte Absatz umspannende Attribute kopieren
@@ -2269,7 +2185,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
const IDocumentContentOperations::InsertFlags nMode )
{
- ASSERT( rIdx <= m_Text.Len(), "SwTxtNode::EraseText: invalid index." );
+ OSL_ENSURE( rIdx <= m_Text.Len(), "SwTxtNode::EraseText: invalid index." );
const xub_StrLen nStartIdx = rIdx.GetIndex();
const xub_StrLen nCnt = (STRING_LEN == nCount)
@@ -2299,7 +2215,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
if( !pHtEndIdx )
{
- ASSERT(pHt->HasDummyChar(),
+ OSL_ENSURE(pHt->HasDummyChar(),
"attribute with neither end nor CH_TXTATR?");
if (isTXTATR(nWhich) &&
(nHintStart >= nStartIdx) && (nHintStart < nEndIdx))
@@ -2311,7 +2227,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
continue;
}
- ASSERT (!( (nHintStart < nEndIdx) && (*pHtEndIdx > nEndIdx)
+ OSL_ENSURE(!( (nHintStart < nEndIdx) && (*pHtEndIdx > nEndIdx)
&& pHt->HasDummyChar() )
// next line: deleting exactly dummy char: DeleteAttributes
|| ((nHintStart == nStartIdx) && (nHintStart + 1 == nEndIdx)),
@@ -2333,12 +2249,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
// treated just like toxmark and refmarks
(RES_TXTATR_CJK_RUBY == nWhich) ) )
// <--
-#if 0
- || ( (nHintStart == nStartIdx) &&
- (nHintStart + 1 == nEndIdx)&&
-#else // generalize this to left-overlapped dummy char hints (see ASSERT)
|| ( (nHintStart < nEndIdx) &&
-#endif
pHt->HasDummyChar() )
)
{
@@ -2348,7 +2259,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
}
}
- ASSERT(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
+ OSL_ENSURE(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
TryDeleteSwpHints();
@@ -2365,7 +2276,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
SwModify::Modify( 0, &aHint );
}
- ASSERT(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
+ OSL_ENSURE(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
// By deleting a character, the hidden flags
// at the TxtNode can become invalid:
@@ -2380,9 +2291,6 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
#*
#* Beschreibung
#* text.doc
-#*
-#* Datum : MS 28.11.90
-#* Update : VB 24.07.91
#***********************************************************************/
void SwTxtNode::GCAttr()
@@ -2463,84 +2371,7 @@ SwNumRule* SwTxtNode::_GetNumRule(sal_Bool bInParent) const
}
}
}
-
- // --> OD 2006-11-20 #i71764#
- // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
- // any more.
-// if ( !pRet &&
-// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) &&
-// GetOutlineLevel() != NO_NUMBERING )
-// {
-// pRet = GetDoc()->GetOutlineNumRule();
-// }
- // <--
}
- // old code before tuning
-// // --> OD 2005-10-25 #126347#
-// // determine of numbering/bullet rule, which is set as a hard attribute
-// // at the text node
-// const SfxPoolItem* pItem( 0L );
-// if ( HasSwAttrSet() ) // does text node has hard attributes ?
-// {
-// if ( SFX_ITEM_SET !=
-// GetpSwAttrSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) )
-// {
-// pItem = 0L;
-// }
-// // else: <pItem> contains the numbering/bullet attribute, which is
-// // hard set at the paragraph.
-
-// }
-// // <--
-// bool bNoNumRule = false;
-// if (pItem)
-// {
-// String sNumRuleName = static_cast<const SwNumRuleItem *>(pItem)->GetValue();
-// if (sNumRuleName.Len() > 0)
-// {
-// pRet = GetDoc()->FindNumRulePtr(sNumRuleName);
-// }
-// else // numbering is turned off by hard attribute
-// bNoNumRule = true;
-// }
-
-// if (! bNoNumRule)
-// {
-// if (! pRet && bInParent)
-// {
-// SwTxtFmtColl * pColl = GetTxtColl();
-
-// if (pColl)
-// {
-// const SwNumRuleItem & rItem = pColl->GetNumRule(sal_True);
-
-// pRet = const_cast<SwDoc *>(GetDoc())->
-// FindNumRulePtrWithPool(rItem.GetValue());
-// // --> OD 2005-10-13 #125993# - The outline numbering rule
-// // isn't allowed to be derived from a parent paragraph style
-// // to a derived one.
-// // Thus check, if the found outline numbering rule is directly
-// // set at the paragraph style <pColl>. If not, don't return
-// // the outline numbering rule.
-// if ( pRet && pRet == GetDoc()->GetOutlineNumRule() )
-// {
-// const SwNumRuleItem& rDirectItem = pColl->GetNumRule(sal_False);
-// SwNumRule* pNumRuleAtParaStyle = const_cast<SwDoc*>(GetDoc())->
-// FindNumRulePtrWithPool(rDirectItem.GetValue());
-// if ( !pNumRuleAtParaStyle )
-// {
-// pRet = 0L;
-// }
-// }
-// // <--
-// }
-// }
-
-// if (!pRet && GetDoc()->IsOutlineLevelYieldsOutlineRule() &&
-// GetOutlineLevel() != NO_NUMBERING)
-// pRet = GetDoc()->GetOutlineNumRule();
-// }
- // <--
return pRet;
}
@@ -2554,7 +2385,6 @@ SwNumRule* SwTxtNode::GetNumRule(sal_Bool bInParent) const
void SwTxtNode::NumRuleChgd()
{
- // --> OD 2008-04-04 #refactorlists#
if ( IsInList() )
{
SwNumRule* pNumRule = GetNumRule();
@@ -2563,7 +2393,6 @@ void SwTxtNode::NumRuleChgd()
mpNodeNum->ChangeNumRule( *pNumRule );
}
}
- // <--
if( IsInCache() )
{
@@ -2594,7 +2423,6 @@ sal_Bool SwTxtNode::IsNumbered() const
return bResult;
}
-// --> OD 2008-04-02 #refactorlists#
bool SwTxtNode::HasMarkedLabel() const
{
bool bResult = false;
@@ -2607,7 +2435,6 @@ bool SwTxtNode::HasMarkedLabel() const
return bResult;
}
-// <--
// <- #i27615#
SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
@@ -2671,7 +2498,6 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
// --> OD 2007-07-10 #i75353#
// No clear of hard set numbering rule at an outline paragraph at this point.
// Only if the paragraph style changes - see below.
-// aClearWhichIds.push_back( RES_PARATR_NUMRULE );
bClearHardSetNumRuleWhenFmtCollChanges = true;
// <--
}
@@ -2749,7 +2575,6 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
SwNodeIndex aIdx( rPos.nNode, 1 );
SwTxtNode* pNew = _MakeNewTxtNode( aIdx, sal_True );
- // --> OD 2008-05-14 #refactorlists#
// reset list attributes at appended text node
pNew->ResetAttr( RES_PARATR_LIST_ISRESTART );
pNew->ResetAttr( RES_PARATR_LIST_RESTARTVALUE );
@@ -2759,14 +2584,11 @@ SwCntntNode* SwTxtNode::AppendNode( const SwPosition & rPos )
pNew->ResetAttr( RES_PARATR_LIST_ID );
pNew->ResetAttr( RES_PARATR_LIST_LEVEL );
}
- // <--
- // --> OD 2008-03-13 #refactorlists#
-// SyncNumberAndNumRule();
+
if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 )
{
AddToList();
}
- // <--
if( GetDepends() )
MakeFrms( *pNew );
@@ -2870,7 +2692,7 @@ long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const
if( pRule )
{
const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
- // --> OD 2008-01-16 #newlistlevelattrs#
+
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
nRet = rFmt.GetAbsLSpace();
@@ -2899,10 +2721,8 @@ long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const
{
nRet = nRet + rFmt.GetFirstLineIndent();
}
- // <--
}
}
- // <--
}
return nRet;
@@ -2921,7 +2741,6 @@ sal_Bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
if ( IsCountedInList() )
{
- // --> OD 2008-01-16 #newlistlevelattrs#
const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
@@ -2945,7 +2764,6 @@ sal_Bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
rFLOffset = aItem.GetTxtFirstLineOfst();
}
}
- // <--
}
bRet = sal_True;
@@ -3001,7 +2819,6 @@ SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const
return nAdditionalIndent;
}
-// <--
// --> OD 2008-12-02 #i96772#
void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const
@@ -3020,7 +2837,6 @@ void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpac
}
}
}
-// <--
// --> OD 2008-07-01 #i91133#
long SwTxtNode::GetLeftMarginForTabCalculation() const
@@ -3048,7 +2864,6 @@ long SwTxtNode::GetLeftMarginForTabCalculation() const
return nLeftMarginForTabCalc;
}
-// <--
void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
xub_StrLen nEndPos, sal_Bool bExpandFlds ) const
@@ -3158,7 +2973,6 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
return aTxt;
}
-// <--
sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
xub_StrLen nIdx, xub_StrLen nLen, sal_Bool bWithNum,
@@ -3422,7 +3236,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen,
void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
const XubString& rText )
{
- ASSERT( rStart.GetIndex() < m_Text.Len() &&
+ OSL_ENSURE( rStart.GetIndex() < m_Text.Len() &&
rStart.GetIndex() + nDelLen <= m_Text.Len(),
"SwTxtNode::ReplaceText: index out of bounds" );
const xub_StrLen nStartPos = rStart.GetIndex();
@@ -3436,7 +3250,7 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
SwTxtAttr *const pHint = GetTxtAttrForCharAt( nPos );
if (pHint)
{
- ASSERT (!( pHint->GetEnd() && pHint->HasDummyChar()
+ OSL_ENSURE(!( pHint->GetEnd() && pHint->HasDummyChar()
&& (*pHint->GetStart() < nEndPos)
&& (*pHint->GetEnd() > nEndPos) ),
"ReplaceText: ERROR: "
@@ -3482,7 +3296,6 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
SwModify::Modify( 0, &aHint );
}
-// --> OD 2008-03-27 #refactorlists#
namespace {
// Helper method for special handling of modified attributes at text node.
// The following is handled:
@@ -3510,19 +3323,14 @@ namespace {
bParagraphStyleChanged = true;
if( rTxtNode.GetNodes().IsDocNodes() )
{
- // --> OD 2008-12-17 #i70748#
- // The former list style set at the paragraph can not be
- // retrieved from the change set.
-// sOldNumRule =
-// dynamic_cast<const SwFmtChg*>(pOldValue)->pChangedFmt->GetNumRule().GetValue();
+ // #i70748#
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
if ( rTxtNode.IsEmptyListStyleDueToSetOutlineLevelAttr() )
{
const SwNumRuleItem& rNumRuleItem = rTxtNode.GetTxtColl()->GetNumRule();
@@ -3531,7 +3339,7 @@ namespace {
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
}
- // <--
+
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
@@ -3544,71 +3352,46 @@ namespace {
case RES_ATTRSET_CHG:
{
const SfxPoolItem* pItem = 0;
- // --> 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, sal_False, &pItem ) ==
-// SFX_ITEM_SET )
-// {
-// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
-// }
+ // #i70748#
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
+
if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem ) ==
SFX_ITEM_SET )
{
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
bNumRuleSet = true;
- // The new list style set at the paragraph can not be
- // retrieved from the change set.
-// sNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
- // <--
}
- // --> OD 2008-12-17 #i70748#
+ // #i70748#
// The new list style set at the paragraph.
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
sNumRule = pNumRuleAtTxtNode->GetName();
}
- // <--
break;
}
case RES_PARATR_NUMRULE:
{
if ( rTxtNode.GetNodes().IsDocNodes() )
{
- // The former list style set at the paragraph can not be
- // retrieved from the change set.
-// if ( pOldValue )
-// {
-// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pOldValue)->GetValue();
-// }
const SwNumRule* pFormerNumRuleAtTxtNode =
rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
if ( pFormerNumRuleAtTxtNode )
{
sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
}
- // <--
+
if ( pNewValue )
{
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
bNumRuleSet = true;
- // --> OD 2008-12-17 #i70748#
- // The new list style set at the paragraph can not be
- // retrieved from the change set.
-// sNumRule = dynamic_cast<const SwNumRuleItem*>(pNewValue)->GetValue();
- // <--
}
// --> OD 2008-12-17 #i70748#
// The new list style set at the paragraph.
@@ -3617,7 +3400,6 @@ namespace {
{
sNumRule = pNumRuleAtTxtNode->GetName();
}
- // <--
}
break;
}
@@ -3643,7 +3425,6 @@ namespace {
rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False,
&aResetAttrsArray,
false );
- // <--
}
}
else
@@ -3655,11 +3436,10 @@ namespace {
String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) )
{
// --> OD 2008-09-10 #i70748#
- ASSERT( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
+ OSL_ENSURE( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
"<HandleModifyAtTxtNode()> - text node with outline style, but its paragraph style is not assigned to outline style." );
int nNewListLevel =
rTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
- // <--
if ( 0 <= nNewListLevel && nNewListLevel < MAXLEVEL )
{
rTxtNode.SetAttrListLevel( nNewListLevel );
@@ -3699,11 +3479,9 @@ namespace {
{
rTxtNode.AddToList();
}
- // <--
}
// End of method <HandleModifyAtTxtNode>
}
-// <--
void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
{
@@ -3724,12 +3502,10 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
(SwTxtFmtColl*)((SwFmtChg*)pNewValue)->pChangedFmt );
}
- // --> OD 2008-03-27 #refactorlists#
if ( !mbInSetOrResetAttr )
{
HandleModifyAtTxtNode( *this, pOldValue, pNewValue );
}
- // <--
SwCntntNode::Modify( pOldValue, pNewValue );
@@ -3752,8 +3528,8 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
{
- ASSERT( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
- ASSERT( HAS_BASE( SwTxtFmtColl, pNewColl ),
+ OSL_ENSURE( pNewColl,"ChgFmtColl: Collectionpointer ist 0." );
+ OSL_ENSURE( HAS_BASE( SwTxtFmtColl, pNewColl ),
"ChgFmtColl: ist kein Text-Collectionpointer." );
SwTxtFmtColl *pOldColl = GetTxtColl();
@@ -3761,11 +3537,9 @@ SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
{
SetCalcHiddenCharFlags();
SwCntntNode::ChgFmtColl( pNewColl );
- // --> OD 2008-03-27 #refactorlists#
-// NumRuleChgd();
#if OSL_DEBUG_LEVEL > 1
- ASSERT( !mbInSetOrResetAttr,
- "DEBUG ASSERTION - <SwTxtNode::ChgFmtColl(..)> called during <Set/ResetAttr(..)>" )
+ OSL_ENSURE( !mbInSetOrResetAttr,
+ "DEBUG OSL_ENSURE(ON - <SwTxtNode::ChgFmtColl(..)> called during <Set/ResetAttr(..)>" );
#endif
if ( !mbInSetOrResetAttr )
{
@@ -3773,7 +3547,6 @@ SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl )
SwFmtChg aTmp2( pNewColl );
HandleModifyAtTxtNode( *this, &aTmp1, &aTmp2 );
}
- // <--
}
// nur wenn im normalen Nodes-Array
@@ -3791,9 +3564,7 @@ SwNodeNum* SwTxtNode::CreateNum() const
{
if ( !mpNodeNum )
{
- // --> OD 2008-02-19 #refactorlists#
mpNodeNum = new SwNodeNum( const_cast<SwTxtNode*>(this) );
- // <--
}
return mpNodeNum;
}
@@ -3815,8 +3586,7 @@ bool SwTxtNode::IsOutline() const
{
bool bResult = false;
- //if ( GetOutlineLevel() != NO_NUMBERING )//#outline level,removed by zhaojianwei
- if ( GetAttrOutlineLevel() > 0 ) //<-end,zhaojianwei
+ if ( GetAttrOutlineLevel() > 0 )
{
bResult = !IsInRedlines();
}
@@ -3849,7 +3619,7 @@ int SwTxtNode::GetAttrOutlineLevel() const
}
void SwTxtNode::SetAttrOutlineLevel(int nLevel)
{
- ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtNode: Level Out Of Range" );//#outline level,zhaojianwei
+ OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtNode: Level Out Of Range" );//#outline level,zhaojianwei
if ( 0 <= nLevel && nLevel <= MAXLEVEL )
{
SetAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
@@ -3884,12 +3654,11 @@ void SwTxtNode::ResetEmptyListStyleDueToResetOutlineLevelAttr()
// <--
-// --> OD 2008-02-27 #refactorlists#
void SwTxtNode::SetAttrListLevel( int nLevel )
{
if ( nLevel < 0 || nLevel >= MAXLEVEL )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwTxtNode::SetAttrListLevel()> - value of parameter <nLevel> is out of valid range" );
return;
}
@@ -3898,15 +3667,13 @@ void SwTxtNode::SetAttrListLevel( int nLevel )
static_cast<sal_Int16>(nLevel) );
SetAttr( aNewListLevelItem );
}
-// <--
-// --> OD 2008-02-27 #refactorlists#
+
bool SwTxtNode::HasAttrListLevel() const
{
return GetpSwAttrSet() &&
GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_LEVEL, sal_False ) == SFX_ITEM_SET;
}
-// <--
-// --> OD 2008-02-27 #refactorlists#
+
int SwTxtNode::GetAttrListLevel() const
{
int nAttrListLevel = 0;
@@ -3917,14 +3684,12 @@ int SwTxtNode::GetAttrListLevel() const
return nAttrListLevel;
}
-// <--
int SwTxtNode::GetActualListLevel() const
{
return GetNum() ? GetNum()->GetLevelInListTree() : -1;
}
-// --> OD 2008-02-25 #refactorlists#
void SwTxtNode::SetListRestart( bool bRestart )
{
// CreateNum()->SetRestart(bRestart);
@@ -3942,7 +3707,6 @@ void SwTxtNode::SetListRestart( bool bRestart )
}
}
-// --> OD 2008-02-25 #refactorlists#
bool SwTxtNode::IsListRestart() const
{
// return GetNum() ? GetNum()->IsRestart() : false;
@@ -3951,11 +3715,9 @@ bool SwTxtNode::IsListRestart() const
return aIsRestartItem.GetValue() ? true : false;
}
-// <--
/** Returns if the paragraph has a visible numbering or bullet.
This includes all kinds of numbering/bullet/outlines.
- OD 2008-02-28 #newlistlevelattrs#
The concrete list label string has to be checked, too.
*/
bool SwTxtNode::HasVisibleNumberingOrBullet() const
@@ -3980,7 +3742,6 @@ bool SwTxtNode::HasVisibleNumberingOrBullet() const
return bRet;
}
-// --> OD 2008-02-25 #refactorlists#
void SwTxtNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber )
{
// CreateNum()->SetStart(nNumber);
@@ -4002,18 +3763,15 @@ void SwTxtNode::SetAttrListRestartValue( SwNumberTree::tSwNumTreeNumber nNumber
}
}
}
-// <--
-// --> OD 2008-02-27 #refactorlists#
bool SwTxtNode::HasAttrListRestartValue() const
{
return GetpSwAttrSet() &&
GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_RESTARTVALUE, sal_False ) == SFX_ITEM_SET;
}
-// <--
SwNumberTree::tSwNumTreeNumber SwTxtNode::GetAttrListRestartValue() const
{
- ASSERT( HasAttrListRestartValue(),
+ OSL_ENSURE( HasAttrListRestartValue(),
"<SwTxtNode::GetAttrListRestartValue()> - only ask for list restart value, if attribute is set at text node." );
const SfxInt16Item& aListRestartValueItem =
@@ -4021,7 +3779,6 @@ SwNumberTree::tSwNumTreeNumber SwTxtNode::GetAttrListRestartValue() const
return static_cast<SwNumberTree::tSwNumTreeNumber>(aListRestartValueItem.GetValue());
}
-// --> OD 2008-02-25 #refactorlists#
SwNumberTree::tSwNumTreeNumber SwTxtNode::GetActualListStartValue() const
{
// return GetNum() ? GetNum()->GetStart() : 1;
@@ -4047,7 +3804,6 @@ SwNumberTree::tSwNumTreeNumber SwTxtNode::GetActualListStartValue() const
return nListRestartValue;
}
-// <--
bool SwTxtNode::IsNotifiable() const
{
@@ -4065,7 +3821,6 @@ bool SwTxtNode::IsNotificationEnabled() const
return bResult;
}
-// --> OD 2008-02-27 #refactorlists#
void SwTxtNode::SetCountedInList( bool bCounted )
{
if ( bCounted )
@@ -4080,7 +3835,6 @@ void SwTxtNode::SetCountedInList( bool bCounted )
SetAttr( aIsCountedInListItem );
}
}
-// <--
bool SwTxtNode::IsCountedInList() const
{
@@ -4090,12 +3844,11 @@ bool SwTxtNode::IsCountedInList() const
return aIsCountedInListItem.GetValue() ? true : false;
}
-// --> OD 2008-03-13 #refactorlists#
void SwTxtNode::AddToList()
{
if ( IsInList() )
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwTxtNode::AddToList()> - the text node is already added to a list. Serious defect -> please inform OD" );
return;
}
@@ -4113,7 +3866,7 @@ void SwTxtNode::AddToList()
pList = GetDoc()->createList( sListId, GetNumRule()->GetName() );
}
}
- ASSERT( pList != 0,
+ OSL_ENSURE( pList != 0,
"<SwTxtNode::AddToList()> - no list for given list id. Serious defect -> please inform OD" );
if ( pList )
{
@@ -4138,7 +3891,6 @@ bool SwTxtNode::IsInList() const
{
return GetNum() != 0 && GetNum()->GetParent() != 0;
}
-// <--
bool SwTxtNode::IsFirstOfNumRule() const
{
@@ -4150,7 +3902,6 @@ bool SwTxtNode::IsFirstOfNumRule() const
return bResult;
}
-// --> OD 2008-02-20 #refactorlists#
void SwTxtNode::SetListId( const String sListId )
{
const SfxStringItem& rListIdItem =
@@ -4185,26 +3936,15 @@ String SwTxtNode::GetListId() const
if ( pRule )
{
sListId = pRule->GetDefaultListId();
-//#if OSL_DEBUG_LEVEL > 1
-// ASSERT( false,
-// "DEBUG ASSERTION: default list id of list style is applied." );
-//#endif
-// // setting list id directly using <SwCntntNode::SetAttr(..)>,
-// // because no handling of this attribute set is needed and to avoid
-// // recursive calls of <SwTxtNode::SetAttr(..)>
-// SfxStringItem aNewListIdItem( RES_PARATR_LIST_ID, sListId );
-// const_cast<SwTxtNode*>(this)->SwCntntNode::SetAttr( aNewListIdItem );
}
}
return sListId;
}
-// <--
/** Determines, if the list level indent attributes can be applied to the
paragraph.
- OD 2008-01-17 #newlistlevelattrs#
The list level indents can be applied to the paragraph under the one
of following conditions:
- the list style is directly applied to the paragraph and the paragraph
@@ -4265,7 +4005,7 @@ bool SwTxtNode::AreListLevelIndentsApplicable() const
}
pColl = dynamic_cast<const SwTxtFmtColl*>(pColl->DerivedFrom());
- ASSERT( pColl,
+ OSL_ENSURE( pColl,
"<SwTxtNode::AreListLevelIndentsApplicable()> - something wrong in paragraph's style hierarchy. The applied list style is not found." );
}
}
@@ -4276,8 +4016,6 @@ bool SwTxtNode::AreListLevelIndentsApplicable() const
/** Retrieves the list tab stop position, if the paragraph's list level defines
one and this list tab stop has to merged into the tap stops of the paragraph
- OD 2008-01-17 #newlistlevelattrs#
-
@author OD
@param nListTabStopPosition
@@ -4322,8 +4060,6 @@ bool SwTxtNode::GetListTabStopPosition( long& nListTabStopPosition ) const
/** Retrieves the character following the list label, if the paragraph's
list level defines one.
- OD 2008-01-17 #newlistlevelattrs#
-
@author OD
@return XubString - the list tab stop position
@@ -4359,7 +4095,7 @@ XubString SwTxtNode::GetLabelFollowedBy() const
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwTxtNode::GetLabelFollowedBy()> - unknown SvxNumberFormat::GetLabelFollowedBy() return value" );
}
}
@@ -4391,7 +4127,6 @@ bool SwTxtNode::IsHidden() const
}
// <--
-// --> OD 2008-03-13 #refactorlists#
namespace {
// Helper class for special handling of setting attributes at text node:
// In constructor an instance of the helper class recognize whose attributes
@@ -4476,7 +4211,7 @@ namespace {
{
const SfxStringItem& pListIdItem =
dynamic_cast<const SfxStringItem&>(pItem);
- ASSERT( pListIdItem.GetValue().Len() > 0,
+ OSL_ENSURE( pListIdItem.GetValue().Len() > 0,
"<HandleSetAttrAtTxtNode(..)> - empty list id attribute not excepted. Serious defect -> please inform OD." );
const String sListIdOfTxtNode = rTxtNode.GetListId();
if ( pListIdItem.GetValue() != sListIdOfTxtNode )
@@ -5104,3 +4839,4 @@ SwTxtNode::MakeUnoObject()
return xMeta;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx
index 9c294ac03936..8a421ba1ff79 100644
--- a/sw/source/core/txtnode/swfntcch.cxx
+++ b/sw/source/core/txtnode/swfntcch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,9 +46,6 @@ SwFontCache *pSwFontCache = NULL;
|*
|* SwFontObj::SwFontObj(), ~SwFontObj()
|*
-|* Ersterstellung AMA 25. Jun. 95
-|* Letzte Aenderung AMA 25. Jun. 95
-|*
|*************************************************************************/
SwFontObj::SwFontObj( const void *pOwn, ViewShell *pSh ) :
@@ -68,9 +66,6 @@ SwFontObj::~SwFontObj()
|*
|* SwFontAccess::SwFontAccess()
|*
-|* Ersterstellung AMA 25. Jun. 95
-|* Letzte Aenderung AMA 25. Jun. 95
-|*
|*************************************************************************/
SwFontAccess::SwFontAccess( const void *pOwn, ViewShell *pSh ) :
@@ -92,3 +87,4 @@ SwCacheObj *SwFontAccess::NewObj( )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 24f5c097f7d4..4578eac81f76 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,8 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <unotools/localedatawrapper.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/brshitem.hxx>
@@ -50,9 +47,7 @@
#include <editeng/akrnitem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/charreliefitem.hxx>
-#ifndef _SVX_CNTRITEM_HXX //autogen
#include <editeng/cntritem.hxx>
-#endif
#include <editeng/colritem.hxx>
#include <editeng/cscoitem.hxx>
#include <editeng/crsditem.hxx>
@@ -61,9 +56,7 @@
#include <editeng/postitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fontitem.hxx>
-#ifndef _SVX_EMPHITEM_HXX //autogen
#include <editeng/emphitem.hxx>
-#endif
#include <editeng/charscaleitem.hxx>
#include <editeng/charrotateitem.hxx>
#include <editeng/twolinesitem.hxx>
@@ -85,7 +78,7 @@
#define FNT_ATM_HACK
#endif
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
// globale Variable
SvStatistics aSvStat;
#endif
@@ -122,7 +115,7 @@ sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat )
break;
#if OSL_DEBUG_LEVEL > 1
default :
- ASSERT( sal_False, "Unsupported direction" );
+ OSL_ENSURE( sal_False, "Unsupported direction" );
break;
#endif
}
@@ -149,7 +142,7 @@ sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat )
break;
#if OSL_DEBUG_LEVEL > 1
default :
- ASSERT( sal_False, "Unsupported direction" );
+ OSL_ENSURE( sal_False, "Unsupported direction" );
break;
#endif
}
@@ -426,7 +419,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
}
bPaintBlank = sal_False;
bPaintWrong = sal_False;
- ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" );
+ OSL_ENSURE( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" );
}
/*************************************************************************
@@ -924,7 +917,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey )
if( pUnderFnt && nOldUnder != UNDERLINE_NONE )
{
-static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+static sal_Char const sDoubleSpace[] = " ";
Size aFontSize = _GetTxtSize( rInf );
const XubString &rOldStr = rInf.GetText();
XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
@@ -1035,7 +1028,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf )
if( pUnderFnt && nOldUnder != UNDERLINE_NONE )
{
-static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
+static sal_Char const sDoubleSpace[] = " ";
const XubString &rOldStr = rInf.GetText();
XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
xub_StrLen nOldIdx = rInf.GetIdx();
@@ -1169,8 +1162,10 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos )
// used during painting of small capitals
void SwDrawTextInfo::Shift( sal_uInt16 nDir )
{
- ASSERT( bPos, "DrawTextInfo: Undefined Position" );
- ASSERT( bSize, "DrawTextInfo: Undefined Width" );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bPos, "DrawTextInfo: Undefined Position" );
+ OSL_ENSURE( bSize, "DrawTextInfo: Undefined Width" );
+#endif
const sal_Bool bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) !=
( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) );
@@ -1185,7 +1180,7 @@ void SwDrawTextInfo::Shift( sal_uInt16 nDir )
((Point*)pPos)->X() += GetSize().Width();
break;
case 900 :
- ASSERT( ((Point*)pPos)->Y() >= GetSize().Width(), "Going underground" );
+ OSL_ENSURE( ((Point*)pPos)->Y() >= GetSize().Width(), "Going underground" );
((Point*)pPos)->Y() -= GetSize().Width();
break;
case 1800 :
@@ -1244,3 +1239,5 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess,
rMutableOut.SetFont(aOldFont);
return nHeight;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index d0be32e61953..b2e9296c9fc7 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,9 +41,7 @@
#include <editeng/emphitem.hxx>
#include <editeng/charscaleitem.hxx>
#include <editeng/charrotateitem.hxx>
-// --> OD 2008-01-16 #newlistlevelattrs#
#include <editeng/lrspitem.hxx>
-// <--
#include <txtinet.hxx>
#include <txtflcnt.hxx>
#include <fmtfld.hxx>
@@ -66,7 +65,6 @@
#include <breakit.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
-#include <errhdl.hxx>
#include <fldbas.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
@@ -86,7 +84,7 @@
#include <algorithm>
#include <map>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#define CHECK Check();
#else
#define CHECK
@@ -173,7 +171,7 @@ bool isSelfNestable(const sal_uInt16 nWhich)
if ((RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_CJK_RUBY == nWhich))
return false;
- ASSERT((RES_TXTATR_META == nWhich) ||
+ OSL_ENSURE((RES_TXTATR_META == nWhich) ||
(RES_TXTATR_METAFIELD == nWhich), "???");
return true;
}
@@ -184,7 +182,7 @@ bool isSplittable(const sal_uInt16 nWhich)
if ((RES_TXTATR_INETFMT == nWhich) ||
(RES_TXTATR_CJK_RUBY == nWhich))
return true;
- ASSERT((RES_TXTATR_META == nWhich) ||
+ OSL_ENSURE((RES_TXTATR_META == nWhich) ||
(RES_TXTATR_METAFIELD == nWhich), "???");
return false;
}
@@ -254,7 +252,7 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting,
break;
}
default:
- ASSERT(false, "MakeTxtAttrNesting: what the hell is that?");
+ OSL_ENSURE(false, "MakeTxtAttrNesting: what the hell is that?");
break;
}
return static_cast<SwTxtAttrNesting*>(pNew);
@@ -371,7 +369,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
//??? const bool bNoLengthAttribute( nNewStart == nNewEnd );
const bool bNewSelfNestable( isSelfNestable(nNewWhich) );
- ASSERT( (RES_TXTATR_INETFMT == nNewWhich) ||
+ OSL_ENSURE( (RES_TXTATR_INETFMT == nNewWhich) ||
(RES_TXTATR_CJK_RUBY == nNewWhich) ||
(RES_TXTATR_META == nNewWhich) ||
(RES_TXTATR_METAFIELD == nNewWhich),
@@ -411,7 +409,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
static_cast<SwTxtAttrNesting*>(pOther));
break;
default:
- ASSERT(false, "bad code monkey");
+ OSL_ENSURE(false, "bad code monkey");
break;
}
}
@@ -427,7 +425,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
if (rNewHint.HasDummyChar())
{
- ASSERT(false,
+ OSL_ENSURE(false,
"ERROR: inserting duplicate CH_TXTATR hint");
return false;
} else if (nNewEnd < nOtherEnd) {
@@ -437,7 +435,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
// in SwXMeta::createEnumeration
// SplitNew is sorted, so this is the first split
xub_StrLen *const pStart(SplitNew.front()->GetStart());
- ASSERT(*pStart == nNewStart, "how did that happen?");
+ OSL_ENSURE(*pStart == nNewStart, "how did that happen?");
*pStart = nNewStart + 1;
}
}
@@ -445,7 +443,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
}
}
- ASSERT (isSplittable(nNewWhich) || SplitNew.size() == 1,
+ OSL_ENSURE(isSplittable(nNewWhich) || SplitNew.size() == 1,
"splitting the unsplittable ???");
// pass 2: split existing hints that overlap/nest with new hint
@@ -476,14 +474,14 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
case POS_INSIDE:
{
- ASSERT(!bRemoveOverlap,
+ OSL_ENSURE(!bRemoveOverlap,
"this one should be in OverwrittenExisting?");
}
break;
case POS_OUTSIDE:
case POS_EQUAL:
{
- ASSERT(false, "existing hint inside new hint: why?");
+ OSL_ENSURE(false, "existing hint inside new hint: why?");
}
break;
case POS_OVERLAP_BEFORE:
@@ -495,7 +493,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
if ( USHRT_MAX == Count() )
{
- ASSERT(false, "hints array full :-(");
+ OSL_ENSURE(false, "hints array full :-(");
return false;
}
SwTxtAttrNesting * const pOtherLeft(
@@ -514,7 +512,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
{
if ( USHRT_MAX == Count() )
{
- ASSERT(false, "hints array full :-(");
+ OSL_ENSURE(false, "hints array full :-(");
return false;
}
SwTxtAttrNesting * const pOtherRight(
@@ -532,7 +530,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
if ( USHRT_MAX - SplitNew.size() <= Count() )
{
- ASSERT(false, "hints array full :-(");
+ OSL_ENSURE(false, "hints array full :-(");
return false;
}
@@ -560,7 +558,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
}
else
{
- ASSERT((nOtherStart < nNewStart) && (nNewEnd < nOtherEnd), "huh?");
+ OSL_ENSURE((nOtherStart < nNewStart) && (nNewEnd < nOtherEnd), "huh?");
// scenario: there is a RUBY, and contained within that a META;
// now a RUBY is inserted within the META => the exising RUBY is split:
// here it is not possible to simply insert the left/right fragment
@@ -568,12 +566,13 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint )
Delete( *itOther ); // this also does NoteInHistory!
*(*itOther)->GetEnd() = nNewStart;
bool bSuccess( TryInsertNesting(rNode, **itOther) );
- ASSERT(bSuccess, "recursive call 1 failed?");
+ OSL_ENSURE(bSuccess, "recursive call 1 failed?");
SwTxtAttrNesting * const pOtherRight(
MakeTxtAttrNesting(
rNode, **itOther, nNewEnd, nOtherEnd ) );
bSuccess = TryInsertNesting(rNode, *pOtherRight);
- ASSERT(bSuccess, "recursive call 2 failed?");
+ OSL_ENSURE(bSuccess, "recursive call 2 failed?");
+ (void)bSuccess;
}
}
@@ -602,7 +601,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
std::vector<SwTxtAttr*> aInsDelHints;
std::vector<SwTxtAttr*>::iterator aIter;
- ASSERT( RES_TXTATR_CHARFMT == rNewHint.Which() ||
+ OSL_ENSURE( RES_TXTATR_CHARFMT == rNewHint.Which() ||
RES_TXTATR_AUTOFMT == rNewHint.Which(),
"Expecting CHARFMT or AUTOFMT" );
@@ -664,7 +663,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( !rNode.GetDoc()->IsInReading() )
CHECK;
#endif
@@ -705,7 +704,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
//
while ( aStartIter != aEndIter || bNoLengthAttribute )
{
- ASSERT( bNoLengthAttribute || nPorStart < *aStartIter, "AUTOSTYLES: BuildPortion trouble" )
+ OSL_ENSURE( bNoLengthAttribute || nPorStart < *aStartIter, "AUTOSTYLES: BuildPortion trouble" );
const xub_StrLen nPorEnd = bNoLengthAttribute ? nPorStart : *aStartIter;
aInsDelHints.clear();
@@ -726,7 +725,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
if ( pOther->GetEnd() && *pOther->GetEnd() == nPorEnd && nOtherStart == nPorStart )
{
- ASSERT( *pOther->GetEnd() == nPorEnd, "AUTOSTYLES: BuildPortion trouble" )
+ OSL_ENSURE( *pOther->GetEnd() == nPorEnd, "AUTOSTYLES: BuildPortion trouble" );
aInsDelHints.push_back( pOther );
}
}
@@ -768,7 +767,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
{
// remove all attributes from auto styles, which are explicitely set in
// the new character format:
- ASSERT( RES_TXTATR_AUTOFMT == (*aIter)->Which(), "AUTOSTYLES - Misc trouble" )
+ OSL_ENSURE( RES_TXTATR_AUTOFMT == (*aIter)->Which(), "AUTOSTYLES - Misc trouble" );
SwTxtAttr* pOther = *aIter;
boost::shared_ptr<SfxItemSet> pOldStyle = static_cast<const SwFmtAutoFmt&>(pOther->GetAttr()).GetStyleHandle();
@@ -983,7 +982,7 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr )
case RES_CHRATR_BACKGROUND:
break;
default:
- ASSERT(false, "unsupported redline attribute");
+ OSL_ENSURE(false, "unsupported redline attribute");
break;
}
@@ -1080,7 +1079,7 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
pNew = new SwTxtMeta( static_cast<SwFmtMeta&>(rNew), nStt, nEnd );
break;
default:
- ASSERT(RES_TXTATR_AUTOFMT == rNew.Which(), "unknown attribute");
+ OSL_ENSURE(RES_TXTATR_AUTOFMT == rNew.Which(), "unknown attribute");
pNew = new SwTxtAttrEnd( rNew, nStt, nEnd );
break;
}
@@ -1137,9 +1136,9 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
const SwField* pFld = pAttr->GetFld().GetFld();
//JP 06-08-95: DDE-Felder bilden eine Ausnahme
- ASSERT( RES_DDEFLD == pFld->GetTyp()->Which() ||
+ OSL_ENSURE( RES_DDEFLD == pFld->GetTyp()->Which() ||
this == ((SwTxtFld*)pAttr)->GetpTxtNode(),
- "Wo steht denn dieses Feld?" )
+ "Wo steht denn dieses Feld?" );
// bestimmte Felder mussen am Doc das Calculations-Flag updaten
switch( pFld->GetTyp()->Which() )
@@ -1208,7 +1207,7 @@ SwTxtNode::InsertItem( SfxPoolItem& rAttr,
const xub_StrLen nStart, const xub_StrLen nEnd, const SetAttrMode nMode )
{
// character attributes will be inserted as automatic styles:
- ASSERT( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
+ OSL_ENSURE( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
"SwTxtNode::InsertItem should not be called with character attributes");
SwTxtAttr* const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd );
@@ -1233,8 +1232,8 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
{
sal_Bool bHiddenPara = sal_False;
- ASSERT( pAttr && *pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
- ASSERT( !pAttr->GetEnd() || (*pAttr->GetEnd() <= Len()),
+ OSL_ENSURE( pAttr && *pAttr->GetStart() <= Len(), "StartIdx out of bounds!" );
+ OSL_ENSURE( !pAttr->GetEnd() || (*pAttr->GetEnd() <= Len()),
"EndIdx out of bounds!" );
// translate from SetAttrMode to InsertMode (for hints with CH_TXTATR)
@@ -1309,7 +1308,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
if( nsSetAttrMode::SETATTR_NOTXTATRCHR & nInsMode )
{
// loesche das Zeichen aus dem String !
- ASSERT( ( CH_TXTATR_BREAKWORD ==
+ OSL_ENSURE( ( CH_TXTATR_BREAKWORD ==
m_Text.GetChar(*pAttr->GetStart() ) ||
CH_TXTATR_INWORD ==
m_Text.GetChar(*pAttr->GetStart())),
@@ -1345,7 +1344,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
if( nsSetAttrMode::SETATTR_NOTXTATRCHR & nInsMode )
{
// loesche das Zeichen aus dem String !
- ASSERT( ( CH_TXTATR_BREAKWORD ==
+ OSL_ENSURE( ( CH_TXTATR_BREAKWORD ==
m_Text.GetChar(*pAttr->GetStart() ) ||
CH_TXTATR_INWORD ==
m_Text.GetChar(*pAttr->GetStart())),
@@ -1419,12 +1418,12 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// FussNote im Redline-Bereich NICHT ins FtnArray einfuegen!
if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() )
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
const sal_Bool bSuccess =
#endif
pDoc->GetFtnIdxs().Insert( pTxtFtn );
-#ifdef DBG_UTIL
- ASSERT( bSuccess, "FtnIdx nicht eingetragen." );
+#if OSL_DEBUG_LEVEL > 1
+ OSL_ENSURE( bSuccess, "FtnIdx nicht eingetragen." );
#endif
}
SwNodeIndex aTmpIndex( *this );
@@ -1475,7 +1474,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode )
// resulting in infinite recursion
if ( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nMode) )
{
- ASSERT( ( CH_TXTATR_BREAKWORD == m_Text.GetChar(nStart) ||
+ OSL_ENSURE( ( CH_TXTATR_BREAKWORD == m_Text.GetChar(nStart) ||
CH_TXTATR_INWORD == m_Text.GetChar(nStart) ),
"where is my attribute character?" );
SwIndex aIdx( this, nStart );
@@ -1500,7 +1499,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
{
if ( !HasHints() )
{
- ASSERT(false, "DeleteAttribute called, but text node without hints?");
+ OSL_ENSURE(false, "DeleteAttribute called, but text node without hints?");
return;
}
@@ -1547,7 +1546,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
{
if ( nWhich == RES_CHRATR_HIDDEN )
{
- ASSERT(false, "hey, that's a CHRATR! how did that get in?");
+ OSL_ENSURE(false, "hey, that's a CHRATR! how did that get in?");
SetCalcHiddenCharFlags();
}
else if ( nWhich == RES_TXTATR_CHARFMT )
@@ -1682,7 +1681,7 @@ sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
if ( pItem && (reinterpret_cast<SfxPoolItem*>(-1) != pItem))
{
const sal_uInt16 nWhich = pItem->Which();
- ASSERT( isCHRATR(nWhich) || isTXTATR(nWhich),
+ OSL_ENSURE( isCHRATR(nWhich) || isTXTATR(nWhich),
"SwTxtNode::SetAttr(): unknown attribute" );
if ( isCHRATR(nWhich) || isTXTATR(nWhich) )
{
@@ -1710,7 +1709,7 @@ sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt,
{
if ( nEnd != nStt && !pNew->GetEnd() )
{
- ASSERT(false,
+ OSL_ENSURE(false,
"Attribut without end, but area marked");
DestroyAttr( pNew ); // do not insert
}
@@ -1809,7 +1808,6 @@ public:
SwPoolItemEndPair() : mpItem( 0 ), mnEndPos( 0 ) {};
};
-// --> OD 2008-01-16 #newlistlevelattrs#
void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode,
SfxItemSet& rSet )
{
@@ -1831,7 +1829,6 @@ void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode,
}
// erfrage die Attribute vom TextNode ueber den Bereich
-// --> OD 2008-01-16 #newlistlevelattrs#
sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
sal_Bool bOnlyTxtAttr, sal_Bool bGetFromChrFmt,
const bool bMergeIndentValuesOfNumRule ) const
@@ -1859,12 +1856,10 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
if( !bOnlyTxtAttr )
{
SwCntntNode::GetAttr( aFmtSet );
- // --> OD 2008-01-16 #newlistlevelattrs#
if ( bMergeIndentValuesOfNumRule )
{
lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFmtSet );
}
- // <--
}
const sal_uInt16 nSize = m_pSwpHints->Count();
@@ -1950,7 +1945,7 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
while ( pItem )
{
const sal_uInt16 nHintWhich = pItem->Which();
- ASSERT(!isUNKNOWNATR(nHintWhich),
+ OSL_ENSURE(!isUNKNOWNATR(nHintWhich),
"SwTxtNode::GetAttr(): unkonwn attribute?");
if ( !pAttrArr.get() )
@@ -2048,12 +2043,10 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
{
// dann besorge mal die Auto-(Fmt)Attribute
SwCntntNode::GetAttr( rSet );
- // --> OD 2008-01-16 #newlistlevelattrs#
if ( bMergeIndentValuesOfNumRule )
{
lcl_MergeListLevelIndentAsLRSpaceItem( *this, rSet );
}
- // <--
}
return rSet.Count() ? sal_True : sal_False;
@@ -2100,7 +2093,7 @@ struct RemovePresentAttrs
const SwTxtAttr* const pAutoStyle(i_rAttrSpan.second);
SfxItemIter aIter(m_rAttrSet);
const SfxPoolItem* pItem(aIter.GetCurItem());
- while (true)
+ while (pItem)
{
const sal_uInt16 nWhich(pItem->Which());
if (CharFmt::IsItemIncluded(nWhich, pAutoStyle))
@@ -2168,7 +2161,7 @@ lcl_FillWhichIds(const SfxItemSet& i_rAttrSet, std::vector<sal_uInt16>& o_rClear
o_rClearIds.reserve(i_rAttrSet.Count());
SfxItemIter aIter(i_rAttrSet);
const SfxPoolItem* pItem(aIter.GetCurItem());
- while (true)
+ while (pItem)
{
o_rClearIds.push_back(pItem->Which());
@@ -2592,7 +2585,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
{
if ( USHRT_MAX == Count() ) // we're sorry, this flight is overbooked...
{
- ASSERT(false, "hints array full :-(");
+ OSL_ENSURE(false, "hints array full :-(");
return false;
}
@@ -2788,7 +2781,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
{
SwpHintsArray::Insert( pHint );
CalcFlags();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( !rNode.GetDoc()->IsInReading() )
CHECK;
#endif
@@ -2806,7 +2799,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
if( *pHtEnd < nHtStart )
{
- ASSERT( *pHtEnd >= nHtStart,
+ OSL_ENSURE( *pHtEnd >= nHtStart,
"+SwpHints::Insert: invalid hint, end < start" );
// Wir drehen den Quatsch einfach um:
@@ -2838,10 +2831,10 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
( RES_TXTATR_AUTOFMT == nWhich ||
RES_TXTATR_CHARFMT == nWhich ) )
{
- ASSERT( nWhich != RES_TXTATR_AUTOFMT ||
+ OSL_ENSURE( nWhich != RES_TXTATR_AUTOFMT ||
static_cast<const SwFmtAutoFmt&>(pHint->GetAttr()).GetStyleHandle()->GetPool() ==
&rNode.GetDoc()->GetAttrPool(),
- "AUTOSTYLES - Pool mismatch" )
+ "AUTOSTYLES - Pool mismatch" );
BuildPortions( rNode, *pHint, nMode );
@@ -2881,7 +2874,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
rNode.Modify( 0, &aHint );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( !bNoHintAdjustMode && !rNode.GetDoc()->IsInReading() )
CHECK;
#endif
@@ -2926,13 +2919,13 @@ void SwpHints::DeleteAtPos( const sal_uInt16 nPos )
}
// Ist der Hint schon bekannt, dann suche die Position und loesche ihn.
-// Ist er nicht im Array, so gibt es ein ASSERT !!
+// Ist er nicht im Array, so gibt es ein OSL_ENSURE(!!
void SwpHints::Delete( SwTxtAttr* pTxtHt )
{
// Attr 2.0: SwpHintsArr::Delete( pTxtHt );
const sal_uInt16 nPos = GetStartOf( pTxtHt );
- ASSERT( USHRT_MAX != nPos, "Attribut nicht im Attribut-Array!" );
+ OSL_ENSURE( USHRT_MAX != nPos, "Attribut nicht im Attribut-Array!" );
if( USHRT_MAX != nPos )
DeleteAtPos( nPos );
}
@@ -3061,10 +3054,11 @@ sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr )
break;
default:
- ASSERT(false, "GetCharOfTxtAttr: unknown attr");
+ OSL_ENSURE(false, "GetCharOfTxtAttr: unknown attr");
break;
}
return cRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx
index f79db265d4fd..ae370d5afe42 100644
--- a/sw/source/core/txtnode/txatbase.cxx
+++ b/sw/source/core/txtnode/txatbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,4 @@ xub_StrLen* SwTxtAttrEnd::GetEnd()
return & m_nEnd;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index 7511dee4009a..5bbab28687ce 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <tools/string.hxx>
#include <editeng/langitem.hxx>
#include <txatritr.hxx>
@@ -244,3 +243,4 @@ void SwTxtAttrIterator::SearchNextChg()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index f6dcfc520eae..599d0853b1c1 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ SwTxtCharFmt::~SwTxtCharFmt( )
void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
+ OSL_ENSURE( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtCharFmt::Modify(): unknown Modify");
@@ -189,7 +190,7 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
+ OSL_ENSURE( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtINetFmt::Modify(): unknown Modify");
@@ -238,7 +239,7 @@ SwTxtRuby::~SwTxtRuby()
void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
+ OSL_ENSURE( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
|| (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich),
"SwTxtRuby::Modify(): unknown Modify");
@@ -336,3 +337,4 @@ void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 4b99670b865c..bfb76e8a552d 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-// So kann man die Linguistik-Statistik ( (Tmp-Path)\swlingu.stk ) aktivieren:
-//#define LINGU_STATISTIK
-#ifdef LINGU_STATISTIK
- #include <stdio.h> // in SwLinguStatistik::DTOR
- #include <stdlib.h> // getenv()
- #include <time.h> // clock()
- #include <tools/stream.hxx>
-#endif
-
#include <hintids.hxx>
#include <vcl/svapp.hxx>
#include <svl/itemiter.hxx>
@@ -92,7 +84,6 @@
#include <vector>
-
using rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -334,7 +325,7 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
if ( !pSet1 )
{
- ASSERT( nWhichId, "lcl_HaveCommonAttributes not used correctly" )
+ OSL_ENSURE( nWhichId, "lcl_HaveCommonAttributes not used correctly" );
if ( SFX_ITEM_SET == rSet2.GetItemState( nWhichId, sal_False ) )
{
pNewSet = rSet2.Clone( sal_True );
@@ -480,7 +471,6 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
continue;
}
-
if( nStt <= nAttrStart ) // Faelle: 1,3,5
{
if( nEnd > nAttrStart
@@ -598,7 +588,6 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
nsSetAttrMode::SETATTR_NOHINTADJUST );
}
-
// jetzt kein i+1, weil das eingefuegte Attribut
// ein anderes auf die Position geschoben hat !
continue;
@@ -623,8 +612,6 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
}
}
-
-
/*************************************************************************
* SwTxtNode::GetCurWord()
*
@@ -638,7 +625,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
{
- ASSERT( nPos <= m_Text.Len(), "SwTxtNode::GetCurWord: invalid index." );
+ OSL_ENSURE( nPos <= m_Text.Len(), "SwTxtNode::GetCurWord: invalid index." );
if (!m_Text.Len())
return m_Text;
@@ -679,7 +666,7 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageTy
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" );
+ OSL_ENSURE( rText.Len(), "SwScanner: EmptyString" );
nStartPos = nBegin = nStart;
nEndPos = nEnde;
@@ -736,7 +723,7 @@ sal_Bool SwScanner::NextWord()
// get the word boundaries
aBound = pBreakIt->GetBreakIter()->getWordBoundary( rText, nBegin,
pBreakIt->GetLocale( aCurrLang ), nWordType, sal_True );
- ASSERT( aBound.endPos >= aBound.startPos, "broken aBound result" );
+ OSL_ENSURE( aBound.endPos >= aBound.startPos, "broken aBound result" );
//no word boundaries could be found
if(aBound.endPos == aBound.startPos)
@@ -764,7 +751,7 @@ sal_Bool SwScanner::NextWord()
// we have to differenciate between these cases:
if ( aBound.startPos <= nBegin )
{
- ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" )
+ OSL_ENSURE( aBound.endPos >= nBegin, "Unexpected aBound result" );
// restrict boundaries to script boundaries and nEndPos
const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
@@ -818,7 +805,6 @@ sal_Bool SwScanner::NextWord()
return sal_True;
}
-
sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
{
// Die Aehnlichkeiten zu SwTxtFrm::_AutoSpell sind beabsichtigt ...
@@ -946,7 +932,6 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
return pArgs->xSpellAlt.is() ? 1 : 0;
}
-
void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
LanguageType nLang, sal_uInt16 nLangWhichId,
const Font *pFont, sal_uInt16 nFontWhichId )
@@ -982,7 +967,6 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
}
-
sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs )
{
// get range of text within node to be converted
@@ -1413,7 +1397,6 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
return aRet;
}
-
// Wird vom CollectAutoCmplWords gerufen
void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
{
@@ -1429,7 +1412,6 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
xub_StrLen nLen;
sal_Bool bACWDirty = sal_False, bAnyWrd = sal_False;
-
if( nBegin < nEnd )
{
sal_uInt16 nCnt = 200;
@@ -1465,7 +1447,6 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
pNode->SetAutoCompleteWordDirty( sal_False );
}
-
/*************************************************************************
* SwTxtNode::Hyphenate
*************************************************************************/
@@ -1494,9 +1475,9 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
{
// 4935: Seit der Trennung ueber Sonderbereiche sind Faelle
// moeglich, in denen kein Frame zum Node vorliegt.
- // Also kein ASSERT!
+ // Also keinOSL_ENSURE
#if OSL_DEBUG_LEVEL > 1
- ASSERT( pFrm, "!SwTxtNode::Hyphenate: can't find any frame" );
+ OSL_ENSURE( pFrm, "!SwTxtNode::Hyphenate: can't find any frame" );
#endif
return sal_False;
}
@@ -1521,80 +1502,6 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
return sal_False;
}
-#ifdef LINGU_STATISTIK
-
-// globale Variable
-SwLinguStatistik aSwLinguStat;
-
-
-void SwLinguStatistik::Flush()
-{
- if ( !nWords )
- return ;
-
- static char *pLogName = 0;
- const sal_Bool bFirstOpen = pLogName ? sal_False : sal_True;
- if( bFirstOpen )
- {
- char *pPath = getenv( "TEMP" );
- char *pName = "swlingu.stk";
- if( !pPath )
- pLogName = pName;
- else
- {
- const int nLen = strlen(pPath);
- // fuer dieses new wird es kein delete geben.
- pLogName = new char[nLen + strlen(pName) + 3];
- if(nLen && (pPath[nLen-1] == '\\') || (pPath[nLen-1] == '/'))
- snprintf( pLogName, sizeof(pLogName), "%s%s", pPath, pName );
- else
- snprintf( pLogName, sizeof(pLogName), "%s/%s", pPath, pName );
- }
- }
- SvFileStream aStream( String::CreateFromAscii(pLogName), (bFirstOpen
- ? STREAM_WRITE | STREAM_TRUNC
- : STREAM_WRITE ));
-
- if( !aStream.GetError() )
- {
- if ( bFirstOpen )
- aStream << "\nLinguistik-Statistik\n";
- aStream << endl << ++nFlushCnt << ". Messung\n";
- aStream << "Rechtschreibung\n";
- aStream << "gepruefte Worte: \t" << nWords << endl;
- aStream << "als fehlerhaft erkannt:\t" << nWrong << endl;
- aStream << "Alternativvorschlaege:\t" << nAlter << endl;
- if ( nWrong )
- aStream << "Durchschnitt:\t\t" << nAlter*1.0 / nWrong << endl;
- aStream << "Dauer (msec):\t\t" << nSpellTime << endl;
- aStream << "\nThesaurus\n";
- aStream << "Synonyme gesamt:\t" << nSynonym << endl;
- if ( nSynonym )
- aStream << "Synonym-Durchschnitt:\t" <<
- nSynonym*1.0 / ( nWords - nNoSynonym ) << endl;
- aStream << "ohne Synonyme:\t\t" << nNoSynonym << endl;
- aStream << "Bedeutungen gesamt:\t" << nSynonym << endl;
- aStream << "keine Bedeutungen:\t"<< nNoSynonym << endl;
- aStream << "Dauer (msec):\t\t" << nTheTime << endl;
- aStream << "\nHyphenator\n";
- aStream << "Trennstellen gesamt:\t" << nHyphens << endl;
- if ( nHyphens )
- aStream << "Hyphen-Durchschnitt:\t" <<
- nHyphens*1.0 / ( nWords - nNoHyph - nHyphErr ) << endl;
- aStream << "keine Trennstellen:\t" << nNoHyph << endl;
- aStream << "Trennung verweigert:\t" << nHyphErr << endl;
- aStream << "Dauer (msec):\t\t" << nHyphTime << endl;
- aStream << "---------------------------------------------\n";
- }
- nWords = nWrong = nAlter = nSynonym = nNoSynonym =
- nHyphens = nNoHyph = nHyphErr = nSpellTime = nTheTime =
- nHyphTime = 0;
- //pThes = NULL;
-}
-
-#endif
-
-
struct TransliterationChgData
{
xub_StrLen nStart;
@@ -1838,7 +1745,6 @@ void SwTxtNode::TransliterateText(
}
}
-
void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
const XubString& rText,
const Sequence<sal_Int32>& rOffsets )
@@ -1886,108 +1792,129 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
void SwTxtNode::CountWords( SwDocStat& rStat,
xub_StrLen nStt, xub_StrLen nEnd ) const
{
+ sal_Bool isCountAll = ( (0 == nStt) && (GetTxt().Len() == nEnd) );
+
++rStat.nAllPara; // #i93174#: count _all_ paragraphs
- if( nStt < nEnd )
+ if( nStt >= nEnd )
+ { // empty node or empty selection or bad call
+ return;
+ }
+ if ( IsHidden() )
+ { // not counting hidden paras
+ return;
+ }
+ // Shortcut when counting whole paragraph and current count is clean
+ if ( isCountAll && !IsWordCountDirty() )
{
- if ( !IsHidden() )
- {
- ++rStat.nPara;
- sal_uLong nTmpWords = 0;
- sal_uLong nTmpChars = 0;
-
- // Shortcut: Whole paragraph should be considered and cached values
- // are valid:
- if ( 0 == nStt && GetTxt().Len() == nEnd && !IsWordCountDirty() )
- {
- nTmpWords = GetParaNumberOfWords();
- nTmpChars = GetParaNumberOfChars();
- }
- else
- {
- String aOldStr( m_Text );
- String& rCastStr = const_cast<String&>(m_Text);
+ // accumulate into DocStat record to return the values
+ rStat.nWord += GetParaNumberOfWords();
+ rStat.nChar += GetParaNumberOfChars();
+ rStat.nCharExcludingSpaces += GetParaNumberOfCharsExcludingSpaces();
+ return;
+ }
- // fills the deleted redlines and hidden ranges with cChar:
- const xub_Unicode cChar(' ');
- const sal_uInt16 nNumOfMaskedChars =
- lcl_MaskRedlinesAndHiddenText( *this, rCastStr, nStt, nEnd, cChar, false );
+ // make a copy of the text
+ String& rTextCopy = const_cast<String&>(m_Text);
- // expand fields
- rtl::OUString aExpandText;
- const ModelToViewHelper::ConversionMap* pConversionMap =
- BuildConversionMap( aExpandText );
+ // mask out the redlined and hidden text with ' '
+ const xub_Unicode cChar(' ');
+ const sal_uInt16 nNumOfMaskedChars = lcl_MaskRedlinesAndHiddenText( *this, rTextCopy, nStt, nEnd, cChar, false );
- const sal_uInt32 nExpandBegin = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nStt );
- const sal_uInt32 nExpandEnd = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nEnd );
+ // expand text into pConversionMap for scanner
+ rtl::OUString aExpandText;
+ const ModelToViewHelper::ConversionMap* pConversionMap = BuildConversionMap( aExpandText );
- const bool bCount = aExpandText.getLength() > 0;
+ // map start and end points onto the ConversionMap
+ const sal_uInt32 nExpandBegin = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nStt );
+ const sal_uInt32 nExpandEnd = ModelToViewHelper::ConvertToViewPosition( pConversionMap, nEnd );
- // count words in 'regular' text:
- if( bCount && pBreakIt->GetBreakIter().is() )
- {
- const String aScannerText( aExpandText );
- SwScanner aScanner( *this, aScannerText, 0, pConversionMap,
- i18n::WordType::WORD_COUNT,
- (xub_StrLen)nExpandBegin, (xub_StrLen)nExpandEnd );
+ if ( aExpandText.getLength() <= 0 )
+ {
+ OSL_ENSURE(aExpandText.getLength() >= 0, "Node text expansion error: length < 0." );
+ return;
+ }
- const rtl::OUString aBreakWord( CH_TXTATR_BREAKWORD );
+ //do the count
+ // all counts exclude hidden paras and hidden+redlined within para
+ // definition of space/white chars in SwScanner (and BreakIter!)
+ // uses both lcl_IsSkippableWhiteSpace and BreakIter getWordBoundary in SwScanner
+ sal_uInt32 nTmpWords = 0; // count of all contiguous blocks of non-white chars
+ sal_uInt32 nTmpChars = 0; // count of all chars
+ sal_uInt32 nTmpCharsExcludingSpaces = 0; // all non-white chars
- while ( aScanner.NextWord() )
- {
- if ( aScanner.GetLen() > 1 ||
- CH_TXTATR_BREAKWORD != aExpandText.match(aBreakWord, aScanner.GetBegin() ) )
- ++nTmpWords;
- }
- }
+ ++rStat.nPara; // count of non-empty paras
- ASSERT( aExpandText.getLength() >= nNumOfMaskedChars,
- "More characters hidden that characters in string!" )
- nTmpChars = nExpandEnd - nExpandBegin - nNumOfMaskedChars;
+ // count words in masked and expanded text:
+ if( pBreakIt->GetBreakIter().is() )
+ {
+ const String aScannerText( aExpandText );
+ // zero is NULL for pLanguage -----------v last param = true for clipping
+ SwScanner aScanner( *this, aScannerText, 0, pConversionMap, i18n::WordType::WORD_COUNT,
+ (xub_StrLen)nExpandBegin, (xub_StrLen)nExpandEnd, true );
- // count words in numbering string:
- if ( nStt == 0 && bCount )
- {
- // add numbering label
- const String aNumString = GetNumString();
- const xub_StrLen nNumStringLen = aNumString.Len();
- if ( nNumStringLen > 0 )
- {
- LanguageType aLanguage = GetLang( 0 );
+ // used to filter out scanner returning almost empty strings (len=1; unichar=0x0001)
+ const rtl::OUString aBreakWord( CH_TXTATR_BREAKWORD );
- SwScanner aScanner( *this, aNumString, &aLanguage, 0,
- i18n::WordType::WORD_COUNT,
- 0, nNumStringLen );
+ while ( aScanner.NextWord() )
+ {
+ // 1 is len(CH_TXTATR_BREAKWORD) : match returns length of match
+ if( 1 != aExpandText.match(aBreakWord, aScanner.GetBegin() ))
+ {
+ ++nTmpWords;
+ nTmpCharsExcludingSpaces += aScanner.GetLen();
+ }
+ }
+ }
- while ( aScanner.NextWord() )
- ++nTmpWords;
+ nTmpChars = nExpandEnd - nExpandBegin - nNumOfMaskedChars;
- nTmpChars += nNumStringLen;
- }
- else if ( HasBullet() )
- {
- ++nTmpWords;
- ++nTmpChars;
- }
- }
+ // no nTmpCharsExcludingSpaces adjust needed neither for blanked out MaskedChars
+ // nor for mid-word selection - set scanner bClip = true at creation
- delete pConversionMap;
+ // count words in numbering string if started at beginning of para:
+ if ( nStt == 0 )
+ {
+ // count outline number label - ? no expansion into map
+ // always counts all of number-ish label
+ const String aNumString = GetNumString();
+ const xub_StrLen nNumStringLen = aNumString.Len();
+ if ( nNumStringLen > 0 )
+ {
+ LanguageType aLanguage = GetLang( 0 );
- rCastStr = aOldStr;
+ SwScanner aScanner( *this, aNumString, &aLanguage, 0,
+ i18n::WordType::WORD_COUNT, 0, nNumStringLen, true );
- // If the whole paragraph has been calculated, update cached
- // values:
- if ( 0 == nStt && GetTxt().Len() == nEnd )
- {
- SetParaNumberOfWords( nTmpWords );
- SetParaNumberOfChars( nTmpChars );
- SetWordCountDirty( false );
- }
+ while ( aScanner.NextWord() )
+ {
+ ++nTmpWords;
+ nTmpCharsExcludingSpaces += aScanner.GetLen();
}
- rStat.nWord += nTmpWords;
- rStat.nChar += nTmpChars;
+ nTmpChars += nNumStringLen;
+ }
+ else if ( HasBullet() )
+ {
+ ++nTmpWords;
+ ++nTmpChars;
+ ++nTmpCharsExcludingSpaces;
}
}
+
+ delete pConversionMap;
+
+ // If counting the whole para then update cached values and mark clean
+ if ( isCountAll )
+ {
+ SetParaNumberOfWords( nTmpWords );
+ SetParaNumberOfChars( nTmpChars );
+ SetParaNumberOfCharsExcludingSpaces( nTmpCharsExcludingSpaces );
+ SetWordCountDirty( false );
+ }
+ // accumulate into DocStat record to return the values
+ rStat.nWord += nTmpWords;
+ rStat.nChar += nTmpChars;
+ rStat.nCharExcludingSpaces += nTmpCharsExcludingSpaces;
}
//
@@ -1995,16 +1922,17 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
//
struct SwParaIdleData_Impl
{
- SwWrongList* pWrong; // for spell checking
+ SwWrongList* pWrong; // for spell checking
SwGrammarMarkUp* pGrammarCheck; // for grammar checking / proof reading
SwWrongList* pSmartTags;
sal_uLong nNumberOfWords;
sal_uLong nNumberOfChars;
- bool bWordCountDirty : 1;
- bool bWrongDirty : 1; // Ist das Wrong-Feld auf invalid?
- bool bGrammarCheckDirty : 1;
- bool bSmartTagDirty : 1;
- bool bAutoComplDirty : 1; // die ACompl-Liste muss angepasst werden
+ sal_uLong nNumberOfCharsExcludingSpaces;
+ bool bWordCountDirty;
+ bool bWrongDirty; // Ist das Wrong-Feld auf invalid?
+ bool bGrammarCheckDirty;
+ bool bSmartTagDirty;
+ bool bAutoComplDirty; // die ACompl-Liste muss angepasst werden
SwParaIdleData_Impl() :
pWrong ( 0 ),
@@ -2012,6 +1940,7 @@ struct SwParaIdleData_Impl
pSmartTags ( 0 ),
nNumberOfWords ( 0 ),
nNumberOfChars ( 0 ),
+ nNumberOfCharsExcludingSpaces ( 0 ),
bWordCountDirty ( true ),
bWrongDirty ( true ),
bGrammarCheckDirty ( true ),
@@ -2059,7 +1988,6 @@ const SwWrongList* SwTxtNode::GetWrong() const
}
// <--
-
void SwTxtNode::SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete )
{
if ( m_pParaIdleData_Impl )
@@ -2079,8 +2007,8 @@ SwGrammarMarkUp* SwTxtNode::GetGrammarCheck()
void SwTxtNode::SetSmartTags( SwWrongList* pNew, bool bDelete )
{
- ASSERT( !pNew || SwSmartTagMgr::Get().IsSmartTagsEnabled(),
- "Weird - we have a smart tag list without any recognizers?" )
+ OSL_ENSURE( !pNew || SwSmartTagMgr::Get().IsSmartTagsEnabled(),
+ "Weird - we have a smart tag list without any recognizers?" );
if ( m_pParaIdleData_Impl )
{
@@ -2126,6 +2054,20 @@ void SwTxtNode::SetWordCountDirty( bool bNew ) const
m_pParaIdleData_Impl->bWordCountDirty = bNew;
}
}
+
+sal_uLong SwTxtNode::GetParaNumberOfCharsExcludingSpaces() const
+{
+ return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces : 0;
+}
+
+void SwTxtNode::SetParaNumberOfCharsExcludingSpaces( sal_uLong nNew ) const
+{
+ if ( m_pParaIdleData_Impl )
+ {
+ m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces = nNew;
+ }
+}
+
bool SwTxtNode::IsWordCountDirty() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->bWordCountDirty : 0;
@@ -2177,3 +2119,5 @@ bool SwTxtNode::IsAutoCompleteWordDirty() const
//
// Paragraph statistics end
//
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwRewriter.cxx b/sw/source/core/undo/SwRewriter.cxx
index 129bdc8f9b59..afde2760904d 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,9 +71,10 @@ String SwRewriter::Apply(const String & rStr) const
String aResult = rStr;
vector<SwRewriteRule>::const_iterator aIt;
- for (aIt = mRules.begin(); aIt != mRules.end(); aIt++)
+ for (aIt = mRules.begin(); aIt != mRules.end(); ++aIt)
aResult.SearchAndReplaceAll(aIt->first, aIt->second);
return aResult;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 44314b88b94e..b89f38dc23c4 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,9 +76,9 @@ SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos,
, pHnt(_pHnt)
, bUpdate(_bUpdate)
{
- ASSERT(pOldField, "No old field!");
- ASSERT(pNewField, "No new field!");
- ASSERT(pDoc, "No document!");
+ OSL_ENSURE(pOldField, "No old field!");
+ OSL_ENSURE(pNewField, "No new field!");
+ OSL_ENSURE(pDoc, "No document!");
}
SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
@@ -89,7 +90,8 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
- const SwField * pField = pTxtFld->GetFld().GetFld();
+
+ const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
if (pField)
{
@@ -100,7 +102,7 @@ void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &)
void SwUndoFieldFromDoc::DoImpl()
{
SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
- const SwField * pField = pTxtFld->GetFld().GetFld();
+ const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
if (pField)
{
@@ -160,3 +162,4 @@ void SwUndoFieldFromAPI::RepeatImpl(::sw::RepeatContext &)
DoImpl();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx
index a9896b7235ce..a63b09519bc3 100644
--- a/sw/source/core/undo/SwUndoFmt.cxx
+++ b/sw/source/core/undo/SwUndoFmt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -457,3 +458,5 @@ SwRewriter SwUndoNumruleRename::GetRewriter() const
return aRewriter;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 9ff300ad14dd..49bcb0d4175e 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,12 +54,6 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
sal_uLong nHeaderLeft = ULONG_MAX;
sal_uLong nFooterMaster = ULONG_MAX;
sal_uLong nFooterLeft = ULONG_MAX;
- int nHeaderCount = 0;
- int nLeftHeaderCount = 0;
- int nFooterCount = 0;
- int nLeftFooterCount = 0;
- bool bSharedHeader = false;
- bool bSharedFooter = false;
SwFmtHeader& rHead = (SwFmtHeader&)rPageDesc.GetMaster().GetHeader();
SwFmtFooter& rFoot = (SwFmtFooter&)rPageDesc.GetMaster().GetFooter();
@@ -72,27 +67,32 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwClientIter aIter( *pHeaderFmt );
SwClient *pLast = aIter.GoStart();
if( pLast )
+ {
+ int nHeaderCount = 0;
do
{
++nHeaderCount;
} while( 0 != ( pLast = aIter++ ));
+ }
const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex();
else
nHeaderMaster = 0;
}
- bSharedHeader = rPageDesc.IsHeaderShared();
SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt();
if( pLeftHeaderFmt )
{
SwClientIter aIter( *pLeftHeaderFmt );
SwClient *pLast = aIter.GoStart();
if( pLast )
+ {
+ int nLeftHeaderCount = 0;
do
{
++nLeftHeaderCount;
} while( 0 != ( pLast = aIter++ ));
+ }
const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -108,27 +108,32 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwClientIter aIter( *pFooterFmt );
SwClient *pLast = aIter.GoStart();
if( pLast )
+ {
+ int nFooterCount = 0;
do
{
++nFooterCount;
} while( 0 != ( pLast = aIter++ ));
+ }
const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nFooterMaster = pCntnt->GetCntntIdx()->GetIndex();
else
nFooterMaster = 0;
}
- bSharedFooter = rPageDesc.IsFooterShared();
SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt();
if( pLeftFooterFmt )
{
SwClientIter aIter( *pLeftFooterFmt );
SwClient *pLast = aIter.GoStart();
if( pLast )
+ {
+ int nLeftFooterCount = 0;
do
{
++nLeftFooterCount;
} while( 0 != ( pLast = aIter++ ));
+ }
const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -149,7 +154,7 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
UNDO_CHANGE_PAGEDESC ),
aOld(_aOld, _pDoc), aNew(_aNew, _pDoc), pDoc(_pDoc), bExchange( false )
{
- ASSERT(0 != pDoc, "no document?");
+ OSL_ENSURE(0 != pDoc, "no document?");
#ifdef DEBUG
DebugHeaderFooterContent( (SwPageDesc&)aOld );
@@ -228,7 +233,7 @@ SwUndoPageDesc::~SwUndoPageDesc()
void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDest )
{
- ASSERT( bExchange, "You shouldn't do that." );
+ OSL_ENSURE( bExchange, "You shouldn't do that." );
const SwFmtHeader& rDestHead = rDest.GetMaster().GetHeader();
const SwFmtHeader& rSourceHead = rSource.GetMaster().GetHeader();
if( rDestHead.IsActive() )
@@ -359,7 +364,7 @@ SwUndoPageDescCreate::SwUndoPageDescCreate(const SwPageDesc * pNew,
: SwUndo(UNDO_CREATE_PAGEDESC), pDesc(pNew), aNew(*pNew, _pDoc),
pDoc(_pDoc)
{
- ASSERT(0 != pDoc, "no document?");
+ OSL_ENSURE(0 != pDoc, "no document?");
}
SwUndoPageDescCreate::~SwUndoPageDescCreate()
@@ -413,7 +418,7 @@ SwUndoPageDescDelete::SwUndoPageDescDelete(const SwPageDesc & _aOld,
SwDoc * _pDoc)
: SwUndo(UNDO_DELETE_PAGEDESC), aOld(_aOld, _pDoc), pDoc(_pDoc)
{
- ASSERT(0 != pDoc, "no document?");
+ OSL_ENSURE(0 != pDoc, "no document?");
}
SwUndoPageDescDelete::~SwUndoPageDescDelete()
@@ -450,3 +455,5 @@ SwRewriter SwUndoPageDescDelete::GetRewriter() const
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/SwUndoTOXChange.cxx b/sw/source/core/undo/SwUndoTOXChange.cxx
index 457ddc366e7c..8b5b8c254090 100644
--- a/sw/source/core/undo/SwUndoTOXChange.cxx
+++ b/sw/source/core/undo/SwUndoTOXChange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,4 @@ void SwUndoTOXChange::RepeatImpl(::sw::RepeatContext &)
DoImpl();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 2e91da080c7c..441bf84096a4 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -300,7 +301,6 @@ UndoManager::GetLastUndoInfo(
}
SfxUndoAction *const pAction( SfxUndoManager::GetUndoAction(0) );
-
if (o_pStr)
{
*o_pStr = pAction->GetComment();
@@ -333,7 +333,6 @@ SwUndoComments_t UndoManager::GetUndoComments() const
/**************** REDO ******************/
-
bool UndoManager::GetFirstRedoInfo(::rtl::OUString *const o_pStr) const
{
if (!SfxUndoManager::GetRedoActionCount(CurrentLevel))
@@ -579,3 +578,4 @@ UndoManager::Repeat(::sw::RepeatContext & rContext,
} // namespace sw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 30b856668bdb..a58c21d2e619 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -188,9 +189,7 @@ SwHistorySetFmt::~SwHistorySetFmt()
}
-// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, sal_uLong nNodeIdx)
-// <--
: SwHistoryHint( HSTRY_RESETFMTHNT )
, m_nNodeIndex( nNodeIdx )
, m_nWhich( pFmtHt->Which() )
@@ -256,7 +255,7 @@ void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool )
}
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistorySetTxt::SetInDoc: not a TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistorySetTxt::SetInDoc: not a TextNode" );
if ( pTxtNd )
{
@@ -318,7 +317,7 @@ void SwHistorySetTxtFld::SetInDoc( SwDoc* pDoc, bool )
m_pFld->GetFld()->ChgTyp( pNewFldType ); // change field type
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistorySetTxtFld: no TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistorySetTxtFld: no TextNode" );
if ( pTxtNd )
{
@@ -342,7 +341,7 @@ SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodeP
void SwHistorySetRefMark::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistorySetRefMark: no TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistorySetRefMark: no TextNode" );
if ( !pTxtNd )
return;
@@ -374,7 +373,7 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodeP
void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistorySetTOXMark: no TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistorySetTOXMark: no TextNode" );
if ( !pTxtNd )
return;
@@ -428,7 +427,7 @@ SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich,
void SwHistoryResetTxt::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistoryResetTxt: no TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistoryResetTxt: no TextNode" );
if ( pTxtNd )
{
pTxtNd->DeleteAttributes( m_nAttr, m_nStart, m_nEnd );
@@ -444,7 +443,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePo
, m_nStart( *pTxtFtn->GetStart() )
, m_bEndNote( pTxtFtn->GetFtn().IsEndNote() )
{
- ASSERT( pTxtFtn->GetStartNode(),
+ OSL_ENSURE( pTxtFtn->GetStartNode(),
"SwHistorySetFootnote: Footnote without Section" );
// merke die alte NodePos, denn wer weiss was alles in der SaveSection
@@ -469,7 +468,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( const SwTxtFtn &rTxtFtn )
, m_nStart( *rTxtFtn.GetStart() )
, m_bEndNote( rTxtFtn.GetFtn().IsEndNote() )
{
- ASSERT( rTxtFtn.GetStartNode(),
+ OSL_ENSURE( rTxtFtn.GetStartNode(),
"SwHistorySetFootnote: Footnote without Section" );
}
@@ -486,7 +485,7 @@ SwHistorySetFootnote::~SwHistorySetFootnote()
void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
- ASSERT( pTxtNd, "SwHistorySetFootnote: no TextNode" );
+ OSL_ENSURE( pTxtNd, "SwHistorySetFootnote: no TextNode" );
if ( !pTxtNd )
return;
@@ -542,7 +541,7 @@ SwHistoryChangeFmtColl::SwHistoryChangeFmtColl( SwFmtColl* pFmtColl, sal_uLong n
void SwHistoryChangeFmtColl::SetInDoc( SwDoc* pDoc, bool )
{
SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode();
- ASSERT( pCntntNd, "SwHistoryChangeFmtColl: no ContentNode" );
+ OSL_ENSURE( pCntntNd, "SwHistoryChangeFmtColl: no ContentNode" );
// before setting the format, check if it is still available in the
// document. if it has been deleted, there is no undo!
@@ -569,7 +568,7 @@ SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt )
: SwHistoryHint( HSTRY_FLYCNT )
, m_pUndo( new SwUndoDelLayFmt( pFlyFmt ) )
{
- ASSERT( pFlyFmt, "SwHistoryTxtFlyCnt: no Format" );
+ OSL_ENSURE( pFlyFmt, "SwHistoryTxtFlyCnt: no Format" );
m_pUndo->ChgShowSel( sal_False );
}
@@ -843,7 +842,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
case RES_TXTATR_FTN:
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
- ASSERT(rSet.Count() == 1,
+ OSL_ENSURE(rSet.Count() == 1,
"text attribute with CH_TXTATR, but not the only one:"
"\nnot such a good idea");
break;
@@ -879,7 +878,7 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode();
- ASSERT( pCntntNd, "SwHistoryResetAttrSet: no CntntNode" );
+ OSL_ENSURE( pCntntNd, "SwHistoryResetAttrSet: no CntntNode" );
if (pCntntNd)
{
@@ -933,7 +932,7 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
SwPosition aPos( *pNd );
if ( STRING_MAXLEN != m_nOldContentIndex )
{
- ASSERT(pCNd, "SwHistoryChangeFlyAnchor: no ContentNode");
+ OSL_ENSURE(pCNd, "SwHistoryChangeFlyAnchor: no ContentNode");
if (pCNd)
{
aPos.nContent.Assign( pCNd, m_nOldContentIndex );
@@ -1035,17 +1034,13 @@ SwHistory::~SwHistory()
|* void SwHistory::Add()
|*
|* Beschreibung Dokument 1.0
-|* Ersterstellung JP 18.02.91
-|* Letzte Aenderung JP 18.02.91
|*
*************************************************************************/
-// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
sal_uLong nNodeIdx )
-// <--
{
- ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
sal_uInt16 nWhich = pNewValue->Which();
if( (nWhich >= POOLATTR_END) || (nWhich == RES_TXTATR_FIELD) )
@@ -1067,7 +1062,7 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
{
- ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHt;
sal_uInt16 nAttrWhich = pHint->Which();
@@ -1112,7 +1107,7 @@ void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
{
- ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHt =
new SwHistoryChangeFmtColl( pColl, nNodeIdx, nWhichNd );
@@ -1122,7 +1117,7 @@ void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
void SwHistory::Add(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOtherPos)
{
- ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHt = new SwHistoryBookmark(rBkmk, bSavePos, bSaveOtherPos);
m_SwpHstry.Insert( pHt, Count() );
@@ -1137,7 +1132,7 @@ void SwHistory::Add( SwFrmFmt& rFmt )
void SwHistory::Add( SwFlyFrmFmt& rFmt, sal_uInt16& rSetPos )
{
- ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
+ OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
SwHistoryHint * pHint;
const sal_uInt16 nWh = rFmt.Which();
@@ -1191,8 +1186,6 @@ void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt)
|* sal_Bool SwHistory::Rollback()
|*
|* Beschreibung Dokument 1.0
-|* Ersterstellung JP 18.02.91
-|* Letzte Aenderung JP 18.02.91
|*
*************************************************************************/
@@ -1256,7 +1249,7 @@ void SwHistory::Delete( sal_uInt16 nStart )
sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd )
{
- ASSERT( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
+ OSL_ENSURE( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
sal_uInt16 nOld = Count() - m_nEndDiff;
m_nEndDiff = Count() - nNewTmpEnd;
@@ -1437,7 +1430,7 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
SwTxtNode * const pTxtNode =
dynamic_cast<SwTxtNode *>(const_cast<SwModify *>(GetRegisteredIn()));
- ASSERT(pTxtNode, "SwRegHistory not registered at text node?");
+ OSL_ENSURE(pTxtNode, "SwRegHistory not registered at text node?");
if (!pTxtNode)
return false;
@@ -1520,3 +1513,4 @@ void SwRegHistory::_MakeSetWhichIds()
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index aa4ac003f33f..14a3d1e776cc 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -549,13 +550,13 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
//Verbindung zwischen Attribut und Format.
const SwPosition *pPos = rOldAnch.GetCntntAnchor();
SwTxtNode *pTxtNode = (SwTxtNode*)&pPos->nNode.GetNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT );
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -594,7 +595,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
if( pCont->GetAnchorFrm() && !pObj->IsInserted() )
{
- ASSERT( pDoc->GetDrawModel(), "RestoreFlyAnchor without DrawModel" );
+ OSL_ENSURE( pDoc->GetDrawModel(), "RestoreFlyAnchor without DrawModel" );
pDoc->GetDrawModel()->GetPage( 0 )->InsertObject( pObj );
}
pObj->SetRelativePos( aDrawSavePt );
@@ -608,7 +609,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
{
const SwPosition* pPos = aNewAnchor.GetCntntAnchor();
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "no Text Node at position." );
+ OSL_ENSURE( pTxtNd, "no Text Node at position." );
SwFmtFlyCnt aFmt( pFrmFmt );
pTxtNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 );
}
@@ -625,8 +626,6 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
}
// -----------------------------------------------------
-
-// --> OD 2008-02-12 #newlistlevelattrs#
SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat,
const sal_uInt16 nWhichId )
: SwUndo( UNDO_RESETATTR )
@@ -1256,3 +1255,4 @@ void SwUndoDontExpandFmt::RepeatImpl(::sw::RepeatContext & rContext)
rDoc.DontExpandFmt( *rPam.GetPoint() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index 52fe406e459b..26dfc0b1c256 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -102,3 +103,5 @@ void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
SetInDoc( &rContext.GetDoc() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 3b197b81c4f8..6c296013e966 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_sw.hxx"
#include <UndoDelete.hxx>
-
#include <hintids.hxx>
#include <unotools/charclass.hxx>
#include <editeng/brkitem.hxx>
@@ -55,13 +55,6 @@
#include <comcore.hrc> // #111827#
#include <undo.hrc>
-// #include <editeng/svxacorr.hxx>
-// #include <comphelper/processfactory.hxx>
-// #include <editeng/unolingu.hxx>
-// #include <unotools/localedatawrapper.hxx>
-
-// using namespace comphelper;
-
// DELETE
/* lcl_MakeAutoFrms has to call MakeFrms for objects bounded "AtChar" ( == AUTO ),
@@ -143,7 +136,7 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
// Step 1. deletion/record of content indizes
if( bDelFullPara )
{
- ASSERT( rPam.HasMark(), "PaM ohne Mark" );
+ OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" );
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
@@ -882,7 +875,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
if( bDelFullPara )
{
- ASSERT( rPam.HasMark(), "PaM ohne Mark" );
+ OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" );
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
@@ -898,7 +891,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
{
if( bDelFullPara )
{
- ASSERT( rPam.HasMark(), "PaM ohne Mark" );
+ OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" );
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(),
DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) );
@@ -994,3 +987,5 @@ void SwUndoDelete::SetTableName(const String & rName)
{
sTableName = rName;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index a5d54b82bfa6..3721fc31a504 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@ public:
SwNodeIndex* GetMvSttIdx() const
{ return SwUndoSaveSection::GetMvSttIdx(); }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nRedlineCount;
#endif
};
@@ -499,7 +500,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
}
else {
- ASSERT( sal_False, "was ist es denn nun?" );
+ OSL_ENSURE( sal_False, "was ist es denn nun?" );
}
}
@@ -597,7 +598,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory = new SwHistory;
SwTxtAttr* const pFtnHnt =
pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
- ASSERT( pFtnHnt, "kein FtnAttribut" );
+ OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
SwIndex aIdx( pTxtNd, nFtnSttIdx );
pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
pTxtNd->EraseText( aIdx, 1 );
@@ -621,7 +622,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory = new SwHistory;
SwTxtAttr* const pFtnHnt =
pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
- ASSERT( pFtnHnt, "kein FtnAttribut" );
+ OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
SwIndex aIdx( pTxtNd, nFtnSttIdx );
pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
pTxtNd->EraseText( aIdx, 1 );
@@ -661,7 +662,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pAPos->nNode.GetNode().GetTxtNode();
SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt(
pAPos->nContent.GetIndex());
- ASSERT( pFlyHnt, "kein FlyAttribut" );
+ OSL_ENSURE( pFlyHnt, "kein FlyAttribut" );
pHistory->Add( pFlyHnt, 0, false );
// n wieder zurueck, damit nicht ein Format uebesprungen wird !
n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
@@ -939,7 +940,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
{
// ueberpruefe, ob der Inhalt an der alten Position steht
SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
- OSL_ENSURE(!aSttIdx.GetNode().GetCntntNode(),
+ OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
"RestoreSection(): Position on content node");
// move den Inhalt aus dem UndoNodes-Array in den Fly
@@ -984,7 +985,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
: SwUndRng( rRedl ),
SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
{
- ASSERT( POS_OUTSIDE == eCmpPos ||
+ OSL_ENSURE( POS_OUTSIDE == eCmpPos ||
!rRedl.GetContentIdx(), "Redline mit Content" );
switch( eCmpPos )
@@ -1018,10 +1019,10 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
break;
default:
- ASSERT( !this, "keine gueltigen Daten!" )
+ OSL_ENSURE( !this, "keine gueltigen Daten!" );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl().Count();
#endif
}
@@ -1052,7 +1053,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
RedlineMode_t eOld = rDoc.GetRedlineMode();
rDoc.SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_DONTCOMBINE_REDLINES));
//#i92154# let UI know about a new redline with comment
- if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) )
+ if (rDoc.GetDocShell() && (pRedl->GetComment() != String()) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
//
#if OSL_DEBUG_LEVEL > 0
@@ -1135,10 +1136,12 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
for( sal_uInt16 n = rSData.Count(); n; )
rSData[ --n ]->RedlineToDoc( aPam );
+#if OSL_DEBUG_LEVEL > 1
// check redline count against count saved in RedlineSaveData object
- DBG_ASSERT( (rSData.Count() == 0) ||
+ OSL_ENSURE( (rSData.Count() == 0) ||
(rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()),
"redline count not restored properly" );
+#endif
rDoc.SetRedlineMode_intern( eOld );
}
@@ -1192,7 +1195,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
// #111827#
String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr)
{
- ASSERT( nLength - rFillStr.Len() >= 2, "improper arguments")
+ OSL_ENSURE( nLength - rFillStr.Len() >= 2, "improper arguments");
String aResult;
@@ -1337,3 +1340,8 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
);
}
+const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
+const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
+const String UNDO_ARG3("$3", RTL_TEXTENCODING_ASCII_US);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 20308d1dbfba..ac622f1c9601 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -125,7 +126,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
{
// es muss mindestens das Attribut im TextNode stehen
SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
- ASSERT( pCNd->IsTxtNode(), "no Text Node at position." );
+ OSL_ENSURE( pCNd->IsTxtNode(), "no Text Node at position." );
SwFmtFlyCnt aFmt( pFrmFmt );
static_cast<SwTxtNode*>(pCNd)->InsertItem( aFmt, nCntPos, nCntPos );
}
@@ -178,7 +179,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
{
// gibt es ueberhaupt Inhalt, dann sicher diesen
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
- ASSERT( rCntnt.GetCntntIdx(), "Fly ohne Inhalt" );
+ OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly ohne Inhalt" );
SaveSection( pDoc, *rCntnt.GetCntntIdx() );
((SwFmtCntnt&)rCntnt).SetNewCntntIdx( (const SwNodeIndex*)0 );
@@ -203,7 +204,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
nNdPgPos = pPos->nNode.GetIndex();
nCntPos = pPos->nContent.GetIndex();
SwTxtNode *const pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- OSL_ENSURE(pTxtNd, "no Textnode");
+ OSL_ENSURE( pTxtNd, "Kein Textnode gefunden" );
SwTxtFlyCnt* const pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) );
// Attribut steht noch im TextNode, loeschen
@@ -265,7 +266,7 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_Str
}
break;
default:
- ASSERT( sal_False, "Was denn fuer ein FlyFrame?" );
+ OSL_ENSURE( sal_False, "Was denn fuer ein FlyFrame?" );
}
}
@@ -345,7 +346,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
pDoc->GetRootFrm()->GetCurrPage(& rContext.GetRepeatPaM()) );
}
else {
- ASSERT( sal_False, "was fuer ein Anker ist es denn nun?" );
+ OSL_ENSURE( sal_False, "was fuer ein Anker ist es denn nun?" );
}
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
@@ -592,13 +593,13 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
// Attribut und Format.
const SwPosition *pPos = rOldAnch.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * pHnt = pTxtNode->GetTxtAttrForCharAt(
nIdx, RES_TXTATR_FLYCNT );
- ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
@@ -657,7 +658,7 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem )
if( RES_ANCHOR == nWhich )
{
// nur den 1. Ankerwechsel vermerken
- ASSERT( !bAnchorChgd, "mehrfacher Ankerwechsel nicht erlaubt!" );
+ OSL_ENSURE( !bAnchorChgd, "mehrfacher Ankerwechsel nicht erlaubt!" );
bAnchorChgd = sal_True;
@@ -721,3 +722,4 @@ void SwUndoSetFlyFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx
index fad07654f6f8..8358603fbed4 100644
--- a/sw/source/core/undo/undoflystrattr.cxx
+++ b/sw/source/core/undo/undoflystrattr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@ SwUndoFlyStrAttr::SwUndoFlyStrAttr( SwFlyFrmFmt& rFlyFrmFmt,
msOldStr( sOldStr ),
msNewStr( sNewStr )
{
- ASSERT( eUndoId == UNDO_FLYFRMFMT_TITLE ||
+ OSL_ENSURE( eUndoId == UNDO_FLYFRMFMT_TITLE ||
eUndoId == UNDO_FLYFRMFMT_DESCRIPTION,
"<SwUndoFlyStrAttr::SwUndoFlyStrAttr(..)> - unexpected undo id --> Undo will not work" );
}
@@ -97,3 +98,5 @@ SwRewriter SwUndoFlyStrAttr::GetRewriter() const
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 8f9f64bad941..2c93d6a55045 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -151,7 +152,7 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
// TextAttribut zerstoeren
SwTxtNode *pTxtNd = pFmt->GetDoc()->GetNodes()[ rNodePos ]->GetTxtNode();
- ASSERT( pTxtNd, "Kein Textnode gefunden" );
+ OSL_ENSURE( pTxtNd, "Kein Textnode gefunden" );
SwTxtFlyCnt* pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntntPos, RES_TXTATR_FLYCNT ));
// Attribut steht noch im TextNode, loeschen
@@ -198,7 +199,7 @@ void lcl_RestoreAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos )
if (FLY_AS_CHAR == rAnchor.GetAnchorId())
{
SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "no Text Node" );
+ OSL_ENSURE( pTxtNd, "no Text Node" );
SwFmtFlyCnt aFmt( pFmt );
pTxtNd->InsertItem( aFmt, nCntntPos, nCntntPos );
}
@@ -266,7 +267,7 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
// <--
// --> OD 2005-05-10 #i45952# - notify that position attributes
// are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
@@ -317,7 +318,7 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
// <--
// --> OD 2005-05-10 #i45952# - notify that position attributes
// are already set
- ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
+ OSL_ENSURE( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
@@ -433,7 +434,7 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
// <--
// --> OD 2005-05-10 #i45952# - notify that position attributes
// are already set
- ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
+ OSL_ENSURE( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
@@ -484,7 +485,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
// <--
// --> OD 2005-05-10 #i45952# - notify that position attributes
// are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
@@ -520,7 +521,7 @@ SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &)
{
SdrObject* pObj( aDrawFmtsAndObjs[i].second );
SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(pObj->GetUserCall()) );
- ASSERT( pDrawContact,
+ OSL_ENSURE( pDrawContact,
"<SwUndoDrawUnGroupConnectToLayout::Undo(..)> -- missing SwDrawContact instance" );
if ( pDrawContact )
{
@@ -593,7 +594,7 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
// <--
// --> OD 2005-05-10 #i45952# - notify that position attributes
// are already set
- ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
+ OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
@@ -645,3 +646,4 @@ void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt,
pMarkLst->InsertEntry( rMark );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index 8a3452c0ee82..4ba736443dba 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,7 +43,6 @@
//--------------------------------------------------
-// --> OD 2008-04-15 #refactorlists#
SwUndoFmtColl::SwUndoFmtColl( const SwPaM& rRange,
SwFmtColl* pColl,
const bool bReset,
@@ -53,7 +53,6 @@ SwUndoFmtColl::SwUndoFmtColl( const SwPaM& rRange,
pFmtColl( pColl ),
mbReset( bReset ),
mbResetListAttrs( bResetListAttrs )
-// <--
{
// --> FME 2004-08-06 #i31191#
if ( pColl )
@@ -100,12 +99,10 @@ void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM)
// does the format still exist?
if( USHRT_MAX != nPos )
{
- // --> OD 2008-04-15 #refactorlists#
rDoc.SetTxtFmtColl(rPaM,
(SwTxtFmtColl*)pFmtColl,
mbReset,
mbResetListAttrs );
- // <--
}
}
@@ -122,3 +119,4 @@ SwRewriter SwUndoFmtColl::GetRewriter() const
return aResult;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index c32d63488f75..ab1018098e91 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,7 +203,7 @@ SwUndoInsert::~SwUndoInsert()
if( pPos->nContent.GetIndex() ) // nicht den gesamten Node loeschen
{
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
+ OSL_ENSURE( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
pTxtNd->EraseText( pPos->nContent );
pPos->nNode++;
}
@@ -335,7 +336,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext)
if( pTxt )
{
SwTxtNode *const pTxtNode = pCNd->GetTxtNode();
- ASSERT( pTxtNode, "where is my textnode ?" );
+ OSL_ENSURE( pTxtNode, "where is my textnode ?" );
pTxtNode->InsertText( *pTxt, pPam->GetMark()->nContent,
m_nInsertFlags );
DELETEZ( pTxt );
@@ -512,6 +513,7 @@ SwUndoReplace::SwUndoReplace(SwPaM const& rPam,
: SwUndo( UNDO_REPLACE )
, m_pImpl(new Impl(rPam, rIns, bRegExp))
{
+ OSL_ENSURE( !nAktPos, "Redo ohne vorheriges Undo??" );
}
SwUndoReplace::~SwUndoReplace()
@@ -604,7 +606,7 @@ SwUndoReplace::Impl::Impl(
m_bSplitNext = m_nSttNd != pEnd->nNode.GetIndex();
SwTxtNode* pNd = pStt->nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "wo ist der TextNode" );
+ OSL_ENSURE( pNd, "wo ist der TextNode" );
pHistory = new SwHistory;
DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() );
@@ -653,7 +655,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
rPam.DeleteMark();
SwTxtNode* pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTxtNode();
- ASSERT( pNd, "Wo ist der TextNode geblieben?" )
+ OSL_ENSURE( pNd, "Wo ist der TextNode geblieben?" );
SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord();
if( pACEWord )
@@ -682,7 +684,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
pDoc->DeleteAndJoin( rPam );
rPam.DeleteMark();
pNd = rPam.GetNode()->GetTxtNode();
- ASSERT( pNd, "Wo ist der TextNode geblieben?" );
+ OSL_ENSURE( pNd, "Wo ist der TextNode geblieben?" );
aIdx.Assign( pNd, m_nSttCnt );
}
@@ -739,7 +741,7 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext)
rPam.GetPoint()->nNode = m_nSttNd;
SwTxtNode* pNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
- ASSERT( pNd, "Wo ist der TextNode geblieben?" )
+ OSL_ENSURE( pNd, "Wo ist der TextNode geblieben?" );
rPam.GetPoint()->nContent.Assign( pNd, m_nSttCnt );
rPam.SetMark();
if( m_bSplitNext )
@@ -910,7 +912,7 @@ void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext)
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
- ASSERT( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" )
+ OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" );
SwFrmFmt* pFmt;
SdrObject *pSdrObj = 0;
if( OBJECT.pUndoAttr &&
@@ -950,7 +952,7 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext)
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
- ASSERT( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" )
+ OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" );
SwFrmFmt* pFmt;
SdrObject *pSdrObj = 0;
if( OBJECT.pUndoAttr &&
@@ -1064,3 +1066,4 @@ void SwUndoInsertLabel::SetDrawObj( sal_uInt8 nLId )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index a29a0afa4ea2..f7b01da4caa2 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -353,3 +354,4 @@ void SwUndoMove::DelFtn( const SwPaM& rRange )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 9e18dfe79611..c775da164d01 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,16 +114,6 @@ void SwUndoInsNum::UndoImpl(::sw::UndoRedoContext & rContext)
if( !pNd && nSttNode )
pNd = rDoc.GetNodes()[ nSttNode ]->GetTxtNode();
- // This code seems to be superfluous because the methods
- // don't have any known side effects.
- // ToDo: iasue i83806 should be used to remove this code
- const SwNumRule* pNdRule;
- if( pNd )
- pNdRule = pNd->GetNumRule();
- else
- pNdRule = rDoc.FindNumRulePtr( aNumRule.GetName() );
- // End of ToDo for issue i83806
-
pHistory->TmpRollback( &rDoc, nLRSavePos );
}
@@ -153,7 +144,6 @@ void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext)
else
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
- // --> OD 2008-03-18 #refactorlists#
rDoc.SetNumRule(rPam, aNumRule, false);
// <--
}
@@ -174,7 +164,6 @@ void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext)
if( !sReplaceRule.Len() )
{
// --> OD 2005-02-25 #i42921# - adapt to changed signature
- // --> OD 2008-03-18 #refactorlists#
rDoc.SetNumRule(rContext.GetRepeatPaM(), aNumRule, false);
// <--
}
@@ -202,9 +191,9 @@ void SwUndoInsNum::SaveOldNumRule( const SwNumRule& rOld )
SwUndoDelNum::SwUndoDelNum( const SwPaM& rPam )
- : SwUndo( UNDO_DELNUM ), SwUndRng( rPam ),
- aNodeIdx( sal_uInt8( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode ))
+ : SwUndo( UNDO_DELNUM ), SwUndRng( rPam )
{
+ aNodes.reserve( nEndNode - nSttNode > 255 ? 255 : nEndNode - nSttNode );
pHistory = new SwHistory;
}
@@ -220,11 +209,11 @@ void SwUndoDelNum::UndoImpl(::sw::UndoRedoContext & rContext)
pHistory->TmpRollback( &rDoc, 0 );
pHistory->SetTmpEnd( pHistory->Count() );
- for( sal_uInt16 n = 0; n < aNodeIdx.Count(); ++n )
+ for( std::vector<NodeLevel>::const_iterator i = aNodes.begin(); i != aNodes.end(); ++i )
{
- SwTxtNode* pNd = rDoc.GetNodes()[ aNodeIdx[ n ] ]->GetTxtNode();
- ASSERT( pNd, "Where is TextNode gone?" );
- pNd->SetAttrListLevel(aLevels[ n ] );
+ SwTxtNode* pNd = rDoc.GetNodes()[ i->index ]->GetTxtNode();
+ OSL_ENSURE( pNd, "Where has the TextNode gone?" );
+ pNd->SetAttrListLevel( i->level );
if( pNd->GetCondFmtColl() )
pNd->ChkCondColl();
@@ -248,10 +237,7 @@ void SwUndoDelNum::AddNode( const SwTxtNode& rNd, sal_Bool )
{
if( rNd.GetNumRule() )
{
- sal_uInt16 nIns = aNodeIdx.Count();
- aNodeIdx.Insert( rNd.GetIndex(), nIns );
-
- aLevels.insert( aLevels.begin() + nIns, static_cast<sal_uInt8>(rNd.GetActualListLevel()) );
+ aNodes.push_back( NodeLevel( rNd.GetIndex(), rNd.GetActualListLevel() ) );
}
}
@@ -409,7 +395,6 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
if ( pTxtNd )
{
- // --> OD 2008-02-28 #refactorlists#
if ( pTxtNd->HasAttrListRestartValue() )
{
nOldStt = static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue());
@@ -418,7 +403,6 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt
{
nOldStt = USHRT_MAX; // indicating, that the list restart value is not set
}
- // <--
}
}
@@ -467,3 +451,4 @@ void SwUndoNumRuleStart::RepeatImpl(::sw::RepeatContext & rContext)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unoutl.cxx b/sw/source/core/undo/unoutl.cxx
index bbe80824d44a..109387765fc6 100644
--- a/sw/source/core/undo/unoutl.cxx
+++ b/sw/source/core/undo/unoutl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ void SwUndoOutlineLeftRight::RepeatImpl(::sw::RepeatContext & rContext)
rContext.GetDoc().OutlineUpDown(rContext.GetRepeatPaM(), nOffset);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index eb6a525a8cc6..f2f83a06fd42 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,7 +80,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
nSttCntnt = rPos.nContent.GetIndex();
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "Overwrite nicht im TextNode?" );
+ OSL_ENSURE( pTxtNd, "Overwrite nicht im TextNode?" );
bInsChar = sal_True;
xub_StrLen nTxtNdLen = pTxtNd->GetTxt().Len();
@@ -204,7 +205,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
- ASSERT( pTxtNd, "Overwrite nicht im TextNode?" );
+ OSL_ENSURE( pTxtNd, "Overwrite nicht im TextNode?" );
SwIndex& rIdx = pAktPam->GetPoint()->nContent;
rIdx.Assign( pTxtNd, nSttCntnt );
@@ -287,7 +288,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
- ASSERT( pTxtNd, "Overwrite nicht im TextNode?" );
+ OSL_ENSURE( pTxtNd, "Overwrite nicht im TextNode?" );
SwIndex& rIdx = pAktPam->GetPoint()->nContent;
if( pRedlSaveData )
@@ -500,3 +501,4 @@ void _UndoTransliterate_Data::SetChangeAtNode( SwDoc& rDoc )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 475e79bb7314..90d8d261e604 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -264,7 +265,7 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
sal_uInt16 nFnd = rDoc.GetRedlinePos(
*rDoc.GetNodes()[ nSttNode + 1 ],
nsRedlineType_t::REDLINE_INSERT );
- ASSERT( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(),
+ OSL_ENSURE( USHRT_MAX != nFnd && nFnd+1 < rDoc.GetRedlineTbl().Count(),
"kein Insert Object gefunden" );
++nFnd;
rDoc.GetRedlineTbl()[nFnd]->Show( 1 );
@@ -536,3 +537,5 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
SetPaM(*pPam, true);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 3099d944923d..dd9a6ce93c62 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -129,7 +130,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext)
SwSectionNode *const pNd =
rDoc.GetNodes()[ m_nSectionNodePos ]->GetSectionNode();
- ASSERT( pNd, "wo ist mein SectionNode?" );
+ OSL_ENSURE( pNd, "wo ist mein SectionNode?" );
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
rDoc.DeleteRedline( *pNd, true, USHRT_MAX );
@@ -240,7 +241,7 @@ void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode )
{
SwNodeIndex aIdx( rDoc.GetNodes(), nNode );
SwTxtNode* pTxtNd = aIdx.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "wo ist mein TextNode?" );
+ OSL_ENSURE( pTxtNd, "wo ist mein TextNode?" );
{
RemoveIdxRel( nNode + 1, SwPosition( aIdx,
@@ -387,7 +388,7 @@ void SwUndoDelSection::RedoImpl(::sw::UndoRedoContext & rContext)
SwSectionNode *const pNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
- OSL_ENSURE(pNd, "SwUndoDelSection::RedoImpl(): no SectionNode?");
+ OSL_ENSURE( pNd, "wo ist mein SectionNode?" );
// einfach das Format loeschen, der Rest erfolgt automatisch
rDoc.DelSectionFmt( pNd->GetSection().GetFmt() );
}
@@ -441,7 +442,7 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext)
SwDoc & rDoc = rContext.GetDoc();
SwSectionNode *const pSectNd =
rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode();
- ASSERT( pSectNd, "wo ist mein SectionNode?" );
+ OSL_ENSURE( pSectNd, "wo ist mein SectionNode?" );
SwSection& rNdSect = pSectNd->GetSection();
SwFmt* pFmt = rNdSect.GetFmt();
@@ -497,3 +498,4 @@ void SwUndoUpdateSection::RedoImpl(::sw::UndoRedoContext & rContext)
UndoImpl(rContext);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index c11f7dc7a949..1b72dba58572 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -277,3 +278,5 @@ void SwUndoSort::Insert( sal_uLong nOrgPos, sal_uLong nNewPos)
aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 1e649f6d0b09..317d1baa4652 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
bTblFlag( sal_False ), bChkTblStt( bChkTable )
{
SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode();
- OSL_ENSURE(pTxtNd, "SwUndoSplitNode: TextNode expected!");
+ OSL_ENSURE( pTxtNd, "nur beim TextNode rufen!" );
if( pTxtNd->GetpSwpHints() )
{
pHistory = new SwHistory;
@@ -202,3 +203,4 @@ void SwUndoSplitNode::RepeatImpl(::sw::RepeatContext & rContext)
*rContext.GetRepeatPaM().GetPoint(), bChkTblStt );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index c395e44dabd2..07e2e7a9ad47 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,21 +70,17 @@
#include <comcore.hrc>
#include <unochart.hxx>
-#ifndef DBG_UTIL
-#define CHECK_TABLE(t)
-#else
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
#define CHECK_TABLE(t)
#endif
-#endif
-#ifndef DBG_UTIL
- #define _DEBUG_REDLINE( pDoc )
-#else
+#if OSL_DEBUG_LEVEL > 1
void lcl_DebugRedline( const SwDoc* pDoc );
#define _DEBUG_REDLINE( pDoc ) lcl_DebugRedline( pDoc );
+#else
+ #define _DEBUG_REDLINE( pDoc )
#endif
extern void ClearFEShellTabCols();
@@ -196,14 +193,11 @@ public:
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)
+#if OSL_DEBUG_LEVEL > 1
#include "shellio.hxx"
-void DumpDoc( SwDoc* pDoc, const String& rFileNm );
void CheckTable( const SwTable& );
-#define DUMPDOC(p,s) DumpDoc( p, s);
#define CHECKTABLE(t) CheckTable( t );
#else
-#define DUMPDOC(p,s)
#define CHECKTABLE(t)
#endif
@@ -233,7 +227,7 @@ SV_IMPL_PTRARR( SwUndoMoves, SwUndoMovePtr )
SV_IMPL_PTRARR( SwTblToTxtSaves, SwTblToTxtSavePtr )
SV_IMPL_PTRARR( _UndoTblCpyTbl_Entries, _UndoTblCpyTbl_EntryPtr )
-sal_uInt16 __FAR_DATA aSave_BoxCntntSet[] = {
+sal_uInt16 aSave_BoxCntntSet[] = {
RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
@@ -286,7 +280,7 @@ void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext)
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
SwTableNode* pTblNd = aIdx.GetNode().GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
pTblNd->DelFrms();
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
@@ -588,7 +582,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
{
// an der ContentPosition splitten, das vorherige Zeichen
// loeschen (ist der Trenner!)
- ASSERT( pTxtNd, "Wo ist der TextNode geblieben?" );
+ OSL_ENSURE( pTxtNd, "Wo ist der TextNode geblieben?" );
SwIndex aCntPos( pTxtNd, pSave->m_nCntnt - 1 );
pTxtNd->EraseText( aCntPos, 1 );
@@ -670,7 +664,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
pPam->DeleteMark();
SwTableNode* pTblNd = pPam->GetNode()->GetTableNode();
- ASSERT( pTblNd, "keinen TableNode gefunden" );
+ OSL_ENSURE( pTblNd, "keinen TableNode gefunden" );
if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) )
pDDEFldType = (SwDDEFieldType*)((SwDDETable&)pTblNd->GetTable()).
@@ -683,7 +677,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) &&
0 == ( pCNd = rDoc.GetNodes().GoPrevious( &aSaveIdx )) )
{
- ASSERT( sal_False, "wo steht denn nun der TextNode" );
+ OSL_ENSURE( sal_False, "wo steht denn nun der TextNode" );
}
pPam->GetPoint()->nNode = aSaveIdx;
@@ -757,7 +751,7 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext)
++nTblNd; // Node wurde vorher gesplittet
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNd );
SwTableNode *const pTNd = aIdx.GetNode().GetTableNode();
- OSL_ENSURE( pTNd, "SwUndoTxtToTbl: no TableNode" );
+ OSL_ENSURE( pTNd, "keinen Tabellen-Node gefunden" );
RemoveIdxFromSection( rDoc, nTblNd );
@@ -778,7 +772,7 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext)
if( pBox )
::_DeleteBox( rTbl, pBox, 0, sal_False, sal_False );
else {
- ASSERT( !this, "Wo ist die Box geblieben?" );
+ OSL_ENSURE( !this, "Wo ist die Box geblieben?" );
}
}
}
@@ -872,9 +866,9 @@ SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, sal_uInt16 nOldHdl,
nOldHeadline( nOldHdl ),
nNewHeadline( nNewHdl )
{
- ASSERT( rTbl.GetTabSortBoxes().Count(), "Tabelle ohne Inhalt" );
+ OSL_ENSURE( rTbl.GetTabSortBoxes().Count(), "Tabelle ohne Inhalt" );
const SwStartNode *pSttNd = rTbl.GetTabSortBoxes()[ 0 ]->GetSttNd();
- ASSERT( pSttNd, "Box ohne Inhalt" );
+ OSL_ENSURE( pSttNd, "Box ohne Inhalt" );
nTblNd = pSttNd->StartOfSectionIndex();
}
@@ -883,7 +877,7 @@ void SwUndoTblHeadline::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
- ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
+ OSL_ENSURE( pTNd, "keinen Tabellen-Node gefunden" );
rDoc.SetRowsToRepeat( pTNd->GetTable(), nOldHeadline );
}
@@ -893,7 +887,7 @@ void SwUndoTblHeadline::RedoImpl(::sw::UndoRedoContext & rContext)
SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
- ASSERT( pTNd, "keinen Tabellen-Node gefunden" );
+ OSL_ENSURE( pTNd, "keinen Tabellen-Node gefunden" );
rDoc.SetRowsToRepeat( pTNd->GetTable(), nNewHeadline );
}
@@ -1012,7 +1006,7 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, sal_Bool bMdfyBox )
{
if( !pLn )
{
- ASSERT( !this, "Anzahl der Lines hat sich veraendert" );
+ OSL_ENSURE( !this, "Anzahl der Lines hat sich veraendert" );
break;
}
@@ -1209,7 +1203,7 @@ void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl )
{
if( !pBx )
{
- ASSERT( !this, "Anzahl der Boxen hat sich veraendert" );
+ OSL_ENSURE( !this, "Anzahl der Boxen hat sich veraendert" );
break;
}
pBx->RestoreAttr( *rLine.GetTabBoxes()[ n ], rSTbl );
@@ -1242,7 +1236,7 @@ void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl
// HB, #127868# robustness: in some cases - which I
// cannot reproduce nor see from the code - pNew seems
// to be set to NULL in C40_INSERT.
- ASSERT(pNew, "Table line just created set to NULL in C40_INSERT");
+ OSL_ENSURE(pNew, "Table line just created set to NULL in C40_INSERT");
if (pNew)
{
@@ -1298,7 +1292,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
{
if( !rBox.GetTabLines().Count() )
{
- ASSERT( !this, "Anzahl der Lines hat sich veraendert" );
+ OSL_ENSURE( !this, "Anzahl der Lines hat sich veraendert" );
}
else
{
@@ -1307,7 +1301,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
{
if( !pLn )
{
- ASSERT( !this, "Anzahl der Lines hat sich veraendert" );
+ OSL_ENSURE( !this, "Anzahl der Lines hat sich veraendert" );
break;
}
@@ -1346,7 +1340,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
}
else
{
- ASSERT( !this, "Box nicht mehr am gleichen Node" );
+ OSL_ENSURE( !this, "Box nicht mehr am gleichen Node" );
}
}
@@ -1406,7 +1400,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
{
// Box zum StartNode in der alten Tabelle suchen
SwTableBox* pBox = rTbl.GetTblBox( nSttNode );
- ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
+ OSL_ENSURE( pBox, "Wo ist meine TabellenBox geblieben?" );
SwFrmFmt* pOld = pBox->GetFrmFmt();
pFmt->Add( pBox );
@@ -1450,7 +1444,7 @@ void SwUndoAttrTbl::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
if (pTblNd)
{
@@ -1509,7 +1503,7 @@ SwUndoTblAutoFmt::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
_SaveTable* pOrig = new _SaveTable( pTblNd->GetTable() );
// dann auch noch ueber die ContentNodes der EndBoxen und
@@ -1618,7 +1612,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
sal_uInt16 n;
sal_uInt16 i;
- ASSERT( ! IsDelBox(), "falsche Action" );
+ OSL_ENSURE( ! IsDelBox(), "falsche Action" );
Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
for( n = 0, i = 0; n < rOld.Count(); ++i )
@@ -1671,12 +1665,12 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
const SwTable& rTbl = rTblNd.GetTable();
const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes();
- ASSERT( ! IsDelBox(), "falsche Action" );
+ OSL_ENSURE( ! IsDelBox(), "falsche Action" );
Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
- ASSERT( rTbl.IsNewModel() || rOld.Count() + nCount * rBoxes.Count() == rTblBoxes.Count(),
+ OSL_ENSURE( rTbl.IsNewModel() || rOld.Count() + nCount * rBoxes.Count() == rTblBoxes.Count(),
"unexpected boxes" );
- ASSERT( rOld.Count() <= rTblBoxes.Count(), "more unexpected boxes" );
+ OSL_ENSURE( rOld.Count() <= rTblBoxes.Count(), "more unexpected boxes" );
for( sal_uInt16 n = 0, i = 0; i < rTblBoxes.Count(); ++i )
{
if( ( n < rOld.Count() ) &&
@@ -1720,7 +1714,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
// find the line number difference
// (to help determine bNodesMoved flag below)
nLineDiff = nLineDiff - nLineNo;
- ASSERT( pSourceBox, "Splitted source box not found!" );
+ OSL_ENSURE( pSourceBox, "Splitted source box not found!" );
// find out how many nodes the source box used to have
// (to help determine bNodesMoved flag below)
sal_uInt16 nNdsPos = 0;
@@ -1752,7 +1746,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
{
- ASSERT( IsDelBox(), "falsche Action" );
+ OSL_ENSURE( IsDelBox(), "falsche Action" );
if( !Ptrs.pDelSects )
Ptrs.pDelSects = new SwUndoSaveSections( 10, 5 );
@@ -1771,7 +1765,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode );
SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
- OSL_ENSURE( pTblNd, "SwUndoTblNdsChg: no TableNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -1817,7 +1811,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
// Box aus der Tabellen-Struktur entfernen
sal_uLong nIdx = aTmp[ --n ];
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
- ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
+ OSL_ENSURE( pBox, "Wo ist meine TabellenBox geblieben?" );
// TL_CHART2: notify chart about box to be removed
if (pPCD)
@@ -1855,7 +1849,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
{
sal_uLong nIdx = (*Ptrs.pNewSttNds)[ --n ];
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
- ASSERT( pBox, "Where's my table box?" );
+ OSL_ENSURE( pBox, "Where's my table box?" );
// TL_CHART2: notify chart about box to be removed
if (pPCD)
pPCD->DeleteBox( &pTblNd->GetTable(), *pBox );
@@ -1889,7 +1883,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
SwDoc & rDoc = rContext.GetDoc();
SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode();
- ASSERT( pTblNd, "kein TabellenNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
CHECK_TABLE( pTblNd->GetTable() )
SwSelBoxes aSelBoxes;
@@ -2004,7 +1998,7 @@ SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel )
: SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTblSel ), pHistory( 0 )
{
const SwTableNode* pTblNd = rTblSel.GetNode()->FindTableNode();
- ASSERT( pTblNd, "Wo ist TabllenNode" )
+ OSL_ENSURE( pTblNd, "Wo ist TabllenNode" );
pSaveTbl = new _SaveTable( pTblNd->GetTable() );
pMoves = new SwUndoMoves;
nTblNode = pTblNd->GetIndex();
@@ -2023,7 +2017,7 @@ void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext)
SwNodeIndex aIdx( rDoc.GetNodes(), nTblNode );
SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode();
- OSL_ENSURE( pTblNd, "SwUndoTblMerge: no TableNode" );
+ OSL_ENSURE( pTblNd, "kein TabellenNode" );
SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() );
aMsgHnt.eFlags = TBL_BOXPTR;
@@ -2040,7 +2034,6 @@ void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableBox *pBox, *pCpyBox = pTblNd->GetTable().GetTabSortBoxes()[0];
SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
-DUMPDOC( &rDoc, "d:\\tmp\\tab_a.db" )
CHECKTABLE(pTblNd->GetTable())
SwSelBoxes aSelBoxes;
@@ -2059,7 +2052,6 @@ CHECKTABLE(pTblNd->GetTable())
aSelBoxes.Insert( pBox );
}
-DUMPDOC( &rDoc, "d:\\tmp\\tab_b.db" )
CHECKTABLE(pTblNd->GetTable())
SwChartDataProvider *pPCD = rDoc.GetChartDataProvider();
@@ -2074,7 +2066,7 @@ CHECKTABLE(pTblNd->GetTable())
{
nIdx = aNewSttNds[ --n ];
pBox = pTblNd->GetTable().GetTblBox( nIdx );
- ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
+ OSL_ENSURE( pBox, "Wo ist meine TabellenBox geblieben?" );
if( !pSaveTbl->IsNewModel() )
rDoc.GetNodes().MakeTxtNode( SwNodeIndex(
@@ -2116,11 +2108,7 @@ CHECKTABLE(pTblNd->GetTable())
// das Trennzeichen loeschen
pTxtNd->EraseText( aTmpIdx, 1 );
}
-// delete pUndo;
-DUMPDOC( &rDoc, String( "d:\\tmp\\tab_") + String( aNewSttNds.Count() - i ) +
- String(".db") )
}
-// pMoves->Remove( 0, pMoves->Count() );
nIdx = pBox->GetSttIdx();
}
else
@@ -2148,7 +2136,6 @@ DUMPDOC( &rDoc, String( "d:\\tmp\\tab_") + String( aNewSttNds.Count() - i ) +
rDoc.DeleteSection( rDoc.GetNodes()[ nIdx ] );
}
}
-DUMPDOC( &rDoc, "d:\\tmp\\tab_z.db" )
CHECKTABLE(pTblNd->GetTable())
@@ -2299,15 +2286,15 @@ SwUndoTblNumFmt::~SwUndoTblNumFmt()
void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
- ASSERT( pBoxSet, "Where's the stored item set?" )
+ OSL_ENSURE( pBoxSet, "Where's the stored item set?" );
SwDoc & rDoc = rContext.GetDoc();
SwStartNode* pSttNd = rDoc.GetNodes()[ nNode ]->
FindSttNodeByType( SwTableBoxStartNode );
- ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
+ OSL_ENSURE( pSttNd, "ohne StartNode kein TabellenBox" );
SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox(
pSttNd->GetIndex() );
- ASSERT( pBox, "keine TabellenBox gefunden" );
+ OSL_ENSURE( pBox, "keine TabellenBox gefunden" );
SwTableBoxFmt* pFmt = rDoc.MakeTableBoxFmt();
pFmt->SetFmtAttr( *pBoxSet );
@@ -2404,10 +2391,10 @@ void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext)
SwNode * pNd = & pPam->GetPoint()->nNode.GetNode();
SwStartNode* pSttNd = pNd->FindSttNodeByType( SwTableBoxStartNode );
- ASSERT( pSttNd, "ohne StartNode kein TabellenBox" );
+ OSL_ENSURE( pSttNd, "ohne StartNode kein TabellenBox" );
SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox(
pSttNd->GetIndex() );
- ASSERT( pBox, "keine TabellenBox gefunden" );
+ OSL_ENSURE( pBox, "keine TabellenBox gefunden" );
SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
if( bNewFmt || bNewFml || bNewValue )
@@ -3215,7 +3202,7 @@ void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos )
nM = nU + ( nO - nU ) / 2;
if( *(rArr.GetData() + nM) == nIdx )
{
- ASSERT( sal_False, "Index ist schon vorhanden, darf nie sein!" );
+ OSL_ENSURE( sal_False, "Index already exists. This should never happen." );
return;
}
if( *(rArr.GetData() + nM) < nIdx )
@@ -3242,7 +3229,7 @@ void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos )
nM = nU + ( nO - nU ) / 2;
if( *(rArr.GetData() + nM) == nIdx )
{
- ASSERT( sal_False, "Index ist schon vorhanden, darf nie sein!" );
+ OSL_ENSURE( sal_False, "Index ist schon vorhanden, darf nie sein!" );
return;
}
if( *(rArr.GetData() + nM) < nIdx )
@@ -3258,37 +3245,21 @@ void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos )
*pInsPos = nU;
}
-#if defined( JP_DEBUG ) && defined(DBG_UTIL)
+#if OSL_DEBUG_LEVEL > 1
-void DumpDoc( SwDoc* pDoc, const String& rFileNm )
-{
- Writer* pWrt = SwIoSystem::GetWriter( "DEBUG" );
- if( pWrt )
- {
- SvFileStream aStream( rFileNm, STREAM_STD_WRITE );
- SwPaM* pPam = new SwPaM( pDoc, SwPosition( pDoc->GetNodes().EndOfContent ,
- pDoc->GetNodes().EndOfContent ));
- pPam->Move( fnMoveBackward, fnGoDoc );
- pPam->SetMark();
- pPam->Move( fnMoveForward, fnGoDoc );
-
- pWrt->Write( pPam, *pDoc, aStream, rFileNm.GetStr() );
-
- delete pPam;
- }
-}
void CheckTable( const SwTable& rTbl )
{
const SwNodes& rNds = rTbl.GetFrmFmt()->GetDoc()->GetNodes();
- const SwTableSortBoxes& rSrtArr = pTblNd->GetTable().GetTabSortBoxes();
+ const SwTableSortBoxes& rSrtArr = rTbl.GetTabSortBoxes();
for( sal_uInt16 n = 0; n < rSrtArr.Count(); ++n )
{
const SwTableBox* pBox = rSrtArr[ n ];
const SwNode* pNd = pBox->GetSttNd();
- ASSERT( rNds[ *pBox->GetSttIdx() ] == pNd, "Box mit falchem StartNode" );
+ OSL_ENSURE( rNds[ pBox->GetSttIdx() ] == pNd, "Box mit falchem StartNode" );
}
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 55afbf9b9c99..ca6f3359ab53 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -151,7 +152,7 @@ SwUndoInserts::~SwUndoInserts()
if( pPos->nContent.GetIndex() ) // nicht den gesamten Node loeschen
{
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
+ OSL_ENSURE( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
if( pTxtNd ) // Robust
{
pTxtNd->EraseText( pPos->nContent );
@@ -353,3 +354,4 @@ SwUndoCpyDoc::SwUndoCpyDoc( const SwPaM& rPam )
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index 915609cdd2ca..ba0d8a4699ab 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <SwXTextDefaults.hxx>
@@ -47,15 +48,12 @@
#include <unocrsrhelper.hxx>
#include <hintids.hxx>
-#include <unomid.h>
-
-using rtl::OUString;
-using namespace rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
+using rtl::OUString;
SwXTextDefaults::SwXTextDefaults ( SwDoc * pNewDoc ) :
@@ -81,7 +79,7 @@ uno::Reference< XPropertySetInfo > SAL_CALL SwXTextDefaults::getPropertySetInfo(
void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pDoc)
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName );
@@ -147,7 +145,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName,
Any SAL_CALL SwXTextDefaults::getPropertyValue( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pDoc)
throw RuntimeException();
const SfxItemPropertySimpleEntry *pMap = m_pPropSet->getPropertyMap()->getByName( rPropertyName );
@@ -192,7 +190,7 @@ void SAL_CALL SwXTextDefaults::removeVetoableChangeListener( const OUString& /*r
PropertyState SAL_CALL SwXTextDefaults::getPropertyState( const OUString& rPropertyName )
throw(UnknownPropertyException, RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
PropertyState eRet = PropertyState_DIRECT_VALUE;
if (!m_pDoc)
throw RuntimeException();
@@ -290,3 +288,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNa
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx
index 5616d51d1d9f..e72abba9c992 100644
--- a/sw/source/core/unocore/TextCursorHelper.cxx
+++ b/sw/source/core/unocore/TextCursorHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,17 +34,13 @@
using namespace ::com::sun::star;
-/* -----------------------------03.03.03 11:07--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------03.03.03 11:07--------------------------------
- ---------------------------------------------------------------------------*/
//XUnoTunnel
sal_Int64 SAL_CALL OTextCursorHelper::getSomething(
const uno::Sequence< sal_Int8 >& rId )
@@ -57,5 +54,5 @@ sal_Int64 SAL_CALL OTextCursorHelper::getSomething(
}
return 0;
}
-// -----------------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx
index 8695de0eef9b..66684613c7e5 100644
--- a/sw/source/core/unocore/XMLRangeHelper.cxx
+++ b/sw/source/core/unocore/XMLRangeHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -351,7 +352,7 @@ CellRange getCellRangeFromXMLString( const OUString & rXMLString )
nStartPos, nEndPos - 1,
aResult ))
{
- // if an error occured, bail out
+ // if an error occurred, bail out
return CellRange();
}
}
@@ -410,3 +411,5 @@ OUString getXMLStringFromCellRange( const CellRange & rRange )
} // namespace XMLRangeHelper
//} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/XMLRangeHelper.hxx b/sw/source/core/unocore/XMLRangeHelper.hxx
index c170662745ae..0b4b34e57153 100644
--- a/sw/source/core/unocore/XMLRangeHelper.hxx
+++ b/sw/source/core/unocore/XMLRangeHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ CellRange getCellRangeFromXMLString( const ::rtl::OUString & rXMLString );
// XMLRANGEHELPER_HXX
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 77e5e536a042..3f9d4a0f54a5 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
-#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HDL_
#include <com/sun/star/ucb/NameClash.hdl>
-#endif
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -52,7 +51,6 @@
#include <svl/svstdarr.hxx>
#include <swunohelper.hxx>
#include <swunodef.hxx>
-#include <errhdl.hxx>
namespace SWUnoHelper {
@@ -66,7 +64,7 @@ sal_Int32 GetEnumAsInt32( const UNO_NMSPC::Any& rVal )
catch( UNO_NMSPC::Exception & )
{
eVal = 0;
- ASSERT( sal_False, "can't get EnumAsInt32" );
+ OSL_ENSURE( sal_False, "can't get EnumAsInt32" );
}
return eVal;
}
@@ -81,14 +79,14 @@ sal_Bool UCB_DeleteFile( const String& rURL )
ucbhelper::Content aTempContent( rURL,
STAR_REFERENCE( ucb::XCommandEnvironment )());
aTempContent.executeCommand(
- rtl::OUString::createFromAscii( "delete" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
UNO_NMSPC::makeAny( sal_Bool( sal_True ) ) );
bRemoved = sal_True;
}
catch( UNO_NMSPC::Exception& )
{
bRemoved = sal_False;
- ASSERT( sal_False, "Exeception from executeCommand( delete )" );
+ OSL_ENSURE( sal_False, "Exeception from executeCommand( delete )" );
}
return bRemoved;
}
@@ -114,12 +112,12 @@ sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL, sal_Bool bCopy
aInfo.MoveData = bCopyIsMove;
aAny <<= aInfo;
aTempContent.executeCommand(
- rtl::OUString::createFromAscii( "transfer" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),
aAny );
}
catch( UNO_NMSPC::Exception& )
{
- ASSERT( sal_False, "Exeception from executeCommand( transfer )" );
+ OSL_ENSURE( sal_False, "Exeception from executeCommand( transfer )" );
bCopyCompleted = sal_False;
}
return bCopyCompleted;
@@ -153,7 +151,7 @@ sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL )
catch( UNO_NMSPC::Exception& )
{
bCaseSensitive = sal_False;
- ASSERT( sal_False, "Exeception from compareContentIds()" );
+ OSL_ENSURE( sal_False, "Exeception from compareContentIds()" );
}
return bCaseSensitive;
}
@@ -165,7 +163,7 @@ sal_Bool UCB_IsReadOnlyFileName( const String& rURL )
{
ucbhelper::Content aCnt( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )());
UNO_NMSPC::Any aAny = aCnt.getPropertyValue(
- rtl::OUString::createFromAscii( "IsReadOnly" ));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly")));
if(aAny.hasValue())
bIsReadOnly = *(sal_Bool*)aAny.getValue();
}
@@ -222,9 +220,9 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
sal_uInt16 nSeqSize = pDateTimeList ? 2 : 1;
UNO_NMSPC::Sequence < rtl::OUString > aProps( nSeqSize );
rtl::OUString* pProps = aProps.getArray();
- pProps[ 0 ] = rtl::OUString::createFromAscii( "Title" );
+ pProps[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
if( pDateTimeList )
- pProps[ 1 ] = rtl::OUString::createFromAscii( "DateModified" );
+ pProps[ 1 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified"));
try
{
@@ -289,3 +287,5 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 7a67b7748c97..bc31f15f7592 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <unobookmark.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <TextCursorHelper.hxx>
@@ -46,7 +47,7 @@
#include <comcore.hrc>
#include <SwRewriter.hxx>
#include <docsh.hxx>
-
+#include <xmloff/odffields.hxx>
using namespace ::sw::mark;
using namespace ::com::sun::star;
@@ -130,6 +131,11 @@ void SwXBookmark::Impl::registerInMark(SwXBookmark & rThis,
m_pRegisteredBookmark = pBkmk;
}
+void SwXBookmark::registerInMark(SwXBookmark & rThis,
+ ::sw::mark::IMark *const pBkmk)
+{
+ m_pImpl->registerInMark( rThis, pBkmk );
+}
const ::sw::mark::IMark* SwXBookmark::GetBookmark() const
{
@@ -237,7 +243,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
UnoActionContext aCont(m_pImpl->m_pDoc);
if (!m_pImpl->m_sMarkName.getLength())
{
- m_pImpl->m_sMarkName = OUString::createFromAscii("Bookmark");
+ m_pImpl->m_sMarkName = OUString(RTL_CONSTASCII_USTRINGPARAM("Bookmark"));
}
if ((eType == IDocumentMarkAccess::BOOKMARK) &&
::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_pImpl->m_sMarkName))
@@ -277,14 +283,14 @@ void SAL_CALL
SwXBookmark::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
attachToRange( xTextRange );
}
uno::Reference< text::XTextRange > SAL_CALL
SwXBookmark::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_pRegisteredBookmark)
{
@@ -299,7 +305,7 @@ SwXBookmark::getAnchor() throw (uno::RuntimeException)
void SAL_CALL SwXBookmark::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (m_pImpl->m_pRegisteredBookmark)
{
m_pImpl->m_pDoc->getIDocumentMarkAccess()->deleteMark(
@@ -311,7 +317,7 @@ void SAL_CALL SwXBookmark::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->m_pRegisteredBookmark)
{
@@ -324,7 +330,7 @@ void SAL_CALL SwXBookmark::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->m_pRegisteredBookmark ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -336,7 +342,7 @@ throw (uno::RuntimeException)
OUString SAL_CALL SwXBookmark::getName()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return (m_pImpl->m_pRegisteredBookmark)
? m_pImpl->m_pRegisteredBookmark->GetName()
@@ -346,7 +352,7 @@ throw (uno::RuntimeException)
void SAL_CALL SwXBookmark::setName(const OUString& rName)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_pRegisteredBookmark)
{
@@ -385,7 +391,7 @@ throw (uno::RuntimeException)
OUString SAL_CALL
SwXBookmark::getImplementationName() throw (uno::RuntimeException)
{
- return OUString::createFromAscii("SwXBookmark");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("SwXBookmark"));
}
static char const*const g_ServicesBookmark[] =
@@ -395,7 +401,7 @@ static char const*const g_ServicesBookmark[] =
"com.sun.star.document.LinkTarget",
};
static const size_t g_nServicesBookmark(
- sizeof(g_ServicesBookmark)/sizeof(g_ServicesBookmark[0]));
+ SAL_N_ELEMENTS(g_ServicesBookmark));
sal_Bool SAL_CALL SwXBookmark::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -431,7 +437,7 @@ uno::Reference<frame::XModel> SwXBookmark::GetModel()
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXBookmark::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRef(
aSwMapProvider.GetPropertySet(PROPERTY_MAP_BOOKMARK)
@@ -456,7 +462,7 @@ uno::Any SAL_CALL SwXBookmark::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
uno::Any aRet;
if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName))
@@ -525,7 +531,7 @@ SwXFieldmark::SwXFieldmark(bool _isReplacementObject, ::sw::mark::IMark* pBkm, S
void SwXFieldmarkParameters::insertByName(const OUString& aName, const uno::Any& aElement)
throw (lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark::parameter_map_t* pParameters = getCoreParameters();
if(pParameters->find(aName) != pParameters->end())
throw container::ElementExistException();
@@ -535,7 +541,7 @@ void SwXFieldmarkParameters::insertByName(const OUString& aName, const uno::Any&
void SwXFieldmarkParameters::removeByName(const OUString& aName)
throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!getCoreParameters()->erase(aName))
throw container::NoSuchElementException();
}
@@ -543,7 +549,7 @@ void SwXFieldmarkParameters::removeByName(const OUString& aName)
void SwXFieldmarkParameters::replaceByName(const OUString& aName, const uno::Any& aElement)
throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark::parameter_map_t* pParameters = getCoreParameters();
IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName);
if(pEntry == pParameters->end())
@@ -554,7 +560,7 @@ void SwXFieldmarkParameters::replaceByName(const OUString& aName, const uno::Any
uno::Any SwXFieldmarkParameters::getByName(const OUString& aName)
throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark::parameter_map_t* pParameters = getCoreParameters();
IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName);
if(pEntry == pParameters->end())
@@ -565,7 +571,7 @@ uno::Any SwXFieldmarkParameters::getByName(const OUString& aName)
uno::Sequence<OUString> SwXFieldmarkParameters::getElementNames()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark::parameter_map_t* pParameters = getCoreParameters();
uno::Sequence<OUString> vResult(pParameters->size());
OUString* pOutEntry = vResult.getArray();
@@ -577,7 +583,7 @@ uno::Sequence<OUString> SwXFieldmarkParameters::getElementNames()
::sal_Bool SwXFieldmarkParameters::hasByName(const OUString& aName)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark::parameter_map_t* pParameters = getCoreParameters();
return (pParameters->find(aName) != pParameters->end());
}
@@ -591,7 +597,7 @@ uno::Type SwXFieldmarkParameters::getElementType()
::sal_Bool SwXFieldmarkParameters::hasElements()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return !getCoreParameters()->empty();
}
@@ -614,6 +620,7 @@ IFieldmark::parameter_map_t* SwXFieldmarkParameters::getCoreParameters()
void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTextRange )
throw(lang::IllegalArgumentException, uno::RuntimeException)
{
+
attachToRangeEx( xTextRange,
( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) );
}
@@ -621,7 +628,7 @@ void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTe
::rtl::OUString SwXFieldmark::getFieldType(void)
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const IFieldmark *pBkm = dynamic_cast<const IFieldmark*>(GetBookmark());
if(!pBkm)
throw uno::RuntimeException();
@@ -631,7 +638,7 @@ void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTe
void SwXFieldmark::setFieldType(const::rtl::OUString & fieldType)
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark *pBkm = const_cast<IFieldmark*>(
dynamic_cast<const IFieldmark*>(GetBookmark()));
if(!pBkm)
@@ -642,7 +649,7 @@ void SwXFieldmark::setFieldType(const::rtl::OUString & fieldType)
uno::Reference<container::XNameContainer> SwXFieldmark::getParameters()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
IFieldmark *pBkm = const_cast<IFieldmark*>(
dynamic_cast<const IFieldmark*>(GetBookmark()));
if(!pBkm)
@@ -650,3 +657,83 @@ uno::Reference<container::XNameContainer> SwXFieldmark::getParameters()
return uno::Reference<container::XNameContainer>(new SwXFieldmarkParameters(pBkm));
}
+uno::Reference<text::XTextContent>
+SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark & rMark)
+{
+ // #i105557#: do not iterate over the registered clients: race condition
+ ::sw::mark::MarkBase *const pMarkBase(
+ dynamic_cast< ::sw::mark::MarkBase * >(&rMark));
+ OSL_ENSURE(pMarkBase, "CreateXBookmark: no MarkBase?");
+ if (!pMarkBase) { return 0; }
+ uno::Reference<text::XTextContent> xMark(pMarkBase->GetXBookmark());
+ if (!xMark.is())
+ {
+ // FIXME: These belong in XTextFieldsSupplier
+ SwXFieldmark* pXBkmk = NULL;
+ if (dynamic_cast< ::sw::mark::TextFieldmark* >(&rMark))
+ pXBkmk = new SwXFieldmark(false, &rMark, &rDoc);
+ else if (dynamic_cast< ::sw::mark::CheckboxFieldmark* >(&rMark))
+ pXBkmk = new SwXFieldmark(true, &rMark, &rDoc);
+
+ xMark.set(pXBkmk);
+ pXBkmk->registerInMark(*pXBkmk, pMarkBase);
+ }
+ return xMark;
+}
+
+::sw::mark::ICheckboxFieldmark*
+SwXFieldmark::getCheckboxFieldmark()
+{
+ ::sw::mark::ICheckboxFieldmark* pCheckboxFm = NULL;
+ if ( getFieldType() == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX) ) )
+ // evil #TODO #FIXME casting away the const-ness
+ pCheckboxFm = const_cast<sw::mark::ICheckboxFieldmark*>(reinterpret_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()));
+ return pCheckboxFm;
+
+}
+
+// support 'hidden' "Checked" property ( note: this property is just for convenience to support
+// docx import filter thus not published via PropertySet info )
+
+void SAL_CALL
+SwXFieldmark::setPropertyValue(const OUString& PropertyName,
+ const uno::Any& rValue)
+throw (beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ SolarMutexGuard g;
+ if ( PropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Checked") ) ) )
+ {
+ ::sw::mark::ICheckboxFieldmark* pCheckboxFm = getCheckboxFieldmark();
+ sal_Bool bChecked( sal_False );
+ if ( pCheckboxFm && ( rValue >>= bChecked ) )
+ pCheckboxFm->SetChecked( bChecked );
+ else
+ throw uno::RuntimeException();
+
+ }
+ else
+ SwXFieldmark_Base::setPropertyValue( PropertyName, rValue );
+}
+
+// support 'hidden' "Checked" property ( note: this property is just for convenience to support
+// docx import filter thus not published via PropertySet info )
+
+uno::Any SAL_CALL SwXFieldmark::getPropertyValue(const OUString& rPropertyName)
+throw (beans::UnknownPropertyException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ SolarMutexGuard g;
+ if ( rPropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Checked") ) ) )
+ {
+ ::sw::mark::ICheckboxFieldmark* pCheckboxFm = getCheckboxFieldmark();
+ if ( pCheckboxFm )
+ return uno::makeAny( pCheckboxFm->IsChecked() );
+ else
+ throw uno::RuntimeException();
+ }
+ return SwXFieldmark_Base::getPropertyValue( rPropertyName );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 331350a5d9f2..a727886c5a27 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,6 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart2/data/LabelOrigin.hpp>
#include <cppuhelper/interfacecontainer.hxx>
-#include <vos/mutex.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svl/zforlist.hxx> // SvNumberFormatter
@@ -54,11 +54,8 @@
#include <frmfmt.hxx>
#include <docsh.hxx>
#include <ndole.hxx>
-#include <swtable.hxx>
#include <swtypes.hxx>
-#ifndef _UNOCORE_HRC
#include <unocore.hrc>
-#endif
#include <docary.hxx>
@@ -86,8 +83,6 @@ extern int lcl_CompareCellRanges(
sal_Bool bCmpColsFirst );
extern void lcl_NormalizeRange( String &rCell1, String &rCell2 );
-//////////////////////////////////////////////////////////////////////
-
//static
void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc )
{
@@ -125,8 +120,6 @@ void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc )
}
}
-//////////////////////////////////////////////////////////////////////
-
SwChartLockController_Helper::SwChartLockController_Helper( SwDoc *pDocument ) :
pDoc( pDocument )
{
@@ -134,14 +127,12 @@ SwChartLockController_Helper::SwChartLockController_Helper( SwDoc *pDocument ) :
aUnlockTimer.SetTimeoutHdl( LINK( this, SwChartLockController_Helper, DoUnlockAllCharts ));
}
-
SwChartLockController_Helper::~SwChartLockController_Helper()
{
if (pDoc) // still connected?
Disconnect();
}
-
void SwChartLockController_Helper::StartOrContinueLocking()
{
if (!bIsLocked)
@@ -149,7 +140,6 @@ void SwChartLockController_Helper::StartOrContinueLocking()
aUnlockTimer.Start(); // start or continue time of locking
}
-
void SwChartLockController_Helper::Disconnect()
{
aUnlockTimer.Stop();
@@ -157,7 +147,6 @@ void SwChartLockController_Helper::Disconnect()
pDoc = 0;
}
-
void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock )
{
if (!pDoc)
@@ -207,23 +196,18 @@ void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock )
bIsLocked = bLock;
}
-
IMPL_LINK( SwChartLockController_Helper, DoUnlockAllCharts, Timer *, /*pTimer*/ )
{
UnlockAllCharts();
return 0;
}
-
-//////////////////////////////////////////////////////////////////////
-
static osl::Mutex & GetChartMutex()
{
static osl::Mutex aMutex;
return aMutex;
}
-
static void LaunchModifiedEvent(
::cppu::OInterfaceContainerHelper &rICH,
const uno::Reference< uno::XInterface > &rxI )
@@ -238,8 +222,6 @@ static void LaunchModifiedEvent(
}
}
-//////////////////////////////////////////////////////////////////////
-
// rCellRangeName needs to be of one of the following formats:
// - e.g. "A2:E5" or
// - e.g. "Table1.A2:E5"
@@ -268,7 +250,6 @@ sal_Bool FillRangeDescriptor(
return sal_True;
}
-
static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
{
String aRes;
@@ -317,7 +298,6 @@ static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
return aRes;
}
-
static String GetRangeRepFromTableAndCells( const String &rTableName,
const String &rStartCell, const String &rEndCell,
sal_Bool bForceEndCellName )
@@ -342,7 +322,6 @@ static String GetRangeRepFromTableAndCells( const String &rTableName,
return aRes;
}
-
static sal_Bool GetTableAndCellsFromRangeRep(
const OUString &rRangeRepresentation,
String &rTblName,
@@ -393,7 +372,6 @@ static sal_Bool GetTableAndCellsFromRangeRep(
return bSuccess;
}
-
static void GetTableByName( const SwDoc &rDoc, const String &rTableName,
SwFrmFmt **ppTblFmt, SwTable **ppTable)
{
@@ -416,7 +394,6 @@ static void GetTableByName( const SwDoc &rDoc, const String &rTableName,
*ppTable = pTblFmt ? SwTable::FindTable( pTblFmt ) : 0;
}
-
static void GetFormatAndCreateCursorFromRangeRep(
const SwDoc *pDoc,
const OUString &rRangeRepresentation, // must be a single range (i.e. so called sub-range)
@@ -497,7 +474,6 @@ static void GetFormatAndCreateCursorFromRangeRep(
}
}
-
static sal_Bool GetSubranges( const OUString &rRangeRepresentation,
uno::Sequence< OUString > &rSubRanges, sal_Bool bNormalize )
{
@@ -545,7 +521,6 @@ static sal_Bool GetSubranges( const OUString &rRangeRepresentation,
return bRes;
}
-
static void SortSubranges( uno::Sequence< OUString > &rSubRanges, sal_Bool bCmpByColumn )
{
sal_Int32 nLen = rSubRanges.getLength();
@@ -592,8 +567,6 @@ static void SortSubranges( uno::Sequence< OUString > &rSubRanges, sal_Bool bCmpB
}
}
-//////////////////////////////////////////////////////////////////////
-
SwChartDataProvider::SwChartDataProvider( const SwDoc* pSwDoc ) :
aEvtListeners( GetChartMutex() ),
pDoc( pSwDoc )
@@ -601,7 +574,6 @@ SwChartDataProvider::SwChartDataProvider( const SwDoc* pSwDoc ) :
bDisposed = sal_False;
}
-
SwChartDataProvider::~SwChartDataProvider()
{
}
@@ -610,7 +582,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
const uno::Sequence< beans::PropertyValue >& rArguments, sal_Bool bTestOnly )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -633,7 +605,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
const beans::PropertyValue *pArg = rArguments.getConstArray();
for (sal_Int32 i = 0; i < nArgs; ++i)
{
- if (pArg[i].Name.equalsAscii( "DataRowSource" ))
+ if (pArg[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DataRowSource")))
{
chart::ChartDataRowSource eSource;
if (!(pArg[i].Value >>= eSource))
@@ -645,22 +617,22 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
}
bDtaSrcIsColumns = eSource == chart::ChartDataRowSource_COLUMNS;
}
- else if (pArg[i].Name.equalsAscii( "FirstCellAsLabel" ))
+ else if (pArg[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FirstCellAsLabel")))
{
if (!(pArg[i].Value >>= bFirstIsLabel))
throw lang::IllegalArgumentException();
}
- else if (pArg[i].Name.equalsAscii( "CellRangeRepresentation" ))
+ else if (pArg[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
{
if (!(pArg[i].Value >>= aRangeRepresentation))
throw lang::IllegalArgumentException();
}
- else if (pArg[i].Name.equalsAscii( "SequenceMapping" ))
+ else if (pArg[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SequenceMapping")))
{
if (!(pArg[i].Value >>= aSequenceMapping))
throw lang::IllegalArgumentException();
}
- else if (pArg[i].Name.equalsAscii( "ChartOleObjectName" ))
+ else if (pArg[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ChartOleObjectName")))
{
if (!(pArg[i].Value >>= aChartOleObjectName))
throw lang::IllegalArgumentException();
@@ -1028,7 +1000,7 @@ sal_Bool SAL_CALL SwChartDataProvider::createDataSourcePossible(
const uno::Sequence< beans::PropertyValue >& rArguments )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Bool bPossible = sal_True;
try
@@ -1047,7 +1019,7 @@ uno::Reference< chart2::data::XDataSource > SAL_CALL SwChartDataProvider::create
const uno::Sequence< beans::PropertyValue >& rArguments )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return Impl_createDataSource( rArguments );
}
@@ -1094,7 +1066,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
const uno::Reference< chart2::data::XDataSource >& xDataSource )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -1131,13 +1103,12 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
// be determined)
// -1: don't know yet, 0: not used, 1: always a single labe cell, ...
// -2: neither/failed
-// sal_Int32 nValuesSeqLen = -1; // used to see if all value sequences have the same size
for (sal_Int32 nDS1 = 0; nDS1 < nNumDS_LDS; ++nDS1)
{
uno::Reference< chart2::data::XLabeledDataSequence > xLabeledDataSequence( pDS_LDS[nDS1] );
if( !xLabeledDataSequence.is() )
{
- DBG_ERROR("got NULL for XLabeledDataSequence from Data source");
+ OSL_FAIL("got NULL for XLabeledDataSequence from Data source");
continue;
}
const uno::Reference< chart2::data::XDataSequence > xCurLabel( xLabeledDataSequence->getLabel(), uno::UNO_QUERY );
@@ -1200,6 +1171,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
{
DBG_ASSERT( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
"trying to determine 'DataRowSource': something's fishy... should have been a single cell");
+ (void)nCurValuesSeqLen;
nDirection = 0; // default direction for a single cell should be 'columns'
}
else // more than one cell is availabale (in values and label together!)
@@ -1210,7 +1182,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
nDirection = 0;
else
{
- DBG_ERROR( "trying to determine 'DataRowSource': unexpected case found" );
+ OSL_FAIL( "trying to determine 'DataRowSource': unexpected case found" );
nDirection = -2;
}
}
@@ -1400,19 +1372,6 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
if (!bNeedSequenceMapping)
aSequenceMapping.realloc(0);
-
-#ifdef TL_NOT_USED // in the end chart2 did not want to have the sequence minimized
- // try to shorten the 'SequenceMapping' as much as possible
- sal_Int32 k;
- for (k = nNumDS_LDS - 1; k >= 0; --k)
- {
- if (pSequenceMapping[k] != k)
- break;
- }
- aSequenceMapping.realloc( k + 1 );
-#endif
-
-
//
// build resulting properties
//
@@ -1487,7 +1446,7 @@ sal_Bool SAL_CALL SwChartDataProvider::createDataSequenceByRangeRepresentationPo
const OUString& rRangeRepresentation )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Bool bPossible = sal_True;
try
@@ -1506,11 +1465,10 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL SwChartDataProvider::crea
const OUString& rRangeRepresentation )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return Impl_createDataSequenceByRangeRepresentation( rRangeRepresentation );
}
-
uno::Reference< sheet::XRangeSelection > SAL_CALL SwChartDataProvider::getRangeSelection( )
throw (uno::RuntimeException)
{
@@ -1518,7 +1476,6 @@ uno::Reference< sheet::XRangeSelection > SAL_CALL SwChartDataProvider::getRangeS
return uno::Reference< sheet::XRangeSelection >();
}
-
void SAL_CALL SwChartDataProvider::dispose( )
throw (uno::RuntimeException)
{
@@ -1547,7 +1504,6 @@ void SAL_CALL SwChartDataProvider::dispose( )
}
}
-
void SAL_CALL SwChartDataProvider::addEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -1557,7 +1513,6 @@ void SAL_CALL SwChartDataProvider::addEventListener(
aEvtListeners.addInterface( rxListener );
}
-
void SAL_CALL SwChartDataProvider::removeEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -1567,53 +1522,45 @@ void SAL_CALL SwChartDataProvider::removeEventListener(
aEvtListeners.removeInterface( rxListener );
}
-
-
OUString SAL_CALL SwChartDataProvider::getImplementationName( )
throw (uno::RuntimeException)
{
return C2U("SwChartDataProvider");
}
-
sal_Bool SAL_CALL SwChartDataProvider::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
- return rServiceName.equalsAscii( SN_DATA_PROVIDER );
+ SolarMutexGuard aGuard;
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_PROVIDER ) );
}
-
uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = C2U( SN_DATA_PROVIDER );
return aRes;
}
-
void SwChartDataProvider::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
// actually this function should be superfluous (need to check later)
ClientModify(this, pOld, pNew );
}
-
void SwChartDataProvider::AddDataSequence( const SwTable &rTable, uno::Reference< chart2::data::XDataSequence > &rxDataSequence )
{
aDataSequences[ &rTable ].insert( rxDataSequence );
}
-
void SwChartDataProvider::RemoveDataSequence( const SwTable &rTable, uno::Reference< chart2::data::XDataSequence > &rxDataSequence )
{
aDataSequences[ &rTable ].erase( rxDataSequence );
}
-
void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
{
DBG_ASSERT( pTable, "table pointer is NULL" );
@@ -1623,10 +1570,9 @@ void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
pTable->GetFrmFmt()->GetDoc()->GetChartControllerHelper().StartOrContinueLocking();
const Set_DataSequenceRef_t &rSet = aDataSequences[ pTable ];
- Set_DataSequenceRef_t::iterator aIt( rSet.begin() );
+ Set_DataSequenceRef_t::const_iterator aIt( rSet.begin() );
while (aIt != rSet.end())
{
-// uno::Reference< util::XModifiable > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY );
uno::Reference< chart2::data::XDataSequence > xTemp(*aIt); // temporary needed for g++ 3.3.5
uno::Reference< util::XModifiable > xRef( xTemp, uno::UNO_QUERY );
if (xRef.is())
@@ -1639,7 +1585,6 @@ void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
}
}
-
sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox &rBox )
{
sal_Bool bRes = sal_False;
@@ -1661,7 +1606,6 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox
sal_Bool bNowEmpty = sal_False;
// check if weak reference is still valid...
-// uno::Reference< chart2::data::XDataSequence > xRef( uno::Reference< chart2::data::XDataSequence>(*aIt), uno::UNO_QUERY );
uno::Reference< chart2::data::XDataSequence > xTemp(*aIt); // temporary needed for g++ 3.3.5
uno::Reference< chart2::data::XDataSequence > xRef( xTemp, uno::UNO_QUERY );
if (xRef.is())
@@ -1691,7 +1635,6 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox
return bRes;
}
-
void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
{
DBG_ASSERT( pTable, "table pointer is NULL" );
@@ -1706,11 +1649,10 @@ void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
//! would become invalid.
const Set_DataSequenceRef_t aSet( aDataSequences[ pTable ] );
- Set_DataSequenceRef_t::iterator aIt( aSet.begin() );
- Set_DataSequenceRef_t::iterator aEndIt( aSet.end() );
+ Set_DataSequenceRef_t::const_iterator aIt( aSet.begin() );
+ Set_DataSequenceRef_t::const_iterator aEndIt( aSet.end() );
while (aIt != aEndIt)
{
-// uno::Reference< lang::XComponent > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY );
uno::Reference< chart2::data::XDataSequence > xTemp(*aIt); // temporary needed for g++ 3.3.5
uno::Reference< lang::XComponent > xRef( xTemp, uno::UNO_QUERY );
if (xRef.is())
@@ -1722,7 +1664,6 @@ void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
}
}
-
////////////////////////////////////////
// SwChartDataProvider::AddRowCols tries to notify charts of added columns
// or rows and extends the value sequence respectively (if possible).
@@ -1759,9 +1700,9 @@ void SwChartDataProvider::AddRowCols(
SwTableBox* pFirstBox = *( rBoxes.GetData() + 0 );
SwTableBox* pLastBox = *( rBoxes.GetData() + nBoxes - 1 );
- sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
if (pFirstBox && pLastBox)
{
+ sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
lcl_GetCellPosition( pFirstBox->GetName(), nFirstCol, nFirstRow );
lcl_GetCellPosition( pLastBox->GetName(), nLastCol, nLastRow );
@@ -1772,24 +1713,19 @@ void SwChartDataProvider::AddRowCols(
{
//get range of indices in col/rows for new cells
sal_Int32 nFirstNewCol = nFirstCol;
- sal_Int32 nLastNewCol = nLastCol;
sal_Int32 nFirstNewRow = bBehind ? nFirstRow + 1 : nFirstRow - nLines;
- sal_Int32 nLastNewRow = nFirstNewRow - 1 + nLines;
if (bAddCols)
{
DBG_ASSERT( nFirstCol == nLastCol, "column indices seem broken" );
nFirstNewCol = bBehind ? nFirstCol + 1 : nFirstCol - nLines;
- nLastNewCol = nFirstNewCol - 1 + nLines;
nFirstNewRow = nFirstRow;
- nLastNewRow = nLastRow;
}
// iterate over all data-sequences for the table
const Set_DataSequenceRef_t &rSet = aDataSequences[ &rTable ];
- Set_DataSequenceRef_t::iterator aIt( rSet.begin() );
+ Set_DataSequenceRef_t::const_iterator aIt( rSet.begin() );
while (aIt != rSet.end())
{
-// uno::Reference< chart2::data::XTextualDataSequence > xRef( uno::Reference< chart2::data::XDataSequence >(*aIt), uno::UNO_QUERY );
uno::Reference< chart2::data::XDataSequence > xTemp(*aIt); // temporary needed for g++ 3.3.5
uno::Reference< chart2::data::XTextualDataSequence > xRef( xTemp, uno::UNO_QUERY );
if (xRef.is())
@@ -1834,13 +1770,11 @@ void SwChartDataProvider::AddRowCols(
}
}
-
// XRangeXMLConversion ---------------------------------------------------
-
rtl::OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const rtl::OUString& rRangeRepresentation )
throw ( uno::RuntimeException, lang::IllegalArgumentException )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -1855,14 +1789,9 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const rtl::OUStri
{
String aRange( aRangeRepresentation.GetToken(i, ';') );
SwFrmFmt *pTblFmt = 0; // pointer to table format
- // BM: For what should the check be necessary? for #i79009# it is required that NO check is done
-// SwUnoCrsr *pUnoCrsr = 0; // here required to check if the cells in the range do actually exist
-// std::auto_ptr< SwUnoCrsr > pAuto( pUnoCrsr ); // to end lifetime of object pointed to by pUnoCrsr
GetFormatAndCreateCursorFromRangeRep( pDoc, aRange, &pTblFmt, NULL );
if (!pTblFmt)
throw lang::IllegalArgumentException();
-// if (!pUnoCrsr)
-// throw uno::RuntimeException();
SwTable* pTable = SwTable::FindTable( pTblFmt );
if (pTable->IsTblComplex())
throw uno::RuntimeException();
@@ -1913,7 +1842,7 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const rtl::OUStri
rtl::OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const rtl::OUString& rXMLRange )
throw ( uno::RuntimeException, lang::IllegalArgumentException )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -1958,58 +1887,47 @@ rtl::OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const rtl::OUSt
return aRes;
}
-
-//////////////////////////////////////////////////////////////////////
-
SwChartDataSource::SwChartDataSource(
const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > &rLDS ) :
aLDS( rLDS )
{
}
-
SwChartDataSource::~SwChartDataSource()
{
-// delete pTblCrsr;
}
-
uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > SAL_CALL SwChartDataSource::getDataSequences( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return aLDS;
}
-
OUString SAL_CALL SwChartDataSource::getImplementationName( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return C2U("SwChartDataSource");
}
-
sal_Bool SAL_CALL SwChartDataSource::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
- return rServiceName.equalsAscii( SN_DATA_SOURCE );
+ SolarMutexGuard aGuard;
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_SOURCE ) );
}
-
uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = C2U( SN_DATA_SOURCE );
return aRes;
}
-//////////////////////////////////////////////////////////////////////
-
SwChartDataSequence::SwChartDataSequence(
SwChartDataProvider &rProvider,
SwFrmFmt &rTblFmt,
@@ -2038,7 +1956,7 @@ SwChartDataSequence::SwChartDataSequence(
pDataProvider->addEventListener( dynamic_cast< lang::XEventListener * >(this) );
}
else {
- DBG_ERROR( "table missing" );
+ OSL_FAIL( "table missing" );
}
}
catch (uno::RuntimeException &)
@@ -2061,7 +1979,6 @@ SwChartDataSequence::SwChartDataSequence(
#endif
}
-
SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
SwChartDataSequenceBaseClass(),
SwClient( rObj.GetFrmFmt() ),
@@ -2089,7 +2006,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
pDataProvider->addEventListener( dynamic_cast< lang::XEventListener * >(this) );
}
else {
- DBG_ERROR( "table missing" );
+ OSL_FAIL( "table missing" );
}
}
catch (uno::RuntimeException &)
@@ -2112,7 +2029,6 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
#endif
}
-
SwChartDataSequence::~SwChartDataSequence()
{
// since the data-provider holds only weak references to the data-sequence
@@ -2121,14 +2037,12 @@ SwChartDataSequence::~SwChartDataSequence()
delete pTblCrsr;
}
-
const uno::Sequence< sal_Int8 > & SwChartDataSequence::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-
sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_Int8 > &rId )
throw(uno::RuntimeException)
{
@@ -2141,11 +2055,10 @@ sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_I
return 0;
}
-
uno::Sequence< uno::Any > SAL_CALL SwChartDataSequence::getData( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2171,11 +2084,10 @@ uno::Sequence< uno::Any > SAL_CALL SwChartDataSequence::getData( )
return aRes;
}
-
OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2196,7 +2108,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
chart2::data::LabelOrigin eLabelOrigin )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2242,7 +2154,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
bReturnEmptyTxt = nColSpan == nRowSpan;
}
else {
- DBG_ERROR( "unexpected case" );
+ OSL_FAIL( "unexpected case" );
}
// build label sequence
@@ -2307,12 +2219,10 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
return 0;
}
-
-
uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getTextualData( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2338,11 +2248,10 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getTextualData( )
return aRes;
}
-
uno::Sequence< double > SAL_CALL SwChartDataSequence::getNumericalData( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2371,21 +2280,19 @@ uno::Sequence< double > SAL_CALL SwChartDataSequence::getNumericalData( )
return aRes;
}
-
uno::Reference< util::XCloneable > SAL_CALL SwChartDataSequence::createClone( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
return new SwChartDataSequence( *this );
}
-
uno::Reference< beans::XPropertySetInfo > SAL_CALL SwChartDataSequence::getPropertySetInfo( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2393,13 +2300,12 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL SwChartDataSequence::getPrope
return xRes;
}
-
void SAL_CALL SwChartDataSequence::setPropertyValue(
const OUString& rPropertyName,
const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2412,12 +2318,11 @@ void SAL_CALL SwChartDataSequence::setPropertyValue(
throw beans::UnknownPropertyException();
}
-
uno::Any SAL_CALL SwChartDataSequence::getPropertyValue(
const OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2430,72 +2335,60 @@ uno::Any SAL_CALL SwChartDataSequence::getPropertyValue(
return aRes;
}
-
void SAL_CALL SwChartDataSequence::addPropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- //vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_ERROR( "not implemented" );
+ OSL_FAIL( "not implemented" );
}
-
void SAL_CALL SwChartDataSequence::removePropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- //vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_ERROR( "not implemented" );
+ OSL_FAIL( "not implemented" );
}
-
void SAL_CALL SwChartDataSequence::addVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- //vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_ERROR( "not implemented" );
+ OSL_FAIL( "not implemented" );
}
-
void SAL_CALL SwChartDataSequence::removeVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- //vos::OGuard aGuard( Application::GetSolarMutex() );
- DBG_ERROR( "not implemented" );
+ OSL_FAIL( "not implemented" );
}
-
OUString SAL_CALL SwChartDataSequence::getImplementationName( )
throw (uno::RuntimeException)
{
return C2U("SwChartDataSequence");
}
-
sal_Bool SAL_CALL SwChartDataSequence::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- return rServiceName.equalsAscii( SN_DATA_SEQUENCE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_DATA_SEQUENCE ) );
}
-
uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = C2U( SN_DATA_SEQUENCE );
return aRes;
}
-
void SwChartDataSequence::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
@@ -2512,23 +2405,21 @@ void SwChartDataSequence::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
sal_Bool SAL_CALL SwChartDataSequence::isModified( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
return sal_True;
}
-
void SAL_CALL SwChartDataSequence::setModified(
::sal_Bool bModified )
throw (beans::PropertyVetoException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2536,7 +2427,6 @@ void SAL_CALL SwChartDataSequence::setModified(
LaunchModifiedEvent( aModifyListeners, dynamic_cast< XModifyBroadcaster * >(this) );
}
-
void SAL_CALL SwChartDataSequence::addModifyListener(
const uno::Reference< util::XModifyListener >& rxListener )
throw (uno::RuntimeException)
@@ -2546,7 +2436,6 @@ void SAL_CALL SwChartDataSequence::addModifyListener(
aModifyListeners.addInterface( rxListener );
}
-
void SAL_CALL SwChartDataSequence::removeModifyListener(
const uno::Reference< util::XModifyListener >& rxListener )
throw (uno::RuntimeException)
@@ -2556,7 +2445,6 @@ void SAL_CALL SwChartDataSequence::removeModifyListener(
aModifyListeners.removeInterface( rxListener );
}
-
void SAL_CALL SwChartDataSequence::disposing( const lang::EventObject& rSource )
throw (uno::RuntimeException)
{
@@ -2569,7 +2457,6 @@ void SAL_CALL SwChartDataSequence::disposing( const lang::EventObject& rSource )
}
}
-
void SAL_CALL SwChartDataSequence::dispose( )
throw (uno::RuntimeException)
{
@@ -2592,7 +2479,7 @@ void SAL_CALL SwChartDataSequence::dispose( )
pDataProvider->RemoveDataSequence( *pTable, xRef );
}
else {
- DBG_ERROR( "table missing" );
+ OSL_FAIL( "table missing" );
}
}
@@ -2603,7 +2490,6 @@ void SAL_CALL SwChartDataSequence::dispose( )
}
}
-
void SAL_CALL SwChartDataSequence::addEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -2613,7 +2499,6 @@ void SAL_CALL SwChartDataSequence::addEventListener(
aEvtListeners.addInterface( rxListener );
}
-
void SAL_CALL SwChartDataSequence::removeEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -2623,7 +2508,6 @@ void SAL_CALL SwChartDataSequence::removeEventListener(
aEvtListeners.removeInterface( rxListener );
}
-
sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
{
#if OSL_DEBUG_LEVEL > 1
@@ -2682,7 +2566,7 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
bMoveLeft = nMarkCol > nPointCol;
}
else {
- DBG_ERROR( "neither vertical nor horizontal movement" );
+ OSL_FAIL( "neither vertical nor horizontal movement" );
}
// get new box (position) to use...
@@ -2697,8 +2581,8 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
if (pNewBox) // set new position (cell range) to use
{
- // So erhält man den ersten Inhaltsnode in einer gegebenen Zelle:
- // Zunächst einen SwNodeIndex auf den Node hinter dem SwStartNode der Box...
+ // So erh lt man den ersten Inhaltsnode in einer gegebenen Zelle:
+ // Zun chst einen SwNodeIndex auf den Node hinter dem SwStartNode der Box...
SwNodeIndex aIdx( *pNewBox->GetSttNd(), +1 );
// Dies kann ein SwCntntNode sein, kann aber auch ein Tabellen oder Sectionnode sein,
// deshalb das GoNext;
@@ -2721,18 +2605,17 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
pPos->nContent = aNewPos.nContent;
}
else {
- DBG_ERROR( "neither point nor mark available for change" );
+ OSL_FAIL( "neither point nor mark available for change" );
}
}
else {
- DBG_ERROR( "failed to get position" );
+ OSL_FAIL( "failed to get position" );
}
}
return bNowEmpty;
}
-
void SwChartDataSequence::FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const
{
SwFrmFmt* pTblFmt = GetFrmFmt();
@@ -2853,8 +2736,6 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
return bChanged;
}
-//////////////////////////////////////////////////////////////////////
-
SwChartLabeledDataSequence::SwChartLabeledDataSequence() :
aEvtListeners( GetChartMutex() ),
aModifyListeners( GetChartMutex() )
@@ -2862,22 +2743,19 @@ SwChartLabeledDataSequence::SwChartLabeledDataSequence() :
bDisposed = sal_False;
}
-
SwChartLabeledDataSequence::~SwChartLabeledDataSequence()
{
}
-
uno::Reference< chart2::data::XDataSequence > SAL_CALL SwChartLabeledDataSequence::getValues( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
return xData;
}
-
void SwChartLabeledDataSequence::SetDataSequence(
uno::Reference< chart2::data::XDataSequence >& rxDest,
const uno::Reference< chart2::data::XDataSequence >& rxSource)
@@ -2904,12 +2782,11 @@ void SwChartLabeledDataSequence::SetDataSequence(
xMB->addModifyListener( xML );
}
-
void SAL_CALL SwChartLabeledDataSequence::setValues(
const uno::Reference< chart2::data::XDataSequence >& rxSequence )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2921,22 +2798,20 @@ void SAL_CALL SwChartLabeledDataSequence::setValues(
}
}
-
uno::Reference< chart2::data::XDataSequence > SAL_CALL SwChartLabeledDataSequence::getLabel( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
return xLabels;
}
-
void SAL_CALL SwChartLabeledDataSequence::setLabel(
const uno::Reference< chart2::data::XDataSequence >& rxSequence )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2948,11 +2823,10 @@ void SAL_CALL SwChartLabeledDataSequence::setLabel(
}
}
-
uno::Reference< util::XCloneable > SAL_CALL SwChartLabeledDataSequence::createClone( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (bDisposed)
throw lang::DisposedException();
@@ -2976,32 +2850,28 @@ uno::Reference< util::XCloneable > SAL_CALL SwChartLabeledDataSequence::createCl
return xRes;
}
-
OUString SAL_CALL SwChartLabeledDataSequence::getImplementationName( )
throw (uno::RuntimeException)
{
return C2U("SwChartLabeledDataSequence");
}
-
sal_Bool SAL_CALL SwChartLabeledDataSequence::supportsService(
const OUString& rServiceName )
throw (uno::RuntimeException)
{
- return rServiceName.equalsAscii( SN_LABELED_DATA_SEQUENCE );
+ return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SN_LABELED_DATA_SEQUENCE ) );
}
-
uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = C2U( SN_LABELED_DATA_SEQUENCE );
return aRes;
}
-
void SAL_CALL SwChartLabeledDataSequence::disposing(
const lang::EventObject& rSource )
throw (uno::RuntimeException)
@@ -3016,7 +2886,6 @@ void SAL_CALL SwChartLabeledDataSequence::disposing(
dispose();
}
-
void SAL_CALL SwChartLabeledDataSequence::modified(
const lang::EventObject& rEvent )
throw (uno::RuntimeException)
@@ -3027,7 +2896,6 @@ void SAL_CALL SwChartLabeledDataSequence::modified(
}
}
-
void SAL_CALL SwChartLabeledDataSequence::addModifyListener(
const uno::Reference< util::XModifyListener >& rxListener )
throw (uno::RuntimeException)
@@ -3037,7 +2905,6 @@ void SAL_CALL SwChartLabeledDataSequence::addModifyListener(
aModifyListeners.addInterface( rxListener );
}
-
void SAL_CALL SwChartLabeledDataSequence::removeModifyListener(
const uno::Reference< util::XModifyListener >& rxListener )
throw (uno::RuntimeException)
@@ -3047,7 +2914,6 @@ void SAL_CALL SwChartLabeledDataSequence::removeModifyListener(
aModifyListeners.removeInterface( rxListener );
}
-
void SAL_CALL SwChartLabeledDataSequence::dispose( )
throw (uno::RuntimeException)
{
@@ -3069,7 +2935,6 @@ void SAL_CALL SwChartLabeledDataSequence::dispose( )
}
}
-
void SAL_CALL SwChartLabeledDataSequence::addEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -3079,7 +2944,6 @@ void SAL_CALL SwChartLabeledDataSequence::addEventListener(
aEvtListeners.addInterface( rxListener );
}
-
void SAL_CALL SwChartLabeledDataSequence::removeEventListener(
const uno::Reference< lang::XEventListener >& rxListener )
throw (uno::RuntimeException)
@@ -3089,4 +2953,4 @@ void SAL_CALL SwChartLabeledDataSequence::removeEventListener(
aEvtListeners.removeInterface( rxListener );
}
-//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 1d65ee99c812..5b96e7247070 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <swtypes.hxx>
#include <cmdid.h>
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <fmtcol.hxx>
@@ -49,7 +48,7 @@
#include <txtftn.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/text/XTextTableCursor.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
@@ -70,7 +69,7 @@
#include <unochart.hxx>
#include <comphelper/makesequence.hxx>
#include <comphelper/sequence.hxx>
-#include <slist>
+#include <list>
#include <iterator>
#include <unosection.hxx>
@@ -79,7 +78,16 @@
#include <unorefmark.hxx>
#include <unometa.hxx>
#include "docsh.hxx"
-
+#include <com/sun/star/document/XCodeNameQuery.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/form/XFormsSupplier.hpp>
+#include <com/sun/star/script/ModuleInfo.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
+#include <vbahelper/vbaaccesshelper.hxx>
+#include <basic/basmgr.hxx>
+#include <comphelper/processfactory.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -89,9 +97,186 @@ using namespace ::com::sun::star::text;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-/******************************************************************************
- *
- ******************************************************************************/
+using rtl::OUString;
+
+class SwVbaCodeNameProvider : public ::cppu::WeakImplHelper1< document::XCodeNameQuery >
+{
+ SwDocShell* mpDocShell;
+ rtl::OUString msThisDocumentCodeName;
+public:
+ SwVbaCodeNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell ) {}
+ // XCodeNameQuery
+ rtl::OUString SAL_CALL getCodeNameForObject( const uno::Reference< uno::XInterface >& xIf ) throw( uno::RuntimeException )
+ {
+ // Initialise the code name
+ if ( msThisDocumentCodeName.getLength() == 0 )
+ {
+ try
+ {
+ uno::Reference< beans::XPropertySet > xProps( mpDocShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xLibContainer( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY_THROW );
+ rtl::OUString sProjectName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) );
+ if ( mpDocShell->GetBasicManager()->GetName().Len() )
+ sProjectName = mpDocShell->GetBasicManager()->GetName();
+
+ uno::Reference< container::XNameAccess > xLib( xLibContainer->getByName( sProjectName ), uno::UNO_QUERY_THROW );
+ uno::Sequence< rtl::OUString > sModuleNames = xLib->getElementNames();
+ uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
+
+ for ( sal_Int32 i=0; i < sModuleNames.getLength(); ++i )
+ {
+ script::ModuleInfo mInfo;
+
+ if ( xVBAModuleInfo->hasModuleInfo( sModuleNames[ i ] ) && xVBAModuleInfo->getModuleInfo( sModuleNames[ i ] ).ModuleType == script::ModuleType::DOCUMENT )
+ {
+ msThisDocumentCodeName = sModuleNames[ i ];
+ break;
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ rtl::OUString sCodeName;
+ if ( mpDocShell )
+ {
+ OSL_TRACE( "*** In ScVbaCodeNameProvider::getCodeNameForObject");
+ // need to find the page ( and index ) for this control
+ uno::Reference< drawing::XDrawPageSupplier > xSupplier( mpDocShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndex( xSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+
+ bool bMatched = false;
+ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents;
+ try
+ {
+ uno::Reference< form::XFormsSupplier > xFormSupplier( xIndex, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xFormIndex( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
+ // get the www-standard container
+ uno::Reference< container::XIndexAccess > xFormControls( xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
+ sal_Int32 nCntrls = xFormControls->getCount();
+ for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
+ {
+ uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
+ bMatched = ( xControl == xIf );
+ if ( bMatched )
+ {
+ sCodeName = msThisDocumentCodeName;
+ break;
+ }
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+ // Probably should throw here ( if !bMatched )
+ return sCodeName;
+ }
+};
+
+typedef boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > StringHashMap;
+class SwVbaProjectNameProvider : public ::cppu::WeakImplHelper1< container::XNameContainer >
+{
+ SwDocShell* mpDocShell;
+ StringHashMap mTemplateToProject;
+public:
+ SwVbaProjectNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
+ {
+ return ( mTemplateToProject.find( aName ) != mTemplateToProject.end() );
+ }
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ return uno::makeAny( mTemplateToProject.find( aName )->second );
+ }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > aElements( mTemplateToProject.size() );
+ StringHashMap::iterator it_end = mTemplateToProject.end();
+ sal_Int32 index = 0;
+ for ( StringHashMap::iterator it = mTemplateToProject.begin(); it != it_end; ++it, ++index )
+ aElements[ index ] = it->first;
+ return aElements;
+ }
+
+ virtual void SAL_CALL insertByName( const rtl::OUString& aName, const uno::Any& aElement ) throw ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, com::sun::star::lang::WrappedTargetException )
+ {
+
+ rtl::OUString sProjectName;
+ aElement >>= sProjectName;
+ OSL_TRACE("** Template cache inserting template name %s with project %s"
+ , rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr()
+ , rtl::OUStringToOString( sProjectName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ mTemplateToProject[ aName ] = sProjectName;
+ }
+
+ virtual void SAL_CALL removeByName( const rtl::OUString& Name ) throw ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
+ {
+ if ( !hasByName( Name ) )
+ throw container::NoSuchElementException();
+ mTemplateToProject.erase( Name );
+ }
+ virtual void SAL_CALL replaceByName( const rtl::OUString& aName, const uno::Any& aElement ) throw ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ insertByName( aName, aElement ); // insert will overwrite
+ }
+ // XElemenAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ return ::getCppuType((const rtl::OUString*)0);
+ }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException )
+ {
+
+ return ( mTemplateToProject.size() > 0 );
+ }
+
+};
+
+class SwVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container::XNameAccess >
+{
+ SwDocShell* mpDocShell;
+public:
+ SwVbaObjectForCodeNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell )
+ {
+ // #FIXME #TODO is the code name for ThisDocument read anywhere?
+ }
+
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
+ {
+ // #FIXME #TODO we really need to be checking against the codename for
+ // ThisDocument
+ if ( aName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisDocument" ) ) ) )
+ return sal_True;
+ return sal_False;
+ }
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
+ aArgs[1] = uno::Any( mpDocShell->GetModel() );
+ uno::Reference< uno::XInterface > xDocObj = ooo::vba::createVBAUnoAPIServiceWithArgs( mpDocShell, "ooo.vba.word.Document" , aArgs );
+ OSL_TRACE("Creating Object ( ooo.vba.word.Document ) 0x%x", xDocObj.get() );
+ return uno::makeAny( xDocObj );
+ }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > aNames;
+ return aNames;
+ }
+ // XElemenAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException){ return uno::Type(); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException ) { return sal_True; }
+
+};
+
struct ProvNamesId_Type
{
const char * pName;
@@ -99,7 +284,7 @@ struct ProvNamesId_Type
};
// note: this thing is indexed as an array, so do not insert/remove entries!
-const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
+const ProvNamesId_Type aProvNamesId[] =
{
{ "com.sun.star.text.TextTable", SW_SERVICE_TYPE_TEXTTABLE },
{ "com.sun.star.text.TextFrame", SW_SERVICE_TYPE_TEXTFRAME },
@@ -211,6 +396,10 @@ const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ "com.sun.star.text.Fieldmark", SW_SERVICE_TYPE_FIELDMARK },
{ "com.sun.star.text.FormFieldmark", SW_SERVICE_TYPE_FORMFIELDMARK },
{ "com.sun.star.text.InContentMetadata", SW_SERVICE_TYPE_META },
+ { "ooo.vba.VBAObjectModuleObjectProvider", SW_SERVICE_VBAOBJECTPROVIDER },
+ { "ooo.vba.VBACodeNameProvider", SW_SERVICE_VBACODENAMEPROVIDER },
+ { "ooo.vba.VBAProjectNameProvider", SW_SERVICE_VBAPROJECTNAMEPROVIDER },
+ { "ooo.vba.VBAGlobals", SW_SERVICE_VBAGLOBALS },
// case-correct versions of the service names (see #i67811)
{ CSS_TEXT_TEXTFIELD_DATE_TIME, SW_SERVICE_FIELDTYPE_DATETIME },
@@ -272,9 +461,6 @@ const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY }
};
-/* -----------------------------23.03.01 13:38--------------------------------
-
- ---------------------------------------------------------------------------*/
const SvEventDescription* lcl_GetSupportedMacroItems()
{
static const SvEventDescription aMacroDescriptionsImpl[] =
@@ -290,30 +476,25 @@ const SvEventDescription* lcl_GetSupportedMacroItems()
/******************************************************************
* SwXServiceProvider
******************************************************************/
-/*-- 13.01.99 13:31:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sRet;
- sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
if(nObjectType < nEntries)
- sRet = C2U(aProvNamesId[nObjectType].pName);
+ sRet = rtl::OUString::createFromAscii(aProvNamesId[nObjectType].pName);
return sRet;
}
-/* -----------------11.03.99 12:05-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
{
- sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
uno::Sequence<OUString> aRet(nEntries);
OUString* pArray = aRet.getArray();
sal_uInt16 n = 0;
for(sal_uInt16 i = 0; i < nEntries; i++)
{
- String sProv(C2U(aProvNamesId[i].pName));
+ String sProv(rtl::OUString::createFromAscii(aProvNamesId[i].pName));
if(sProv.Len())
{
pArray[n] = sProv;
@@ -325,12 +506,9 @@ uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
}
-/*-- 13.01.99 13:31:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
{
- sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
+ sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
for(sal_uInt16 i = 0; i < nEntries; i++ )
{
if( COMPARE_EQUAL == rServiceName.compareToAscii(aProvNamesId[i].pName))
@@ -338,12 +516,10 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
}
return SW_SERVICE_INVALID;
}
-/* -----------------13.01.99 14:37-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< uno::XInterface > xRet;
switch(nObjectType)
{
@@ -391,6 +567,50 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
xRet = (cppu::OWeakObject*)pFieldmark;
}
break;
+ case SW_SERVICE_VBAOBJECTPROVIDER :
+ {
+ SwVbaObjectForCodeNameProvider* pObjProv = new SwVbaObjectForCodeNameProvider( pDoc->GetDocShell() );
+ xRet = (cppu::OWeakObject*)pObjProv;
+ }
+ break;
+ case SW_SERVICE_VBACODENAMEPROVIDER :
+ {
+ if ( pDoc->GetDocShell() && ooo::vba::isAlienWordDoc( *pDoc->GetDocShell() ) )
+ {
+ SwVbaCodeNameProvider* pObjProv = new SwVbaCodeNameProvider( pDoc->GetDocShell() );
+ xRet = (cppu::OWeakObject*)pObjProv;
+ }
+ }
+ break;
+ case SW_SERVICE_VBAPROJECTNAMEPROVIDER :
+ {
+ uno::Reference< container::XNameContainer > xProjProv = pDoc->GetVBATemplateToProjectCache();
+ if ( !xProjProv.is() && pDoc->GetDocShell() && ooo::vba::isAlienWordDoc( *pDoc->GetDocShell() ) )
+ {
+ xProjProv = new SwVbaProjectNameProvider( pDoc->GetDocShell() );
+ pDoc->SetVBATemplateToProjectCache( xProjProv );
+ }
+ //xRet = (cppu::OWeakObject*)xProjProv;
+ xRet = xProjProv;
+ }
+ break;
+ case SW_SERVICE_VBAGLOBALS :
+ {
+ if ( pDoc )
+ {
+ uno::Any aGlobs;
+ if ( !pDoc->GetDocShell()->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aGlobs ) )
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= pDoc->GetDocShell()->GetModel();
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Globals")), aArgs );
+ pDoc->GetDocShell()->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ }
+ aGlobs >>= xRet;
+ }
+ }
+ break;
+
case SW_SERVICE_TYPE_FOOTNOTE :
xRet = (cppu::OWeakObject*)new SwXFootnote(sal_False);
break;
@@ -620,44 +840,35 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
}
return xRet;
}
+
/******************************************************************
* SwXTextTables
******************************************************************/
//SMART_UNO_IMPLEMENTATION( SwXTextTables, UsrObject );
-
-/*-- 13.01.99 12:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTables::SwXTextTables(SwDoc* pDc) :
SwUnoCollection(pDc)
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTables::~SwXTextTables()
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nRet = 0;
if(IsValid())
nRet = GetDoc()->GetTblFrmFmtCount(sal_True);
return nRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -675,13 +886,11 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -706,13 +915,11 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getElementNames(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(sal_True);
@@ -729,13 +936,11 @@ uno::Sequence< OUString > SwXTextTables::getElementNames(void)
}
return aSeq;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet= sal_False;
if(IsValid())
{
@@ -755,42 +960,32 @@ sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw uno::RuntimeException();
return bRet;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextTables::getElementType( )
throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextTable>*)0);
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return 0 != GetDoc()->GetTblFrmFmtCount(sal_True);
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName == C2U("com.sun.star.text.TextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -798,12 +993,10 @@ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( u
pArr[0] = C2U("com.sun.star.text.TextTables");
return aRet;
}
-/*-- 13.01.99 12:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwXTextTable* pTbl = (SwXTextTable*)SwClientIter( rFmt ).
First( TYPE( SwXTextTable ));
if( !pTbl )
@@ -811,7 +1004,6 @@ XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt )
return pTbl ;
}
-
/******************************************************************
* SwXFrameEnumeration
******************************************************************/
@@ -875,7 +1067,7 @@ namespace
: public SwSimpleEnumeration_Base
{
private:
- typedef ::std::slist< Any > frmcontainer_t;
+ typedef ::std::list< Any > frmcontainer_t;
frmcontainer_t m_aFrames;
protected:
virtual ~SwXFrameEnumeration() {};
@@ -897,7 +1089,7 @@ template<FlyCntType T>
SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc)
: m_aFrames()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwSpzFrmFmts* const pFmts = pDoc->GetSpzFrmFmts();
if(!pFmts->Count())
return;
@@ -929,14 +1121,14 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc)
template<FlyCntType T>
sal_Bool SwXFrameEnumeration<T>::hasMoreElements(void) throw( RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return !m_aFrames.empty();
}
template<FlyCntType T>
Any SwXFrameEnumeration<T>::nextElement(void) throw( NoSuchElementException, WrappedTargetException, RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_aFrames.empty())
throw NoSuchElementException();
Any aResult = *m_aFrames.begin();
@@ -990,7 +1182,7 @@ SwXFrames::~SwXFrames()
uno::Reference<container::XEnumeration> SwXFrames::createEnumeration(void) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
switch(eType)
@@ -1011,7 +1203,7 @@ uno::Reference<container::XEnumeration> SwXFrames::createEnumeration(void) throw
sal_Int32 SwXFrames::getCount(void) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetFlyCount(eType);
@@ -1020,7 +1212,7 @@ sal_Int32 SwXFrames::getCount(void) throw(uno::RuntimeException)
uno::Any SwXFrames::getByIndex(sal_Int32 nIndex)
throw(IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
if(nIndex < 0 || nIndex >= USHRT_MAX)
@@ -1034,7 +1226,7 @@ uno::Any SwXFrames::getByIndex(sal_Int32 nIndex)
uno::Any SwXFrames::getByName(const OUString& rName)
throw(NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const SwFrmFmt* pFmt;
@@ -1057,7 +1249,7 @@ uno::Any SwXFrames::getByName(const OUString& rName)
uno::Sequence<OUString> SwXFrames::getElementNames(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const Reference<XEnumeration> xEnum = createEnumeration();
@@ -1074,7 +1266,7 @@ uno::Sequence<OUString> SwXFrames::getElementNames(void) throw( uno::RuntimeExce
sal_Bool SwXFrames::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
switch(eType)
@@ -1090,7 +1282,7 @@ sal_Bool SwXFrames::hasByName(const OUString& rName) throw( uno::RuntimeExceptio
uno::Type SAL_CALL SwXFrames::getElementType() throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
switch(eType)
{
case FLYCNTTYPE_FRM:
@@ -1106,7 +1298,7 @@ uno::Type SAL_CALL SwXFrames::getElementType() throw(uno::RuntimeException)
sal_Bool SwXFrames::hasElements(void) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetFlyCount(eType) > 0;
@@ -1132,23 +1324,16 @@ SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType)
/******************************************************************
* SwXTextFrames
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextFrames");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextFrames") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1156,16 +1341,12 @@ Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( Runtim
pArray[0] = C2U("com.sun.star.text.TextFrames");
return aRet;
}
-/*-- 14.01.99 08:06:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::SwXTextFrames(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_FRM)
{
}
-/*-- 14.01.99 08:06:17---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::~SwXTextFrames()
{
}
@@ -1174,24 +1355,16 @@ SwXTextFrames::~SwXTextFrames()
* SwXTextGraphicObjects
******************************************************************/
//SMART_UNO_IMPLEMENTATION( SwXTextGraphicObjects, UsrObject );
-
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextGraphicObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1199,16 +1372,12 @@ Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.TextGraphicObjects");
return aRet;
}
-/*-- 14.01.99 08:45:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::SwXTextGraphicObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_GRF)
{
}
-/*-- 14.01.99 08:45:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::~SwXTextGraphicObjects()
{
}
@@ -1216,23 +1385,16 @@ SwXTextGraphicObjects::~SwXTextGraphicObjects()
/******************************************************************
* SwXTextEmbeddedObjects
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextEmbeddedObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1240,41 +1402,28 @@ Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextEmbeddedObjects");
return aRet;
}
-/*-- 14.01.99 08:45:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::SwXTextEmbeddedObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_OLE)
{
}
-/*-- 14.01.99 08:45:31---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects()
{
}
-/******************************************************************
- *
- ******************************************************************/
#define PASSWORD_STD_TIMEOUT 1000
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextSections");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextSections") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1282,25 +1431,19 @@ Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( Runt
pArray[0] = C2U("com.sun.star.text.TextSections");
return aRet;
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::SwXTextSections(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::~SwXTextSections()
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const SwSectionFmts& rSectFmts = GetDoc()->GetSections();
@@ -1312,13 +1455,11 @@ sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< XTextSection > xRet;
if(IsValid())
{
@@ -1347,13 +1488,11 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return makeAny(xRet);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByName(const OUString& Name)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -1378,13 +1517,11 @@ uno::Any SwXTextSections::getByName(const OUString& Name)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextSections::getElementNames(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
sal_uInt16 nCount = GetDoc()->GetSections().Count();
@@ -1413,13 +1550,11 @@ uno::Sequence< OUString > SwXTextSections::getElementNames(void)
}
return aSeq;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasByName(const OUString& Name)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
String aName(Name);
if(IsValid())
@@ -1443,19 +1578,15 @@ sal_Bool SwXTextSections::hasByName(const OUString& Name)
}
return bRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTextSections::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextSection>*)0);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt16 nCount = 0;
if(IsValid())
{
@@ -1466,9 +1597,7 @@ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return nCount > 0;
}
-/*-- 14.01.99 09:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt )
{
return SwXTextSection::CreateXTextSection(&rFmt);
@@ -1476,18 +1605,18 @@ uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt )
OUString SwXBookmarks::getImplementationName(void) throw( RuntimeException )
{
- return OUString::createFromAscii("SwXBookmarks");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("SwXBookmarks"));
}
sal_Bool SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
- return OUString::createFromAscii("com.sun.star.text.Bookmarks") == rServiceName;
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmarks")) == rServiceName;
}
Sequence< OUString > SwXBookmarks::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii("com.sun.star.text.Bookmarks");
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmarks"));
return aRet;
}
@@ -1501,24 +1630,24 @@ SwXBookmarks::~SwXBookmarks()
sal_Int32 SwXBookmarks::getCount(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
- return GetDoc()->getIDocumentMarkAccess()->getBookmarksCount();
+ return GetDoc()->getIDocumentMarkAccess()->getMarksCount();
}
uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
- if(nIndex < 0 || nIndex >= pMarkAccess->getBookmarksCount())
+ if(nIndex < 0 || nIndex >= pMarkAccess->getMarksCount())
throw IndexOutOfBoundsException();
uno::Any aRet;
- ::sw::mark::IMark* pBkmk = pMarkAccess->getBookmarksBegin()[nIndex].get();
+ ::sw::mark::IMark* pBkmk = pMarkAccess->getMarksBegin()[nIndex].get();
const uno::Reference< text::XTextContent > xRef =
SwXBookmark::CreateXBookmark(*GetDoc(), *pBkmk);
aRet <<= xRef;
@@ -1528,13 +1657,13 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex)
uno::Any SwXBookmarks::getByName(const rtl::OUString& rName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
- IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark(rName);
- if(ppBkmk == pMarkAccess->getBookmarksEnd())
+ IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark(rName);
+ if(ppBkmk == pMarkAccess->getMarksEnd())
throw NoSuchElementException();
uno::Any aRet;
@@ -1547,15 +1676,15 @@ uno::Any SwXBookmarks::getByName(const rtl::OUString& rName)
uno::Sequence< OUString > SwXBookmarks::getElementNames(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
- uno::Sequence<OUString> aSeq(pMarkAccess->getBookmarksCount());
+ uno::Sequence<OUString> aSeq(pMarkAccess->getMarksCount());
sal_Int32 nCnt = 0;
- for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
- ppMark != pMarkAccess->getBookmarksEnd();)
+ for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
+ ppMark != pMarkAccess->getMarksEnd();)
aSeq[nCnt++] = (*ppMark++)->GetName();
return aSeq;
}
@@ -1563,12 +1692,12 @@ uno::Sequence< OUString > SwXBookmarks::getElementNames(void)
sal_Bool SwXBookmarks::hasByName(const OUString& rName)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
- return pMarkAccess->findBookmark(rName) != pMarkAccess->getBookmarksEnd();
+ return pMarkAccess->findMark(rName) != pMarkAccess->getMarksEnd();
}
uno::Type SAL_CALL SwXBookmarks::getElementType()
@@ -1580,16 +1709,12 @@ uno::Type SAL_CALL SwXBookmarks::getElementType()
sal_Bool SwXBookmarks::hasElements(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->getIDocumentMarkAccess()->getBookmarksCount() != 0;
}
-/******************************************************************
- *
- ******************************************************************/
-
SwXNumberingRulesCollection::SwXNumberingRulesCollection( SwDoc* _pDoc ) :
SwUnoCollection(_pDoc)
{
@@ -1601,7 +1726,7 @@ SwXNumberingRulesCollection::~SwXNumberingRulesCollection()
sal_Int32 SwXNumberingRulesCollection::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetNumRuleTbl().Count();
@@ -1610,7 +1735,7 @@ sal_Int32 SwXNumberingRulesCollection::getCount(void) throw( uno::RuntimeExcepti
uno::Any SwXNumberingRulesCollection::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -1636,29 +1761,22 @@ uno::Type SAL_CALL SwXNumberingRulesCollection::getElementType() throw(uno::Runt
sal_Bool SwXNumberingRulesCollection::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetNumRuleTbl().Count() > 0;
}
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXFootnotes");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.Footnotes") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1666,26 +1784,20 @@ Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( Runtime
pArray[0] = C2U("com.sun.star.text.Footnotes");
return aRet;
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::SwXFootnotes(sal_Bool bEnd, SwDoc* _pDoc)
: SwUnoCollection(_pDoc)
, m_bEndnote(bEnd)
{
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::~SwXFootnotes()
{
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
sal_Int32 nCount = 0;
@@ -1701,20 +1813,18 @@ sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
- sal_Int32 nCount = 0;
if(IsValid())
{
sal_uInt16 n, nFtnCnt = GetDoc()->GetFtnIdxs().Count();
SwTxtFtn* pTxtFtn;
uno::Reference< XFootnote > xRef;
+ sal_Int32 nCount = 0;
for( n = 0; n < nFtnCnt; ++n )
{
pTxtFtn = GetDoc()->GetFtnIdxs()[ n ];
@@ -1737,51 +1847,35 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXFootnotes::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XFootnote>*)0);
}
-/*-- 14.01.99 09:03:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetFtnIdxs().Count() > 0;
}
-/* -----------------------------05.09.00 12:48--------------------------------
- ---------------------------------------------------------------------------*/
Reference<XFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt )
{
return SwXFootnote::CreateXFootnote(rDoc, rFmt);
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXReferenceMarks");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.ReferenceMarks") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1789,36 +1883,28 @@ Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( Ru
pArray[0] = C2U("com.sun.star.text.ReferenceMarks");
return aRet;
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::SwXReferenceMarks(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::~SwXReferenceMarks()
{
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(!IsValid())
throw uno::RuntimeException();
@@ -1836,13 +1922,11 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw IndexOutOfBoundsException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -1859,12 +1943,10 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence<OUString> aRet;
if(IsValid())
{
@@ -1879,47 +1961,36 @@ uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::R
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMark( rName);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXReferenceMarks::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextContent>*)0);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwXReferenceMark::CreateXReferenceMark(*pDoc, *pMark);
}
-/******************************************************************
- *
- ******************************************************************/
-/*-----------------11.03.98 11:18-------------------
+/*--------------------------------------------------
Gueltigkeitspruefung
--------------------------------------------------*/
void SwUnoCollection::Invalidate()
@@ -1928,3 +1999,4 @@ void SwUnoCollection::Invalidate()
pDoc = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index ea8f94600272..ad9c05593c95 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,9 +87,7 @@
#include <comphelper/sequenceashashmap.hxx>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
-// --> OD 2008-11-26 #158694#
#include <SwNodeNum.hxx>
-// <--
#include <fmtmeta.hxx>
@@ -101,7 +100,6 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using ::rtl::OUString;
-
namespace SwUnoCursorHelper
{
@@ -135,9 +133,8 @@ GetNestedTextContent(SwTxtNode & rTextNode, xub_StrLen const nIndex,
return xRet;
}
-
-/* -----------------16.09.98 12:27-------------------
-* Lesen spezieller Properties am Cursor
+/* --------------------------------------------------
+ * Read the special properties of the cursor
* --------------------------------------------------*/
sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
, SwPaM& rPam
@@ -151,7 +148,6 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
sal_Bool bDone = sal_True;
switch(rEntry.nWID)
{
- // --> OD 2008-11-26 #158694#
case FN_UNO_PARA_CONT_PREV_SUBTREE:
if (pAny)
{
@@ -189,24 +185,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= OUString(sRet);
}
break;
- // <--
- // --> OD 2008-05-20 #outlinelevel# - no longer needed
-// case FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL:
-// if (pAny)
-// {
-// const SwTxtNode * pTmpNode = pNode;
-
-// if (!pTmpNode)
-// pTmpNode = rPam.GetNode()->GetTxtNode();
-
-// sal_Int8 nRet = -1;
-// if (pTmpNode && pTmpNode->GetOutlineLevel() != NO_NUMBERING)
-// nRet = sal::static_int_cast< sal_Int8 >(pTmpNode->GetOutlineLevel());
-// *pAny <<= nRet;
-// }
-// break;
- // <--
- case RES_PARATR_OUTLINELEVEL: //#outlinelevel added by zhaojianwei
+ case RES_PARATR_OUTLINELEVEL:
if (pAny)
{
const SwTxtNode * pTmpNode = pNode;
@@ -220,7 +199,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= nRet;
}
- break; //<-end,zhaojianwei
+ break;
case FN_UNO_PARA_CONDITIONAL_STYLE_NAME:
case FN_UNO_PARA_STYLE :
{
@@ -265,16 +244,13 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
break;
case FN_UNO_NUM_LEVEL :
case FN_UNO_IS_NUMBER :
- // --> OD 2008-07-14 #i91601#
+ // #i91601#
case FN_UNO_LIST_ID:
- // <--
case FN_NUMBER_NEWSTART:
{
// a multi selection is not considered
const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
- // --> OD 2010-01-13 #b6912256#
if ( pTxtNd && pTxtNd->IsInList() )
- // <--
{
if( pAny )
{
@@ -285,13 +261,12 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
sal_Bool bIsNumber = pTxtNd->IsCountedInList();
pAny->setValue(&bIsNumber, ::getBooleanCppuType());
}
- // --> OD 2008-07-14 #i91601#
+ // #i91601#
else if ( rEntry.nWID == FN_UNO_LIST_ID )
{
const String sListId = pTxtNd->GetListId();
*pAny <<= OUString(sListId);
}
- // <--
else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
{
sal_Bool bIsRestart = pTxtNd->IsListRestart();
@@ -310,7 +285,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
*pAny <<= static_cast<sal_Int16>( 0 );
else if(rEntry.nWID == FN_UNO_IS_NUMBER)
*pAny <<= false;
- // --> OD 2008-07-14 #i91601#
+ // #i91601#
else if ( rEntry.nWID == FN_UNO_LIST_ID )
{
*pAny <<= OUString();
@@ -351,7 +326,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
}
}
else
- //auch hier - nicht zu unterscheiden
+ //also here - indistinguishable
eNewState = PropertyState_DEFAULT_VALUE;
}
break;
@@ -395,16 +370,6 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
eNewState = PropertyState_DEFAULT_VALUE;
}
break;
-/* laesst sich nicht feststellen
-* case FN_UNO_BOOKMARK:
- {
- if()
- {
- uno::Reference< XBookmark > xBkm = SwXBookmarks::GetObject(rBkm);
- rAny.set(&xBkm, ::getCppuType((const XBookmark*)0)());
- }
- }
- break;*/
case FN_UNO_TEXT_TABLE:
case FN_UNO_CELL:
{
@@ -591,20 +556,17 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
}
break;
case RES_TXTATR_CHARFMT:
- // kein break hier!
+ // no break here!
default: bDone = sal_False;
}
if( bDone )
eState = eNewState;
return bDone;
};
-/* -----------------30.06.98 10:30-------------------
- *
- * --------------------------------------------------*/
+
sal_Int16 IsNodeNumStart(SwPaM& rPam, PropertyState& eState)
{
const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode();
- // --> OD 2008-02-28 #refactorlists#
// correction: check, if restart value is set at the text node and use
// new method <SwTxtNode::GetAttrListRestartValue()> to retrieve the value
if ( pTxtNd && pTxtNd->GetNumRule() && pTxtNd->IsListRestart() &&
@@ -614,14 +576,10 @@ sal_Int16 IsNodeNumStart(SwPaM& rPam, PropertyState& eState)
sal_Int16 nTmp = sal::static_int_cast< sal_Int16 >(pTxtNd->GetAttrListRestartValue());
return nTmp;
}
- // <--
eState = PropertyState_DEFAULT_VALUE;
return -1;
}
-/* -----------------25.05.98 11:41-------------------
- *
- * --------------------------------------------------*/
void setNumberingProperty(const Any& rValue, SwPaM& rPam)
{
uno::Reference<XIndexReplace> xIndexReplace;
@@ -656,7 +614,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
else
{
- // CharStyle besorgen und an der Rule setzen
+ // get CharStyle and set the rule
sal_uInt16 nChCount = pDoc->GetCharFmts()->Count();
SwCharFmt* pCharFmt = 0;
for(sal_uInt16 nCharFmt = 0; nCharFmt < nChCount; nCharFmt++)
@@ -674,7 +632,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
SfxStyleSheetBasePool* pPool = pDoc->GetDocShell()->GetStyleSheetPool();
SfxStyleSheetBase* pBase;
pBase = pPool->Find(pNewCharStyles[i], SFX_STYLE_FAMILY_CHAR);
- // soll das wirklich erzeugt werden?
+ // shall it really be created?
if(!pBase)
pBase = &pPool->Make(pNewCharStyles[i], SFX_STYLE_FAMILY_PAGE);
pCharFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt();
@@ -683,7 +641,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
aFmt.SetCharFmt(pCharFmt);
}
}
- //jetzt nochmal fuer Fonts
+ //Now again for fonts
if(
pBulletFontNames[i] != SwXNumberingRules::GetInvalidStyle() &&
(
@@ -707,26 +665,22 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
}
UnoActionContext aAction(pDoc);
- if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
+ if( rPam.GetNext() != &rPam ) // Multiple selection?
{
pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
SwPaM aPam( *rPam.GetPoint() );
for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n )
{
- // --> OD 2008-03-17 #refactorlists#
// no start of a new list
pDoc->SetNumRule( aRangeArr.SetPam( n, aPam ), aRule, false );
- // <--
}
pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
else
{
- // --> OD 2008-03-17 #refactorlists#
// no start of a new list
pDoc->SetNumRule( rPam, aRule, false );
- // <--
}
@@ -737,12 +691,10 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
SwNumRule* pRule = pDoc->FindNumRulePtr( pSwNum->GetCreatedNumRuleName() );
if(!pRule)
throw RuntimeException();
- // --> OD 2008-03-17 #refactorlists#
// no start of a new list
pDoc->SetNumRule( rPam, *pRule, false );
- // <--
}
- // --> OD 2009-08-18 #i103817#
+ // #i103817#
// outline numbering
else
{
@@ -752,7 +704,6 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
throw RuntimeException();
pDoc->SetNumRule( rPam, *pRule, false );
}
- // <--
}
}
else if(rValue.getValueType() == ::getVoidCppuType())
@@ -761,10 +712,6 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
}
}
-
-/* -----------------25.05.98 11:40-------------------
- *
- * --------------------------------------------------*/
void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny )
{
const SwNumRule* pNumRule = rPam.GetDoc()->GetCurrNumRule( *rPam.GetPoint() );
@@ -778,17 +725,16 @@ void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny )
else
eState = PropertyState_DEFAULT_VALUE;
}
-/* -----------------04.07.98 15:15-------------------
- *
- * --------------------------------------------------*/
+
void GetCurPageStyle(SwPaM& rPaM, String &rString)
{
const SwPageFrm* pPage = rPaM.GetCntntNode()->GetFrm()->FindPageFrm();
if(pPage)
SwStyleNameMapper::FillProgName( pPage->GetPageDesc()->GetName(), rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
}
-/* -----------------30.03.99 10:52-------------------
- * spezielle Properties am Cursor zuruecksetzen
+
+/* --------------------------------------------------
+ * reset special properties of the cursor
* --------------------------------------------------*/
void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPam)
{
@@ -804,7 +750,7 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa
{
UnoActionContext aAction(pDoc);
- if( rPam.GetNext() != &rPam ) // Mehrfachselektion ?
+ if( rPam.GetNext() != &rPam ) // Multiple selection?
{
pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( rPam );
@@ -832,9 +778,7 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa
break;
}
}
-/* -----------------21.07.98 11:36-------------------
- *
- * --------------------------------------------------*/
+
void InsertFile(SwUnoCrsr* pUnoCrsr,
const String& rURL,
const uno::Sequence< beans::PropertyValue >& rOptions
@@ -940,8 +884,8 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
SfxObjectShellRef aRef( pDocSh );
pDocSh->RegisterTransfer( *pMed );
- pMed->DownLoad(); // ggfs. den DownLoad anstossen
- if( aRef.Is() && 1 < aRef->GetRefCount() ) // noch gueltige Ref?
+ pMed->DownLoad(); // if necessary: start the download
+ if( aRef.Is() && 1 < aRef->GetRefCount() ) // Ref still valid?
{
SwReader* pRdr;
SfxItemSet* pSet = pMed->GetItemSet();
@@ -960,7 +904,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
SwNodeIndex aSave( pUnoCrsr->GetPoint()->nNode, -1 );
xub_StrLen nCntnt = pUnoCrsr->GetPoint()->nContent.GetIndex();
- sal_uInt32 nErrno = pRdr->Read( *pRead ); // und Dokument einfuegen
+ sal_uInt32 nErrno = pRdr->Read( *pRead ); // and paste the document
if(!nErrno)
{
@@ -976,23 +920,12 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
delete pRdr;
- // ggfs. alle Verzeichnisse updaten:
-/* if( pWrtShell->IsUpdateTOX() )
- {
- SfxRequest aReq( *this, FN_UPDATE_TOX );
- Execute( aReq );
- pWrtShell->SetUpdateTOX( sal_False ); // wieder zurueck setzen
- }*/
}
}
delete pMed;
}
-/* -----------------14.07.04 ------------------------
- *
- * --------------------------------------------------*/
-
// insert text and scan for CR characters in order to insert
// paragraph breaks at those positions by calling SplitNode
sal_Bool DocInsertStringSplitCR(
@@ -1031,12 +964,12 @@ sal_Bool DocInsertStringSplitCR(
if (aTxt.getLength() &&
!rDoc.InsertString( rNewCursor, aTxt, nInsertFlags ))
{
- DBG_ERROR( "Doc->Insert(Str) failed." );
+ OSL_FAIL( "Doc->Insert(Str) failed." );
bOK = sal_False;
}
if (!rDoc.SplitNode( *rNewCursor.GetPoint(), false ) )
{
- DBG_ERROR( "SplitNode failed" );
+ OSL_FAIL( "SplitNode failed" );
bOK = sal_False;
}
nStartIdx = nIdx + 1;
@@ -1046,15 +979,13 @@ sal_Bool DocInsertStringSplitCR(
if (aTxt.getLength() &&
!rDoc.InsertString( rNewCursor, aTxt, nInsertFlags ))
{
- DBG_ERROR( "Doc->Insert(Str) failed." );
+ OSL_FAIL( "Doc->Insert(Str) failed." );
bOK = sal_False;
}
return bOK;
}
-/*-- 10.03.2008 09:58:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void makeRedline( SwPaM& rPaM,
const ::rtl::OUString& rRedlineType,
const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
@@ -1075,7 +1006,7 @@ void makeRedline( SwPaM& rPaM,
//todo: what about REDLINE_FMTCOLL?
comphelper::SequenceAsHashMap aPropMap( rRedlineProperties );
uno::Any aAuthorValue;
- aAuthorValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("RedlineAuthor"), aAuthorValue);
+ aAuthorValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RedlineAuthor")), aAuthorValue);
sal_uInt16 nAuthor = 0;
::rtl::OUString sAuthor;
if( aAuthorValue >>= sAuthor )
@@ -1083,7 +1014,7 @@ void makeRedline( SwPaM& rPaM,
::rtl::OUString sComment;
uno::Any aCommentValue;
- aCommentValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("RedlineComment"), aCommentValue);
+ aCommentValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RedlineComment")), aCommentValue);
SwRedlineData aRedlineData( eType, nAuthor );
if( aCommentValue >>= sComment )
@@ -1091,7 +1022,7 @@ void makeRedline( SwPaM& rPaM,
::util::DateTime aStamp;
uno::Any aDateTimeValue;
- aDateTimeValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("RedlineDateTime"), aDateTimeValue);
+ aDateTimeValue = aPropMap.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RedlineDateTime")), aDateTimeValue);
if( aDateTimeValue >>= aStamp )
{
aRedlineData.SetTimeStamp(
@@ -1108,9 +1039,6 @@ void makeRedline( SwPaM& rPaM,
throw lang::IllegalArgumentException();
}
-/*-- 19.02.2009 09:27:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwAnyMapHelper::~SwAnyMapHelper()
{
AnyMapHelper_t::iterator aIt = begin();
@@ -1120,9 +1048,7 @@ SwAnyMapHelper::~SwAnyMapHelper()
++aIt;
}
}
-/*-- 19.02.2009 09:27:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rAny )
{
sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
@@ -1134,9 +1060,7 @@ void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const
else
insert( value_type(nKey, new uno::Any( rAny )) );
}
-/*-- 19.02.2009 09:27:26---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& pAny )
{
bool bRet = false;
@@ -1152,3 +1076,4 @@ bool SwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, co
}//namespace SwUnoCursorHelper
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 2a2e1e497d13..8e02bfce696d 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,14 +62,14 @@
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmtsrnd.hxx>
-// OD 2004-04-21 #i26791#
+// #i26791#
#include <fmtfollowtextflow.hxx>
#include <rootfrm.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <svx/shapepropertynotifier.hxx>
#include <crstate.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/stl_types.hxx>
#include <comphelper/makesequence.hxx>
@@ -85,7 +86,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <com/sun/star/drawing/PointSequence.hpp>
#include <vcl/svapp.hxx>
-#include <slist>
+#include <list>
#include <iterator>
using ::rtl::OUString;
@@ -95,9 +96,6 @@ DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, SwShapeImplementati
static SwShapeImplementationIdMap aImplementationIdMap;
-/* -----------------22.01.99 13:19-------------------
- *
- * --------------------------------------------------*/
class SwShapeDescriptor_Impl
{
SwFmtHoriOrient* pHOrient;
@@ -108,37 +106,33 @@ class SwShapeDescriptor_Impl
SvxLRSpaceItem* pLRSpace;
sal_Bool bOpaque;
uno::Reference< text::XTextRange > xTextRange;
- // OD 2004-04-21 #i26791#
+ // #i26791#
SwFmtFollowTextFlow* mpFollowTextFlow;
- // OD 2004-05-05 #i28701# - add property 'WrapInfluenceOnObjPos'
+ // #i28701#
SwFmtWrapInfluenceOnObjPos* pWrapInfluenceOnObjPos;
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
sal_Int16 mnPositionLayoutDir;
- // <--
public:
bool bInitializedPropertyNotifier;
public:
SwShapeDescriptor_Impl() :
- // --> OD 2004-08-18 #i32349# - no defaults, in order to determine on
+ // #i32349# - no defaults, in order to determine on
// adding a shape, if positioning attributes are set or not.
pHOrient( 0L ),
pVOrient( 0L ),
- // <--
pAnchor(0),
pSurround(0),
pULSpace(0),
pLRSpace(0),
bOpaque(sal_False),
- // OD 2004-04-21 #i26791#
+ // #i26791#
mpFollowTextFlow( new SwFmtFollowTextFlow( sal_False ) ),
- // OD 2004-05-05 #i28701#
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i28701# #i35017#
pWrapInfluenceOnObjPos( new SwFmtWrapInfluenceOnObjPos(
text::WrapInfluenceOnPosition::ONCE_CONCURRENT ) ),
- // <--
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
mnPositionLayoutDir( text::PositionLayoutDir::PositionInLayoutDirOfAnchor ),
bInitializedPropertyNotifier(false)
{}
@@ -151,9 +145,9 @@ public:
delete pSurround;
delete pULSpace;
delete pLRSpace;
- // OD 2004-04-22 #i26791#
+ // #i26791#
delete mpFollowTextFlow;
- // OD 2004-05-05 #i28701#
+ // #i28701#
delete pWrapInfluenceOnObjPos;
}
SwFmtAnchor* GetAnchor(sal_Bool bCreate = sal_False)
@@ -168,7 +162,7 @@ public:
{
if (bCreate && !pHOrient)
{
- // OD 2004-06-03 #i26791# - change default
+ // #i26791#
pHOrient = new SwFmtHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
}
return pHOrient;
@@ -177,7 +171,7 @@ public:
{
if(bCreate && !pVOrient)
{
- // OD 2004-04-21 #i26791# - change default
+ // #i26791#
pVOrient = new SwFmtVertOrient( 0, text::VertOrientation::NONE, text::RelOrientation::FRAME );
}
return pVOrient;
@@ -205,11 +199,11 @@ public:
{
return xTextRange;
}
- sal_Bool IsOpaque()
+ sal_Bool IsOpaque() const
{
return bOpaque;
}
- const sal_Bool& GetOpaque()
+ const sal_Bool& GetOpaque() const
{
return bOpaque;
}
@@ -221,7 +215,7 @@ public:
void RemoveLRSpace(){DELETEZ(pLRSpace);}
void SetOpaque(sal_Bool bSet){bOpaque = bSet;}
- // OD 2004-04-21 #i26791#
+ // #i26791#
SwFmtFollowTextFlow* GetFollowTextFlow( sal_Bool _bCreate = sal_False )
{
if ( _bCreate && !mpFollowTextFlow )
@@ -233,7 +227,7 @@ public:
DELETEZ(mpFollowTextFlow);
}
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
sal_Int16 GetPositionLayoutDir() const
{
return mnPositionLayoutDir;
@@ -250,7 +244,7 @@ public:
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwShapeDescriptor_Impl::SetPositionLayoutDir(..)> - invalid attribute value." );
}
}
@@ -259,18 +253,16 @@ public:
{
mnPositionLayoutDir = text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
}
- // <--
- // OD 2004-05-05 #i28701#
+ // #i28701#
inline SwFmtWrapInfluenceOnObjPos* GetWrapInfluenceOnObjPos(
const sal_Bool _bCreate = sal_False )
{
if ( _bCreate && !pWrapInfluenceOnObjPos )
{
pWrapInfluenceOnObjPos = new SwFmtWrapInfluenceOnObjPos(
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017#
text::WrapInfluenceOnPosition::ONCE_CONCURRENT );
- // <--
}
return pWrapInfluenceOnObjPos;
}
@@ -279,63 +271,47 @@ public:
DELETEZ(pWrapInfluenceOnObjPos);
}
};
+
/****************************************************************************
class SwFmDrawPage
****************************************************************************/
-
-/* -----------------28.01.99 12:03-------------------
- *
- * --------------------------------------------------*/
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
SvxFmDrawPage( pPage ), pPageView(0)
{
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwFmDrawPage::~SwFmDrawPage() throw ()
{
RemovePageView();
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
- -----------------------------------------------------------------------*/
const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
{
_SelectObjectsInView( xShapes, GetPageView() );
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
return rMarkList;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup)
{
uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY);
_SelectObjectInView( xShape, GetPageView() );
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrPageView* SwFmDrawPage::GetPageView()
{
if(!pPageView)
pPageView = mpView->ShowSdrPage( mpPage );
return pPageView;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::RemovePageView()
{
if(pPageView && mpView)
mpView->HideSdrPage();
pPageView = 0;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj )
{
uno::Reference< XInterface > xShape;
@@ -353,17 +329,12 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj
}
return xShape;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) throw ()
{
//TODO: stimmt das so - kann die Methode weg?
return SvxFmDrawPage::_CreateSdrObject( xShape );
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) const throw ()
{
@@ -392,7 +363,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj )
}
else
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwFmDrawPage::_CreateShape(..)> - could not retrieve type. Thus, no shape created." );
return xRet;
}
@@ -438,7 +409,7 @@ namespace
: public SwSimpleEnumeration_Base
{
private:
- typedef ::std::slist< ::com::sun::star::uno::Any > shapescontainer_t;
+ typedef ::std::list< ::com::sun::star::uno::Any > shapescontainer_t;
shapescontainer_t m_aShapes;
protected:
virtual ~SwXShapesEnumeration() {};
@@ -459,7 +430,7 @@ namespace
SwXShapesEnumeration::SwXShapesEnumeration(SwXDrawPage* const pDrawPage)
: m_aShapes()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
::std::insert_iterator<shapescontainer_t> pInserter = ::std::insert_iterator<shapescontainer_t>(m_aShapes, m_aShapes.begin());
sal_Int32 nCount = pDrawPage->getCount();
for(sal_Int32 nIdx = 0; nIdx < nCount; nIdx++)
@@ -471,13 +442,13 @@ SwXShapesEnumeration::SwXShapesEnumeration(SwXDrawPage* const pDrawPage)
sal_Bool SwXShapesEnumeration::hasMoreElements(void) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return !m_aShapes.empty();
}
uno::Any SwXShapesEnumeration::nextElement(void) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(m_aShapes.empty())
throw container::NoSuchElementException();
uno::Any aResult = *m_aShapes.begin();
@@ -499,32 +470,27 @@ uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames(void) t
{
return ::comphelper::makeSequence(C2U("com.sun.star.container.XEnumeration"));
}
+
/****************************************************************************
class SwXDrawPage
****************************************************************************/
uno::Reference< container::XEnumeration > SwXDrawPage::createEnumeration(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return uno::Reference< container::XEnumeration >(
new SwXShapesEnumeration(this));
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXDrawPage");
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName;
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aRet(1);
@@ -532,17 +498,13 @@ uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.drawing.GenericDrawPage");
return aRet;
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::SwXDrawPage(SwDoc* pDc) :
pDoc(pDc),
pDrawPage(0)
{
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::~SwXDrawPage()
{
if(xPageAgg.is())
@@ -551,9 +513,7 @@ SwXDrawPage::~SwXDrawPage()
xPageAgg->setDelegator(xInt);
}
}
-/* -----------------------------15.06.00 15:00--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException )
{
@@ -573,9 +533,7 @@ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
}
return aRet;
}
-/* -----------------------------15.06.00 15:01--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException )
{
uno::Sequence< uno::Type > aPageTypes = SwXDrawPageBaseClass::getTypes();
@@ -594,12 +552,10 @@ uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException
pPageTypes[nIndex] = ::getCppuType((uno::Reference<form::XFormsSupplier2>*)0);
return aPageTypes;
}
-/*-- 22.01.99 11:33:44---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
if(!pDoc->GetDrawModel())
@@ -610,14 +566,12 @@ sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
return pDrawPage->getCount();
}
}
-/*-- 22.01.99 11:33:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
if(!pDoc->GetDrawModel())
@@ -626,19 +580,15 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
((SwXDrawPage*)this)->GetSvxPage();
return pDrawPage->getByIndex( nIndex );
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
uno::Type SwXDrawPage::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<drawing::XShape>*)0);
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
if(!pDoc->GetDrawModel())
@@ -647,13 +597,10 @@ sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
return ((SwXDrawPage*)this)->GetSvxPage()->hasElements();
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShape, uno::UNO_QUERY);
@@ -677,7 +624,6 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
throw aExcept;
}
- // --> OD, HB
if ( pSvxShape->GetSdrObject() )
{
if ( pSvxShape->GetSdrObject()->IsInserted() )
@@ -685,7 +631,6 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
return;
}
}
- // <--
GetSvxPage()->add(xShape);
uno::Reference< uno::XAggregation > xAgg = pShape->GetAggregationInterface();
@@ -717,27 +662,25 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
if(pDesc->GetAnchor())
aAnchor = *pDesc->GetAnchor();
- // --> OD 2004-08-18 #i32349# - if no horizontal position exists, create one
+ // #i32349# - if no horizontal position exists, create one
if ( !pDesc->GetHOrient() )
{
SwFmtHoriOrient* pHori = pDesc->GetHOrient( sal_True );
SwTwips nHoriPos = MM100_TO_TWIP(aMM100Pos.X);
pHori->SetPos( nHoriPos );
}
- // <--
{
if(pDesc->GetHOrient()->GetHoriOrient() == text::HoriOrientation::NONE)
aMM100Pos.X = TWIP_TO_MM100(pDesc->GetHOrient()->GetPos());
aSet.Put( *pDesc->GetHOrient() );
}
- // --> OD 2004-08-18 #i32349# - if no vertical position exists, create one
+ // #i32349# - if no vertical position exists, create one
if ( !pDesc->GetVOrient() )
{
SwFmtVertOrient* pVert = pDesc->GetVOrient( sal_True );
SwTwips nVertPos = MM100_TO_TWIP(aMM100Pos.Y);
pVert->SetPos( nVertPos );
}
- // <--
{
if(pDesc->GetVOrient()->GetVertOrient() == text::VertOrientation::NONE)
aMM100Pos.Y = TWIP_TO_MM100(pDesc->GetVOrient()->GetPos());
@@ -748,13 +691,13 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
aSet.Put( *pDesc->GetSurround());
bOpaque = pDesc->IsOpaque();
- // OD 2004-04-22 #i26791#
+ // #i26791#
if ( pDesc->GetFollowTextFlow() )
{
aSet.Put( *pDesc->GetFollowTextFlow() );
}
- // OD 2004-05-05 #i28701#
+ // #i28701#
if ( pDesc->GetWrapInfluenceOnObjPos() )
{
aSet.Put( *pDesc->GetWrapInfluenceOnObjPos() );
@@ -763,7 +706,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
pSvxShape->setPosition(aMM100Pos);
SdrObject* pObj = pSvxShape->GetSdrObject();
- // OD 25.06.2003 #108784# - set layer of new drawing object to corresponding
+ // #108784# - set layer of new drawing object to corresponding
// invisible layer.
if(FmFormInventor != pObj->GetObjInventor())
pObj->SetLayer( bOpaque ? pDoc->GetInvisibleHeavenId() : pDoc->GetInvisibleHellId() );
@@ -798,14 +741,14 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
pDoc->GetRootFrm()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState );
aAnchor.SetAnchor( pPam->GetPoint() );
- // --> OD 2004-08-18 #i32349# - adjustment of vertical positioning
+ // #i32349# - adjustment of vertical positioning
// attributes no longer needed, because its already got a default.
}
else
{
aAnchor.SetType(FLY_AT_PAGE);
- // --> OD 2004-08-18 #i32349# - adjustment of vertical positioning
+ // #i32349# - adjustment of vertical positioning
// attributes no longer needed, because its already got a default.
}
aSet.Put(aAnchor);
@@ -822,23 +765,19 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
delete pPam;
delete pInternalPam;
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
uno::Reference<lang::XComponent> xComp(xShape, uno::UNO_QUERY);
xComp->dispose();
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< drawing::XShapes > & xShapes) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc || !xShapes.is())
throw uno::RuntimeException();
uno::Reference< drawing::XShapeGroup > xRet;
@@ -889,12 +828,10 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
}
return xRet;
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeGroup) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
if(xPageAgg.is())
@@ -915,17 +852,14 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
pPage->RemovePageView();
}
}
-/* -----------------05.05.98 17:05-------------------
- *
- * --------------------------------------------------*/
+
SwFmDrawPage* SwXDrawPage::GetSvxPage()
{
if(!xPageAgg.is() && pDoc)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- // --> OD 2005-08-08 #i52858# - method name changed
+ SolarMutexGuard aGuard;
+ // #i52858#
SdrModel* pModel = pDoc->GetOrCreateDrawModel();
- // <--
SdrPage* pPage = pModel->GetPage( 0 );
{
@@ -949,21 +883,14 @@ void SwXDrawPage::InvalidateSwDoc()
pDoc = 0;
}
-/****************************************************************************
-
-****************************************************************************/
TYPEINIT1(SwXShape, SwClient);
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -997,9 +924,6 @@ namespace
}
}
-/* -----------------01.02.99 11:38-------------------
- *
- * --------------------------------------------------*/
SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)),
m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)),
@@ -1015,11 +939,11 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
uno::Any aAgg = xShape->queryInterface(rAggType);
if(aAgg.getValueType() == rAggType)
xShapeAgg = *(uno::Reference< uno::XAggregation >*)aAgg.getValue();
- // --> OD 2004-07-23 #i31698#
+ // #i31698#
if ( xShapeAgg.is() )
{
xShapeAgg->queryAggregation( ::getCppuType((uno::Reference< drawing::XShape >*)0) ) >>= mxShape;
- ASSERT( mxShape.is(),
+ OSL_ENSURE( mxShape.is(),
"<SwXShape::SwXShape(..)> - no XShape found at <xShapeAgg>" );
}
// <--
@@ -1049,9 +973,6 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
}
}
-/*-- 09.04.09 15:06:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
{
SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS );
@@ -1086,9 +1007,6 @@ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXShape::~SwXShape()
{
if (xShapeAgg.is())
@@ -1098,13 +1016,11 @@ SwXShape::~SwXShape()
}
delete pImpl;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException )
{
uno::Any aRet = SwXShapeBaseClass::queryInterface(aType);
- // --> OD 2005-08-15 #i53320# - follow-up of #i31698#
+ // #i53320# - follow-up of #i31698#
// interface drawing::XShape is overloaded. Thus, provide
// correct object instance.
if(!aRet.hasValue() && xShapeAgg.is())
@@ -1114,12 +1030,9 @@ uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeE
else
aRet = xShapeAgg->queryAggregation(aType);
}
- // <--
return aRet;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aRet = SwXShapeBaseClass::getTypes();
@@ -1143,12 +1056,10 @@ uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
}
return aRet;
}
-/* -----------------------------04.04.01 07:37--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// do we need to compute the implementation id for this instance?
if( !pImplementationId && xShapeAgg.is())
{
@@ -1179,7 +1090,7 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeEx
}
if( NULL == pImplementationId )
{
- DBG_ERROR( "Could not create an implementation id for a SwXShape!" );
+ OSL_FAIL( "Could not create an implementation id for a SwXShape!" );
return uno::Sequence< sal_Int8 > ();
}
else
@@ -1187,12 +1098,10 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeEx
return *pImplementationId;
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< beans::XPropertySetInfo > aRet;
if(xShapeAgg.is())
{
@@ -1212,15 +1121,13 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th
aRet = m_pPropSet->getPropertySetInfo();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName );
if(xShapeAgg.is())
@@ -1271,7 +1178,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
- // OD 25.06.2003 #108784# - set layer of new drawing
+ // set layer of new drawing
// object to corresponding invisible layer.
bool bIsVisible = pDoc->IsVisibleLayerId( pObj->GetLayer() );
if(FmFormInventor != pObj->GetObjInventor())
@@ -1288,7 +1195,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
}
- // OD 2004-04-22 #i26791# - special handling for property FN_TEXT_RANGE
+ // #i26791# - special handling for property FN_TEXT_RANGE
else if ( FN_TEXT_RANGE == pEntry->nWID )
{
SwFmtAnchor aAnchor( static_cast<const SwFmtAnchor&>(aSet.Get( RES_ANCHOR )) );
@@ -1313,7 +1220,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
//To prevent this the connection between format and attribute has to be broken before.
const SwPosition *pPos = aAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(
@@ -1349,14 +1256,13 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
delete pInternalPam;
}
}
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
else if ( FN_SHAPE_POSITION_LAYOUT_DIR == pEntry->nWID )
{
sal_Int16 nPositionLayoutDir = 0;
aValue >>= nPositionLayoutDir;
pFmt->SetPositionLayoutDir( nPositionLayoutDir );
}
- // <--
else if( pDoc->GetRootFrm() )
{
UnoActionContext aCtx(pDoc);
@@ -1400,7 +1306,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
//To prevent this the connection between format and attribute has to be broken before.
const SwPosition *pPos = rOldAnchor.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
- ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
+ OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(
@@ -1495,19 +1401,19 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
case RES_OPAQUE :
pImpl->SetOpaque(*(sal_Bool*)aValue.getValue());
break;
- // OD 2004-04-22 #i26791#
+ // #i26791#
case RES_FOLLOW_TEXT_FLOW:
{
pItem = pImpl->GetFollowTextFlow( sal_True );
}
break;
- // OD 2004-05-05 #i28701#
+ // #i28701#
case RES_WRAP_INFLUENCE_ON_OBJPOS:
{
pItem = pImpl->GetWrapInfluenceOnObjPos( sal_True );
}
break;
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
case FN_SHAPE_POSITION_LAYOUT_DIR :
{
sal_Int16 nPositionLayoutDir = 0;
@@ -1515,7 +1421,6 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
pImpl->SetPositionLayoutDir( nPositionLayoutDir );
}
break;
- // <--
}
if(pItem)
((SfxPoolItem*)pItem)->PutValue(aValue, pEntry->nMemberId);
@@ -1530,7 +1435,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
if(aPSet.getValueType() != rPSetType || !aPSet.getValue())
throw uno::RuntimeException();
xPrSet = *(uno::Reference< beans::XPropertySet >*)aPSet.getValue();
- // --> OD 2004-08-05 #i31698# - setting the caption point of a
+ // #i31698# - setting the caption point of a
// caption object doesn't have to change the object position.
// Thus, keep the position, before the caption point is set and
// restore it afterwards.
@@ -1540,7 +1445,6 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
{
aKeepedPosition = getPosition();
}
- // <--
if( pFmt && pFmt->GetDoc()->GetRootFrm() )
{
UnoActionContext aCtx(pFmt->GetDoc());
@@ -1548,26 +1452,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
else
xPrSet->setPropertyValue(rPropertyName, aValue);
- // --> OD 2004-11-11 #i35007# - adjustment of the position
- // attributes, if the transformation is set, causes wrong alignments
- // and is no longer needed.
- // The position attributes are set, if the drawing object is added
- // to the draw page - see <SwXDrawPage::add(..)> - and on its first
- // positioning - see <SwAnchoredDrawObject::MakeObjPos().
-// // --> OD 2004-07-28 #i31698# - additionally adjust the position
-// // properties of the shape, if the transformation is set and
-// // the shape isn't a group member.
-// if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation"))) &&
-// !_GetTopGroupObj() )
-// {
-// drawing::HomogenMatrix3 aMatrix;
-// aValue >>= aMatrix;
-// awt::Point aNewPos( basegfx::fround( aMatrix.Line1.Column3 ),
-// basegfx::fround( aMatrix.Line2.Column3 ) );
-// _AdjustPositionProperties( aNewPos );
-// }
- // --> OD 2004-08-05 #i31698# - restore object position, if caption
- // point is set.
+ // #i31698# - restore object position, if caption point is set.
if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CaptionPoint"))) &&
getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"))) )
{
@@ -1576,14 +1461,12 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
}
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(xShapeAgg.is())
@@ -1600,7 +1483,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
- // OD 02.07.2003 #108784# - consider invisible layers
+ // consider invisible layers
sal_Bool bOpaque =
( pObj->GetLayer() != pFmt->GetDoc()->GetHellId() &&
pObj->GetLayer() != pFmt->GetDoc()->GetInvisibleHellId() );
@@ -1620,7 +1503,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
aRet.setValue(&aPoint, ::getCppuType( (awt::Point*)0 ));
}
}
- // OD 2004-04-22 #i26791# - special handling for FN_TEXT_RANGE
+ // #i26791# - special handling for FN_TEXT_RANGE
else if ( FN_TEXT_RANGE == pEntry->nWID )
{
const SwFmtAnchor aAnchor = pFmt->GetAnchor();
@@ -1650,7 +1533,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
}
}
}
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
else if ( FN_SHAPE_TRANSFORMATION_IN_HORI_L2R == pEntry->nWID )
{
// get property <::drawing::Shape::Transformation>
@@ -1661,8 +1544,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
{
aRet <<= pFmt->GetPositionLayoutDir();
}
- // <--
- // --> OD 2004-10-28 #i36248#
+ // #i36248#
else if ( FN_SHAPE_STARTPOSITION_IN_HORI_L2R == pEntry->nWID )
{
// get property <::drawing::Shape::StartPosition>
@@ -1675,7 +1557,6 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
// without conversion to layout direction as below
aRet = _getPropAtAggrObj( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")) );
}
- // <--
else
{
const SwAttrSet& rSet = pFmt->GetAttrSet();
@@ -1717,19 +1598,19 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
aRet.setValue(&aPoint, ::getCppuType( (awt::Point*)0 ));
}
break;
- // OD 2004-04-22 #i26791#
+ // #i26791#
case RES_FOLLOW_TEXT_FLOW :
{
pItem = pImpl->GetFollowTextFlow();
}
break;
- // OD 2004-05-05 #i28701#
+ // #i28701#
case RES_WRAP_INFLUENCE_ON_OBJPOS:
{
pItem = pImpl->GetWrapInfluenceOnObjPos();
}
break;
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
case FN_SHAPE_TRANSFORMATION_IN_HORI_L2R:
{
// get property <::drawing::Shape::Transformation>
@@ -1742,8 +1623,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
aRet <<= pImpl->GetPositionLayoutDir();
}
break;
- // <--
- // --> OD 2004-08-06 #i36248#
+ // #i36248#
case FN_SHAPE_STARTPOSITION_IN_HORI_L2R:
{
// get property <::drawing::Shape::StartPosition>
@@ -1758,7 +1638,6 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
aRet = _getPropAtAggrObj( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition")) );
}
break;
- // <--
}
if(pItem)
pItem->QueryValue(aRet, pEntry->nMemberId);
@@ -1768,7 +1647,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
{
aRet = _getPropAtAggrObj( rPropertyName );
- // --> OD 2004-07-28 #i31698# - convert the position (translation)
+ // #i31698# - convert the position (translation)
// of the drawing object in the transformation
if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation"))) )
{
@@ -1776,43 +1655,35 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
aRet >>= aMatrix;
aRet <<= _ConvertTransformationToLayoutDir( aMatrix );
}
- // <--
- // --> OD 2004-10-28 #i36248#
+ // #i36248#
else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartPosition"))) )
{
awt::Point aStartPos;
aRet >>= aStartPos;
- // --> OD 2009-01-12 #i59051#
+ // #i59051#
aRet <<= _ConvertStartOrEndPosToLayoutDir( aStartPos );
- // <--
}
else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndPosition"))) )
{
awt::Point aEndPos;
aRet >>= aEndPos;
- // --> OD 2009-01-12 #i59051#
+ // #i59051#
aRet <<= _ConvertStartOrEndPosToLayoutDir( aEndPos );
- // <--
}
- // --> OD 2009-01-16 #i59051#
+ // #i59051#
else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PolyPolygonBezier"))) )
{
drawing::PolyPolygonBezierCoords aPath;
aRet >>= aPath;
aRet <<= _ConvertPolyPolygonBezierToLayoutDir( aPath );
- // <--
}
- // <--
}
}
return aRet;
}
/** method to get property from aggregation object
-
- OD 2004-10-28 #i36248#
-
- @author OD
+ #i36248#
*/
uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -1834,28 +1705,22 @@ uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
return aRet;
}
-
-/* -----------------------------02.11.00 09:41--------------------------------
-
- ---------------------------------------------------------------------------*/
beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< rtl::OUString > aNames(1);
rtl::OUString* pStrings = aNames.getArray();
pStrings[0] = rPropertyName;
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames);
return aStates.getConstArray()[0];
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
uno::Sequence< beans::PropertyState > aRet(aPropertyNames.getLength());
if(xShapeAgg.is())
@@ -1921,7 +1786,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
case RES_SURROUND:
pItem = pImpl->GetSurround();
break;
- // OD 2004-05-05 #i28701#
+ // #i28701#
case RES_WRAP_INFLUENCE_ON_OBJPOS:
{
pItem = pImpl->GetWrapInfluenceOnObjPos();
@@ -1952,13 +1817,11 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
throw uno::RuntimeException();
return aRet;
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(xShapeAgg.is())
{
@@ -1988,13 +1851,13 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
case RES_OPAQUE : pImpl->SetOpaque(sal_False); break;
case FN_TEXT_RANGE :
break;
- // OD 2004-04-22 #i26791#
+ // #i26791#
case RES_FOLLOW_TEXT_FLOW:
{
pImpl->RemoveFollowTextFlow();
}
break;
- // OD 2004-05-05 #i28701#
+ // #i28701#
case RES_WRAP_INFLUENCE_ON_OBJPOS:
{
pImpl->RemoveWrapInfluenceOnObjPos();
@@ -2016,14 +1879,12 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
else
throw uno::RuntimeException();
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
uno::Any aRet;
if(xShapeAgg.is())
@@ -2054,9 +1915,7 @@ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addPropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener )
@@ -2071,9 +1930,7 @@ void SwXShape::addPropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->addPropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removePropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener)
@@ -2088,9 +1945,7 @@ void SwXShape::removePropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->removePropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/ )
@@ -2099,9 +1954,7 @@ void SwXShape::addVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removeVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
@@ -2110,20 +1963,16 @@ void SwXShape::removeVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// get access to SwDoc
// (see also SwXTextRange::XTextRangeToSwPaM)
@@ -2187,12 +2036,10 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
}
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2211,38 +2058,32 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim
aRef = pImpl->GetTextRange();
return aRef;
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
- // OD 10.07.2003 #110742# - determine correct <SdrObject>
- //SdrObject* pObj = pFmt->FindSdrObject();
+ // determine correct <SdrObject>
SdrObject* pObj = GetSvxShape()->GetSdrObject();
- // OD 10.07.2003 #110742# - safety assertion:
+ // safety assertion:
// <pObj> must be the same as <pFmt->FindSdrObject()>, if <pObj> isn't
// a 'virtual' drawing object.
- // OD 25.08.2003 #111713# - refine assertion for safety reason.
- // --> OD 2005-02-02 #119236# - correct assertion and refine it.
- ASSERT( !pObj ||
+ // correct assertion and refine it for safety reason.
+ OSL_ENSURE( !pObj ||
pObj->ISA(SwDrawVirtObj) ||
pObj->GetUpGroup() ||
pObj == pFmt->FindSdrObject(),
"<SwXShape::dispose(..) - different 'master' drawing objects!!" );
- // <--
- // OD 10.07.2003 #110742# - perform delete of draw frame format *not*
+ // perform delete of draw frame format *not*
// for 'virtual' drawing objects.
- // --> OD 2005-02-02 #119236# - no delete of draw format for members
+ // no delete of draw format for members
// of a group
if ( pObj &&
!pObj->ISA(SwDrawVirtObj) &&
!pObj->GetUpGroup() &&
pObj->IsInserted() )
- // <--
{
if (pFmt->GetAnchor().GetAnchorId() == FLY_AS_CHAR)
{
@@ -2264,9 +2105,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
xComp->dispose();
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::addEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2276,9 +2115,7 @@ void SwXShape::addEventListener(
if(pSvxShape)
pSvxShape->addEventListener(aListener);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::removeEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2287,16 +2124,12 @@ void SwXShape::removeEventListener(
if(pSvxShape)
pSvxShape->removeEventListener(aListener);
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
rtl::OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXShape");
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -2310,9 +2143,7 @@ sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno
}
return bRet;
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aSeq;
@@ -2330,9 +2161,7 @@ uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( u
}
return aSeq;
}
-/* -----------------------------15.03.00 14:54--------------------------------
- ---------------------------------------------------------------------------*/
SvxShape* SwXShape::GetSvxShape()
{
SvxShape* pSvxShape = 0;
@@ -2346,7 +2175,7 @@ SvxShape* SwXShape::GetSvxShape()
return pSvxShape;
}
-// --> OD 2004-07-22 #i31698# -
+// #i31698#
// implementation of virtual methods from drawing::XShape
awt::Point SAL_CALL SwXShape::getPosition() throw ( uno::RuntimeException )
{
@@ -2359,7 +2188,7 @@ awt::Point SAL_CALL SwXShape::getPosition() throw ( uno::RuntimeException )
SdrObject* pTopGroupObj = _GetTopGroupObj( pSvxShape );
if ( pTopGroupObj )
{
- // --> OD 2004-10-01 #i34750# - get attribute position of top group
+ // #i34750# - get attribute position of top group
// shape and add offset between top group object and group member
uno::Reference< drawing::XShape > xGroupShape =
uno::Reference< drawing::XShape >( pTopGroupObj->getUnoShape(),
@@ -2367,65 +2196,39 @@ awt::Point SAL_CALL SwXShape::getPosition() throw ( uno::RuntimeException )
aPos = xGroupShape->getPosition();
// add offset between top group object and group member
// to the determined attribute position
- // --> OD 2004-10-01 #i34750# - correction:
+ // #i34750#:
// consider the layout direction
const Rectangle aMemberObjRect = GetSvxShape()->GetSdrObject()->GetSnapRect();
const Rectangle aGroupObjRect = pTopGroupObj->GetSnapRect();
- // --> OD 2005-08-16 #i53320# - relative position of group member and
+ // #i53320# - relative position of group member and
// top group object is always given in horizontal left-to-right layout.
-// const SwFrmFmt::tLayoutDir eLayoutDir = GetFrmFmt()
-// ? GetFrmFmt()->GetLayoutDir()
-// : SwFrmFmt::HORI_L2R;
awt::Point aOffset( 0, 0 );
-// switch ( eLayoutDir )
-// {
-// case SwFrmFmt::HORI_L2R:
{
aOffset.X = ( aMemberObjRect.Left() - aGroupObjRect.Left() );
aOffset.Y = ( aMemberObjRect.Top() - aGroupObjRect.Top() );
}
-// break;
-// case SwFrmFmt::HORI_R2L:
-// {
-// aOffset.X = ( aGroupObjRect.Right() - aMemberObjRect.Right() );
-// aOffset.Y = ( aMemberObjRect.Top() - aGroupObjRect.Top() );
-// }
-// break;
-// case SwFrmFmt::VERT_R2L:
-// {
-// aOffset.X = ( aMemberObjRect.Top() - aGroupObjRect.Top() );
-// aOffset.Y = ( aGroupObjRect.Right() - aMemberObjRect.Right() );
-// }
-// break;
-// default:
-// {
-// ASSERT( false,
-// "<SwXShape::getPosition()> - unsupported layout direction" );
-// }
-// }
- // <--
aOffset.X = TWIP_TO_MM100(aOffset.X);
aOffset.Y = TWIP_TO_MM100(aOffset.Y);
aPos.X += aOffset.X;
aPos.Y += aOffset.Y;
- // <--
}
}
return aPos;
}
+
void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
throw ( uno::RuntimeException )
{
SdrObject* pTopGroupObj = _GetTopGroupObj();
if ( !pTopGroupObj )
{
- // --> OD 2005-02-10 #i37877# - no adjustment of position attributes,
+ // #i37877# - no adjustment of position attributes,
// if the position also has to be applied at the drawing object and
// a contact object is already registered at the drawing object.
bool bApplyPosAtDrawObj(false);
bool bNoAdjustOfPosProp(false);
- // --> OD 2004-10-19 #i35798# - apply position also to drawing object,
+ // #i35798# - apply position also to drawing object,
// if drawing object has no anchor position set.
if ( mxShape.is() )
{
@@ -2446,7 +2249,6 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
}
}
}
- // <--
// shape isn't a group member. Thus, set positioning attributes
if ( !bNoAdjustOfPosProp )
{
@@ -2456,7 +2258,6 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
{
mxShape->setPosition( aPosition );
}
- // <--
}
else if ( mxShape.is() )
{
@@ -2476,20 +2277,19 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
uno::Reference< drawing::XShape >( pTopGroupObj->getUnoShape(),
uno::UNO_QUERY );
{
- // --> OD 2004-09-29 #i34750# - correction:
+ // #i34750#
// use method <xGroupShape->getPosition()> to get the correct
// position of the top group object.
awt::Point aAttrPosInHoriL2R(
_ConvertPositionToHoriL2R( xGroupShape->getPosition(),
xGroupShape->getSize() ) );
- // <--
aNewPos.X -= aAttrPosInHoriL2R.X;
aNewPos.Y -= aAttrPosInHoriL2R.Y;
}
// convert relative position in horizontal left-to-right layout into
// absolute position in horizontal left-to-right layout
{
- // --> OD 2004-10-01 #i34750# - correction:
+ // #i34750#
// use method <SvxShape->getPosition()> to get the correct
// 'Drawing layer' position of the top group shape.
uno::Reference< lang::XUnoTunnel > xGrpShapeTunnel(
@@ -2500,12 +2300,12 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition )
const awt::Point aGroupPos = pSvxGroupShape->getPosition();
aNewPos.X += aGroupPos.X;
aNewPos.Y += aGroupPos.Y;
- // <--
}
// set position
mxShape->setPosition( aNewPos );
}
}
+
awt::Size SAL_CALL SwXShape::getSize() throw ( uno::RuntimeException )
{
awt::Size aSize;
@@ -2515,6 +2315,7 @@ awt::Size SAL_CALL SwXShape::getSize() throw ( uno::RuntimeException )
}
return aSize;
}
+
void SAL_CALL SwXShape::setSize( const awt::Size& aSize )
throw ( beans::PropertyVetoException,
uno::RuntimeException )
@@ -2524,8 +2325,7 @@ void SAL_CALL SwXShape::setSize( const awt::Size& aSize )
mxShape->setSize( aSize );
}
}
-// <--
-// --> OD 2004-07-22 #i31698# -
+// #i31698#
// implementation of virtual methods from drawing::XShapeDescriptor
::rtl::OUString SAL_CALL SwXShape::getShapeType() throw ( uno::RuntimeException )
{
@@ -2536,12 +2336,8 @@ void SAL_CALL SwXShape::setSize( const awt::Size& aSize )
}
return aType;
}
-// <--
/** method to determine top group object
-
- OD 2004-08-03 #i31698#
-
- @author OD
+ #i31698#
*/
SdrObject* SwXShape::_GetTopGroupObj( SvxShape* _pSvxShape )
{
@@ -2565,10 +2361,7 @@ SdrObject* SwXShape::_GetTopGroupObj( SvxShape* _pSvxShape )
}
/** method to determine position according to the positioning attributes
-
- OD 2004-08-03 #i31698#
-
- @author OD
+ #i31698#
*/
awt::Point SwXShape::_GetAttrPosition()
{
@@ -2578,7 +2371,7 @@ awt::Point SwXShape::_GetAttrPosition()
aHoriPos >>= aAttrPos.X;
uno::Any aVertPos( getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")) ) );
aVertPos >>= aAttrPos.Y;
- // --> OD 2004-10-19 #i35798# - fallback, if attribute position is (0,0)
+ // #i35798# - fallback, if attribute position is (0,0)
// and no anchor position is applied to the drawing object
SvxShape* pSvxShape = GetSvxShape();
if ( pSvxShape )
@@ -2594,8 +2387,7 @@ awt::Point SwXShape::_GetAttrPosition()
aAttrPos.Y = TWIP_TO_MM100(aObjRect.Top());
}
}
- // <--
- // --> OD 2004-11-10 #i35007# - If drawing object is anchored as-character,
+ // #i35007# - If drawing object is anchored as-character,
// it's x-position isn't sensible. Thus, return the x-position as zero in this case.
text::TextContentAnchorType eTextAnchorType =
text::TextContentAnchorType_AT_PARAGRAPH;
@@ -2608,17 +2400,13 @@ awt::Point SwXShape::_GetAttrPosition()
{
aAttrPos.X = 0;
}
- // <--
return aAttrPos;
}
/** method to convert the position (translation) of the drawing object to
the layout direction horizontal left-to-right.
-
- OD 2004-07-27 #i31698#
-
- @author OD
+ #i31698#
*/
awt::Point SwXShape::_ConvertPositionToHoriL2R( const awt::Point _aObjPos,
const awt::Size _aObjSize )
@@ -2649,7 +2437,7 @@ awt::Point SwXShape::_ConvertPositionToHoriL2R( const awt::Point _aObjPos,
break;
default:
{
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwXShape::_ConvertPositionToHoriL2R(..)> - unsupported layout direction" );
}
}
@@ -2657,28 +2445,26 @@ awt::Point SwXShape::_ConvertPositionToHoriL2R( const awt::Point _aObjPos,
return aObjPosInHoriL2R;
}
+
/** method to convert the transformation of the drawing object to the layout
direction, the drawing object is in
-
- OD 2004-07-27 #i31698#
-
- @author OD
+ #i31698#
*/
drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
drawing::HomogenMatrix3 _aMatrixInHoriL2R )
{
drawing::HomogenMatrix3 aMatrix( _aMatrixInHoriL2R );
- // --> OD 2005-03-10 #i44334#, #i44681# - direct manipulation of the
+ // #i44334#, #i44681# - direct manipulation of the
// tranformation structure isn't valid, if it contains rotation.
SvxShape* pSvxShape = GetSvxShape();
- ASSERT( pSvxShape,
- "<SwXShape::_ConvertTransformationToLayoutDir(..)> - no SvxShape found!")
+ OSL_ENSURE( pSvxShape,
+ "<SwXShape::_ConvertTransformationToLayoutDir(..)> - no SvxShape found!");
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
- ASSERT( pObj,
- "<SwXShape::_ConvertTransformationToLayoutDir(..)> - no SdrObject found!")
+ OSL_ENSURE( pObj,
+ "<SwXShape::_ConvertTransformationToLayoutDir(..)> - no SdrObject found!");
if ( pObj )
{
// get position of object in Writer coordinate system.
@@ -2695,9 +2481,8 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
// apply translation difference to transformation matrix.
if ( aTranslateDiff.X != 0 || aTranslateDiff.Y != 0 )
{
- // --> OD 2007-01-03 #i73079# - use correct matrix type
+ // #i73079# - use correct matrix type
::basegfx::B2DHomMatrix aTempMatrix;
- // <--
aTempMatrix.set(0, 0, aMatrix.Line1.Column1 );
aTempMatrix.set(0, 1, aMatrix.Line1.Column2 );
@@ -2708,11 +2493,8 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
aTempMatrix.set(2, 0, aMatrix.Line3.Column1 );
aTempMatrix.set(2, 1, aMatrix.Line3.Column2 );
aTempMatrix.set(2, 2, aMatrix.Line3.Column3 );
-
- // --> OD 2007-01-03 #i73079#
+ // #i73079#
aTempMatrix.translate( aTranslateDiff.X, aTranslateDiff.Y );
- // <--
-
aMatrix.Line1.Column1 = aTempMatrix.get(0, 0);
aMatrix.Line1.Column2 = aTempMatrix.get(0, 1);
aMatrix.Line1.Column3 = aTempMatrix.get(0, 2);
@@ -2725,21 +2507,17 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
}
}
}
- // <--
return aMatrix;
}
/** method to adjust the positioning properties
-
- OD 2004-08-02 #i31698#
-
- @author OD
+ #i31698#
*/
void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
{
// handle x-position
- // --> OD 2004-11-10 #i35007# - no handling of x-position, if drawing
+ // #i35007# - no handling of x-position, if drawing
// object is anchored as-character, because it doesn't make sense.
text::TextContentAnchorType eTextAnchorType =
text::TextContentAnchorType_AT_PARAGRAPH;
@@ -2749,7 +2527,6 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
aAny >>= eTextAnchorType;
}
if ( eTextAnchorType != text::TextContentAnchorType_AS_CHARACTER )
- // <--
{
// determine current x-postion
rtl::OUString aHoriPosPropStr( RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition") );
@@ -2812,10 +2589,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
/** method to convert start or end position of the drawing object to the
Writer specific position, which is the attribute position in layout direction
-
- OD 2009-01-12 #i59051#
-
- @author OD
+ #i59051#
*/
::com::sun::star::awt::Point SwXShape::_ConvertStartOrEndPosToLayoutDir(
const ::com::sun::star::awt::Point& aStartOrEndPos )
@@ -2823,13 +2597,13 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
awt::Point aConvertedPos( aStartOrEndPos );
SvxShape* pSvxShape = GetSvxShape();
- ASSERT( pSvxShape,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!")
+ OSL_ENSURE( pSvxShape,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
- ASSERT( pObj,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!")
+ OSL_ENSURE( pObj,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
if ( pObj )
{
// get position of object in Writer coordinate system.
@@ -2861,13 +2635,13 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
drawing::PolyPolygonBezierCoords aConvertedPath( aPath );
SvxShape* pSvxShape = GetSvxShape();
- ASSERT( pSvxShape,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!")
+ OSL_ENSURE( pSvxShape,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SvxShape found!");
if ( pSvxShape )
{
const SdrObject* pObj = pSvxShape->GetSdrObject();
- ASSERT( pObj,
- "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!")
+ OSL_ENSURE( pObj,
+ "<SwXShape::_ConvertStartOrEndPosToLayoutDir(..)> - no SdrObject found!");
if ( pObj )
{
// get position of object in Writer coordinate system.
@@ -2910,27 +2684,19 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
return aConvertedPath;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
SwXShape(xShape)
{
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
uno::Reference<XShapes> xShapes(xShapeAgg, uno::UNO_QUERY);
DBG_ASSERT(xShapes.is(), "no SvxShape found or shape is not a group shape");
#endif
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXGroupShape::~SwXGroupShape()
{
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
{
uno::Any aRet;
@@ -2940,26 +2706,20 @@ uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::Runt
aRet = SwXShape::queryInterface(rType);
return aRet;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::acquire( ) throw()
{
SwXShape::acquire();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::release( ) throw()
{
SwXShape::release();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SvxShape* pSvxShape = GetSvxShape();
SwFrmFmt* pFmt = GetFrmFmt();
if(pSvxShape && pFmt)
@@ -2991,7 +2751,7 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru
if(pObj)
{
SwDoc* pDoc = pFmt->GetDoc();
- // OD 25.06.2003 #108784# - set layer of new drawing
+ // set layer of new drawing
// object to corresponding invisible layer.
if( FmFormInventor != pObj->GetObjInventor())
{
@@ -3015,12 +2775,10 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru
else
throw uno::RuntimeException();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference<XShapes> xShapes;
if( xShapeAgg.is() )
{
@@ -3032,12 +2790,10 @@ void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno:
throw uno::RuntimeException();
xShapes->remove(xShape);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference<XIndexAccess> xAcc;
if( xShapeAgg.is() )
{
@@ -3049,14 +2805,12 @@ sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return xAcc->getCount();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference<XIndexAccess> xAcc;
if( xShapeAgg.is() )
{
@@ -3068,12 +2822,10 @@ uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return xAcc->getByIndex(nIndex);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference<XIndexAccess> xAcc;
if( xShapeAgg.is() )
{
@@ -3085,12 +2837,10 @@ uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
throw uno::RuntimeException();
return xAcc->getElementType();
}
-/*-- 31.05.01 09:59:22---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXGroupShape::hasElements( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference<XIndexAccess> xAcc;
if( xShapeAgg.is() )
{
@@ -3103,4 +2853,4 @@ sal_Bool SwXGroupShape::hasElements( ) throw(uno::RuntimeException)
return xAcc->hasElements();
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx
index 333e132f4e6a..c58728e40b68 100644
--- a/sw/source/core/unocore/unoevent.cxx
+++ b/sw/source/core/unocore/unoevent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,15 +37,11 @@
#include "unostyle.hxx"
#include "swevent.hxx"
#include "docstyle.hxx"
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include "fmtinfmt.hxx"
#include <svl/macitem.hxx>
#include <rtl/ustrbuf.hxx>
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP
#include <com/sun/star/beans/PropertyValue.hpp>
-#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -331,3 +328,4 @@ sal_uInt16 SwFrameStyleEventDescriptor::getMacroItemWhich() const
return RES_FRMMACRO;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoevtlstnr.cxx b/sw/source/core/unocore/unoevtlstnr.cxx
index 197715bbd7e6..0e20fd81af9f 100644
--- a/sw/source/core/unocore/unoevtlstnr.cxx
+++ b/sw/source/core/unocore/unoevtlstnr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,22 +40,14 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
-/* -----------------22.04.99 11:24-------------------
- *
- * --------------------------------------------------*/
SV_IMPL_PTRARR(SwEvtLstnrArray, XEventListenerPtr);
-/*-- 22.04.99 11:24:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwEventListenerContainer::SwEventListenerContainer( uno::XInterface* _pxParent) :
pListenerArr(0),
pxParent(_pxParent)
{
}
-/*-- 22.04.99 11:24:59---------------------------------------------------
- -----------------------------------------------------------------------*/
SwEventListenerContainer::~SwEventListenerContainer()
{
if(pListenerArr && pListenerArr->Count())
@@ -63,9 +56,7 @@ SwEventListenerContainer::~SwEventListenerContainer()
}
delete pListenerArr;
}
-/*-- 22.04.99 11:24:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwEventListenerContainer::AddListener(const uno::Reference< lang::XEventListener > & rxListener)
{
if(!pListenerArr)
@@ -74,9 +65,7 @@ void SwEventListenerContainer::AddListener(const uno::Reference< lang::XEvent
*pInsert = rxListener;
pListenerArr->Insert(pInsert, pListenerArr->Count());
}
-/*-- 22.04.99 11:25:00---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwEventListenerContainer::RemoveListener(const uno::Reference< lang::XEventListener > & rxListener)
{
if(!pListenerArr)
@@ -98,9 +87,7 @@ sal_Bool SwEventListenerContainer::RemoveListener(const uno::Reference< lang:
}
return sal_False;
}
-/*-- 22.04.99 11:25:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwEventListenerContainer::Disposing()
{
if(!pListenerArr)
@@ -115,4 +102,4 @@ void SwEventListenerContainer::Disposing()
pListenerArr->DeleteAndDestroy(0, pListenerArr->Count());
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index f0a62ea968ac..34d473ee4199 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,7 +88,7 @@
#include <svx/dataaccessdescriptor.hxx>
#define _SVSTDARR_STRINGS
#include <svl/svstdarr.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <textapi.hxx>
#include <editeng/outliner.hxx>
@@ -124,11 +125,13 @@ static const sal_uInt16 aDocInfoSubTypeFromService[] =
DI_TITEL, //PROPERTY_MAP_FLDTYP_DOCINFO_TITLE
DI_DOCNO //PROPERTY_MAP_FLDTYP_DOCINFO_REVISION
};
+
struct ServiceIdResId
{
sal_uInt16 nResId;
sal_uInt16 nServiceId;
};
+
static const ServiceIdResId aServiceToRes[] =
{
{RES_DATETIMEFLD, SW_SERVICE_FIELDTYPE_DATETIME },
@@ -185,19 +188,19 @@ static const ServiceIdResId aServiceToRes[] =
{RES_TABLEFLD, SW_SERVICE_FIELDTYPE_TABLE_FORMULA },
{USHRT_MAX, USHRT_MAX }
};
-//-----------------------------------------------------------------
+
sal_uInt16 lcl_ServiceIdToResId(sal_uInt16 nServiceId)
{
const ServiceIdResId* pMap = aServiceToRes;
while( USHRT_MAX != pMap->nServiceId && nServiceId != pMap->nServiceId )
++pMap;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( USHRT_MAX == pMap->nServiceId )
- DBG_ERROR("service id not found");
+ OSL_FAIL("service id not found");
#endif
return pMap->nResId;
}
-//-----------------------------------------------------------------
+
sal_uInt16 lcl_GetServiceForField( const SwField& rFld )
{
sal_uInt16 nWhich = rFld.Which(), nSrvId = USHRT_MAX;
@@ -271,9 +274,9 @@ sal_uInt16 lcl_GetServiceForField( const SwField& rFld )
break;
}
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if( USHRT_MAX == nSrvId )
- DBG_ERROR("resid not found");
+ OSL_FAIL("resid not found");
#endif
return nSrvId;
}
@@ -293,7 +296,6 @@ sal_uInt16 lcl_GetPropMapIdForFieldType( sal_uInt16 nWhich )
return nId;
}
-
sal_uInt16 GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp )
{
sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() );
@@ -382,7 +384,7 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
case SW_SERVICE_FIELDMASTER_DUMMY5: nRet = PROPERTY_MAP_FLDMSTR_DUMMY0; break;
case SW_SERVICE_FIELDTYPE_HIDDEN_TEXT: nRet = PROPERTY_MAP_FLDTYP_HIDDEN_TEXT; break;
default:
- DBG_ERROR( "wrong service id" );
+ OSL_FAIL( "wrong service id" );
nRet = USHRT_MAX;
}
return nRet;
@@ -392,17 +394,13 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
* SwXFieldMaster
******************************************************************/
TYPEINIT1(SwXFieldMaster, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -414,16 +412,12 @@ sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >
}
return 0;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldMaster");
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -452,9 +446,7 @@ sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( un
}
return bRet;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(2);
@@ -479,9 +471,7 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw(
}
return aRet;
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
aLstnrCntnr( (XPropertySet*)this),
nResTypeId(nResId),
@@ -494,9 +484,7 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
SwClient(&rType),
aLstnrCntnr( (XPropertySet*)this),
@@ -509,34 +497,28 @@ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
{
}
-/*-- 14.12.98 11:08:34---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::~SwXFieldMaster()
{
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< beans::XPropertySetInfo > aRef =
aSwMapProvider.GetPropertySet(
lcl_GetPropMapIdForFieldType( nResTypeId ) )->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFieldType* pType = GetFldType(sal_True);
if(pType)
{
@@ -712,9 +694,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
}
}
}
-/* -----------------------------30.03.01 14:40--------------------------------
- ---------------------------------------------------------------------------*/
SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
{
if(!bDontCreate && RES_DBFLD == nResTypeId && m_bIsDescriptor && m_pDoc)
@@ -743,9 +723,6 @@ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
return (SwFieldType*)GetRegisteredIn();
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
typedef SwFmtFld* SwFmtFldPtr;
SV_DECL_PTRARR(SwDependentFields, SwFmtFldPtr, 5, 5)
SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr)
@@ -753,7 +730,7 @@ SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr)
uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFieldType* pType = GetFldType(sal_True);
if( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_INSTANCE_NAME)) )
@@ -900,41 +877,30 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 25.02.99 11:01:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFieldType* pFldType = GetFldType(sal_True);
if(pFldType)
{
@@ -969,9 +935,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 25.02.99 11:02:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -979,9 +943,7 @@ void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 25.02.99 11:02:02---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -989,9 +951,6 @@ void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListe
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:08:38---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -1001,31 +960,7 @@ void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
m_pDoc = 0;
}
}
-/* -----------------------------06.11.00 09:44--------------------------------
-
-const Programmatic2UIName_Impl* lcl_GetFieldNameTable()
-{
- static sal_Bool bInitialized = sal_False;
- static Programmatic2UIName_Impl aFieldNames[5];
- if(!bInitialized)
- {
- bInitialized = sal_True;
- int nName = 0;
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_ABB ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_ABB));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_TABLE ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_TABLE));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_FRAME));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_FRAME));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_DRAWING ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_DRAWING));
- }
- return &aFieldNames[0];
-}
- ---------------------------------------------------------------------------*/
-/* -----------------------------06.11.00 10:26--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc)
{
OUString sRet(rType.GetName());
@@ -1043,9 +978,7 @@ OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rD
}
return sRet;
}
-/* -----------------------------06.11.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::LocalizeFormula(
const SwSetExpField& rFld,
const OUString& rFormula,
@@ -1067,7 +1000,6 @@ OUString SwXFieldMaster::LocalizeFormula(
return rFormula;
}
-
SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
{
SwClientIter aIter(*rFmt.GetFld()->GetTyp());
@@ -1086,9 +1018,6 @@ SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
return pField ? pField : new SwXTextField( rFmt, &rDoc );
}
-/******************************************************************
- *
- ******************************************************************/
struct SwFieldProperties_Impl
{
String sPar1;
@@ -1136,17 +1065,13 @@ struct SwFieldProperties_Impl
};
TYPEINIT1(SwXTextField, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -1158,9 +1083,6 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 14.12.98 11:37:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
aLstnrCntnr( (XTextContent*)this),
@@ -1184,9 +1106,7 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
m_pProps->nUSHORT2 = USHRT_MAX;
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
aLstnrCntnr( (XTextContent*)this),
pFmtFld(&rFmt),
@@ -1199,9 +1119,7 @@ SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
{
pDc->GetUnoCallBack()->Add(this);
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::~SwXTextField()
{
if ( m_pTextObject )
@@ -1212,13 +1130,11 @@ SwXTextField::~SwXTextField()
delete m_pProps;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertySet > & xFieldMaster)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!m_bIsDescriptor)
throw uno::RuntimeException();
uno::Reference< lang::XUnoTunnel > xMasterTunnel(xFieldMaster, uno::UNO_QUERY);
@@ -1237,12 +1153,10 @@ void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertyS
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFieldType* pType = 0;
if( m_bIsDescriptor && m_aFieldTypeClient.GetRegisteredIn() )
{
@@ -1261,12 +1175,10 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th
return pMaster;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwField const*const pField = GetField();
if (!pField)
@@ -1278,14 +1190,12 @@ OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::Runtim
: pField->ExpandField(true) );
return ret;
}
-/* -----------------18.02.99 13:39-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextField::attachToRange(
const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!m_bIsDescriptor)
throw uno::RuntimeException();
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
@@ -1635,7 +1545,7 @@ void SwXTextField::attachToRange(
SwFieldType* pFldType = pDoc->GetFldType(RES_SETEXPFLD, m_sTypeName, sal_True);
if(!pFldType)
throw uno::RuntimeException();
- //#93192# detect the field type's sub type and set an appropriate number format
+ // detect the field type's sub type and set an appropriate number format
if(m_pProps->bFormatIsDefault &&
nsSwGetSetExpType::GSE_STRING == ((SwSetExpFieldType*)pFldType)->GetType())
m_pProps->nFormat = -1;
@@ -1672,7 +1582,7 @@ void SwXTextField::attachToRange(
//case text::SetVariableType::SEQUENCE: nSubType = nsSwGetSetExpType::GSE_SEQ; break;
case text::SetVariableType::FORMULA: nSubType = nsSwGetSetExpType::GSE_FORMULA; break;
default:
- DBG_ERROR("wrong value");
+ OSL_FAIL("wrong value");
nSubType = nsSwGetSetExpType::GSE_EXPR;
}
//make sure the SubType matches the field type
@@ -1808,7 +1718,7 @@ void SwXTextField::attachToRange(
((SwTblField*)pFld)->ChgExpStr(m_pProps->sPar1);
}
break;
- default: DBG_ERROR("was ist das fuer ein Typ?");
+ default: OSL_FAIL("was ist das fuer ein Typ?");
}
if(pFld)
{
@@ -1854,21 +1764,17 @@ void SwXTextField::attachToRange(
else
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
attachToRange( xTextRange );
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > aRef;
SwField* pField = (SwField*)GetField();
if(pField)
@@ -1886,12 +1792,10 @@ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::Ru
return aRef;
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwField* pField = (SwField*)GetField();
if(pField)
{
@@ -1911,30 +1815,24 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException )
m_pTextObject = 0;
}
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
//kein static
uno::Reference< beans::XPropertySetInfo > aRef;
if(m_nServiceId != USHRT_MAX)
@@ -1952,14 +1850,12 @@ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void
throw uno::RuntimeException();
return aRef;
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwField* pField = (SwField*)GetField();
const SfxItemPropertySet* _pPropSet = aSwMapProvider.GetPropertySet(
lcl_GetPropertyMapOfService( m_nServiceId));
@@ -1986,7 +1882,6 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
}
else
{
- // -> #111840#
SwDoc * pDoc = GetDoc();
if (NULL != pDoc)
@@ -1998,7 +1893,6 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
aPosition.nContent = *pTxtFld->GetStart();
pDoc->PutValueToField( aPosition, rValue, pEntry->nWID);
}
- // <- #111840#
}
pField->PutValue( rValue, pEntry->nWID );
@@ -2008,7 +1902,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
const_cast<SwFmtFld*>(pFmtFld)->Broadcast(SwFmtFldHint( 0, SWFMTFLD_CHANGED ));
}
- //#114571# changes of the expanded string have to be notified
+ // changes of the expanded string have to be notified
//#to the SwTxtFld
if(RES_DBFLD == nWhich && pFmtFld->GetTxtFld())
{
@@ -2115,13 +2009,11 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
else
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
const SwField* pField = GetField();
const SfxItemPropertySet* _pPropSet = aSwMapProvider.GetPropertySet(
@@ -2303,40 +2195,30 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/* -----------------------------23.03.01 13:15--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextField::update( ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SwField* pFld = GetField();
if(pFld)
{
@@ -2382,31 +2264,24 @@ void SwXTextField::update( ) throw (uno::RuntimeException)
}
break;
}
- // --> FME 2004-10-06 #116480#
// Text formatting has to be triggered.
const_cast<SwFmtFld*>(pFmtFld)->Modify( 0, 0 );
- // <--
}
else
m_bCallUpdate = sal_True;
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextField::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextField");
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
static OUString OldNameToNewName_Impl( const OUString &rOld )
{
- static OUString aOldNamePart1( OUString::createFromAscii(".TextField.DocInfo.") );
- static OUString aOldNamePart2( OUString::createFromAscii(".TextField.") );
- static OUString aNewNamePart1( OUString::createFromAscii(".textfield.docinfo.") );
- static OUString aNewNamePart2( OUString::createFromAscii(".textfield.") );
+ static OUString aOldNamePart1(RTL_CONSTASCII_USTRINGPARAM(".TextField.DocInfo."));
+ static OUString aOldNamePart2(RTL_CONSTASCII_USTRINGPARAM(".TextField."));
+ static OUString aNewNamePart1(RTL_CONSTASCII_USTRINGPARAM(".textfield.docinfo."));
+ static OUString aNewNamePart2(RTL_CONSTASCII_USTRINGPARAM(".textfield."));
OUString sServiceNameCC( rOld );
sal_Int32 nIdx = sServiceNameCC.indexOf( aOldNamePart1 );
if (nIdx >= 0)
@@ -2429,9 +2304,7 @@ sal_Bool SwXTextField::supportsService(const OUString& rServiceName) throw( uno:
rServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent"));
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextField::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
OUString sServiceName = SwXServiceProvider::GetProviderName(m_nServiceId);
@@ -2461,9 +2334,6 @@ void SwXTextField::Invalidate()
}
}
-/* -----------------14.12.98 12:00-------------------
- *
- * --------------------------------------------------*/
void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
@@ -2486,9 +2356,7 @@ void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
break;
}
}
-/*-- 14.12.98 11:37:21---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwField* SwXTextField::GetField() const
{
if(GetRegisteredIn() && pFmtFld)
@@ -2497,29 +2365,19 @@ const SwField* SwXTextField::GetField() const
}
/******************************************************************
- *
- ******************************************************************/
-/******************************************************************
* SwXTextFieldMasters
******************************************************************/
-/* -----------------------------06.04.00 13:22--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldMasters");
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFieldMasters" ));
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2527,21 +2385,18 @@ uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.TextFieldMasters");
return aRet;
}
-/*-- 21.12.98 10:37:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::SwXTextFieldMasters(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 21.12.98 10:37:32---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::~SwXTextFieldMasters()
{
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
+
+/*-----------------------------------------------------------------------
Iteration ueber nicht-Standard Feldtypen
USER/SETEXP/DDE/DATABASE
Der Name ist demnach:
@@ -2553,7 +2408,6 @@ SwXTextFieldMasters::~SwXTextFieldMasters()
Falls wir grosszuegig werden wollen, dann koennte man com.sun.star.text
auch optional weglassen
-----------------------------------------------------------------------*/
-
sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName )
{
if( rName.EqualsAscii( COM_TEXT_FLDMASTER, 0, RTL_CONSTASCII_LENGTH(COM_TEXT_FLDMASTER ))
@@ -2596,11 +2450,10 @@ sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName )
return nResId;
}
-//-----------------------------------------------------------------------------
uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
throw uno::RuntimeException();
@@ -2621,9 +2474,7 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
uno::Any aRet(&aRef, ::getCppuType( static_cast<const uno::Reference<beans::XPropertySet>* >(0)));
return aRet;
}
-/*-- 06.03.2001 11:29:34,5-------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::getInstanceName(
const SwFieldType& rFldType, String& rName)
{
@@ -2669,14 +2520,10 @@ sal_Bool SwXTextFieldMasters::getInstanceName(
return bRet;
}
-
-/*-- 21.12.98 10:37:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
throw uno::RuntimeException();
@@ -2710,12 +2557,10 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
return aSeq;
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
throw uno::RuntimeException();
@@ -2729,46 +2574,32 @@ sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::Runti
}
return bRet;
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldMasters::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<beans::XPropertySet>*>(0));
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return sal_True;
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------06.04.00 13:24--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldTypes");
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFields" ));
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2776,64 +2607,49 @@ uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextFields");
return aRet;
}
-/*-- 21.12.98 10:35:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::SwXTextFieldTypes(SwDoc* _pDoc) :
SwUnoCollection (_pDoc),
aRefreshCont ( static_cast< XEnumerationAccess * >(this) )
{
}
-/*-- 21.12.98 10:35:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::~SwXTextFieldTypes()
{
}
-/*-- 11.07.02 14:25:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFieldTypes::Invalidate()
{
SwUnoCollection::Invalidate();
aRefreshCont.Disposing();
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return new SwXFieldEnumeration(GetDoc());
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldTypes::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<text::XDependentTextField>*>(0));
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
//es gibt sie immer
return sal_True;
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
UnoActionContext aContext(GetDoc());
@@ -2844,48 +2660,38 @@ void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
// call refresh listeners
aRefreshCont.Refreshed();
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !IsValid() )
throw uno::RuntimeException();
aRefreshCont.AddListener ( reinterpret_cast < const uno::Reference < lang::XEventListener > &> ( l ));
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !IsValid() || !aRefreshCont.RemoveListener ( reinterpret_cast < const uno::Reference < lang::XEventListener > &> ( l ) ) )
throw uno::RuntimeException();
}
+
/******************************************************************
* SwXFieldEnumeration
******************************************************************/
-/* -----------------------------06.04.00 13:25--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldEnumeration");
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.FieldEnumeration" ));
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2893,9 +2699,7 @@ uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.FieldEnumeration");
return aRet;
}
-/* -----------------21.12.98 14:57-------------------
- *
- * --------------------------------------------------*/
+
SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
nNextIndex(0),
pDoc(pDc)
@@ -2954,29 +2758,23 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
// resize sequence to actual used size
aItems.realloc( nFillPos );
}
-/*-- 21.12.98 14:57:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldEnumeration::~SwXFieldEnumeration()
{
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFieldEnumeration::hasMoreElements(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return nNextIndex < aItems.getLength();
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFieldEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!(nNextIndex < aItems.getLength()))
throw container::NoSuchElementException();
@@ -2990,9 +2788,7 @@ uno::Any SwXFieldEnumeration::nextElement(void)
rxFld = 0; // free memory for item that is not longer used
return aRet;
}
-/* -----------------21.12.98 15:08-------------------
- *
- * --------------------------------------------------*/
+
void SwXFieldEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -3000,7 +2796,6 @@ void SwXFieldEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pDoc = 0;
}
-
String& GetString( const uno::Any& rAny, String& rStr )
{
OUString aStr;
@@ -3008,3 +2803,5 @@ String& GetString( const uno::Any& rAny, String& rStr )
rStr = String( aStr );
return rStr;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 00c02806d3b0..97e92598e38a 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include <unobaseclass.hxx>
#include <unoflatpara.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
#include <unotextmarkup.hxx>
@@ -44,7 +45,6 @@
#include <viewimp.hxx>
#include <breakit.hxx>
#include <pam.hxx>
-#include <unobaseclass.hxx>
#include <unotextrange.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
@@ -80,7 +80,7 @@ uno::Sequence< uno::Type > SwXFlatParagraph::getTypes( ) throw(uno::RuntimeExce
uno::Sequence< sal_Int8 > SwXFlatParagraph::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -123,7 +123,7 @@ css::uno::Reference< css::container::XStringKeyMap > SAL_CALL SwXFlatParagraph::
void SAL_CALL SwXFlatParagraph::commitTextMarkup(::sal_Int32 nType, const ::rtl::OUString & rIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > & rxMarkupInfoContainer) throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwXTextMarkup::commitTextMarkup( nType, rIdentifier, nStart, nLength, rxMarkupInfoContainer );
}
@@ -136,7 +136,7 @@ void SAL_CALL SwXFlatParagraph::commitTextMarkup(::sal_Int32 nType, const ::rtl:
// text::XFlatParagraph:
void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, ::sal_Bool bVal ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( mpTxtNode )
{
@@ -156,7 +156,7 @@ void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, ::sal_Bool bVal )
// text::XFlatParagraph:
::sal_Bool SAL_CALL SwXFlatParagraph::isChecked( ::sal_Int32 nType ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( mpTxtNode )
{
if ( text::TextMarkupType::SPELLCHECK == nType )
@@ -173,7 +173,7 @@ void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, ::sal_Bool bVal )
// text::XFlatParagraph:
::sal_Bool SAL_CALL SwXFlatParagraph::isModified() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return 0 == mpTxtNode;
}
@@ -181,7 +181,7 @@ void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, ::sal_Bool bVal )
lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen)
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!mpTxtNode)
return SvxCreateLocale( LANGUAGE_NONE );
@@ -193,7 +193,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sa
lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen)
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!mpTxtNode)
return SvxCreateLocale( LANGUAGE_NONE );
@@ -205,7 +205,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPo
// text::XFlatParagraph:
void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, const ::rtl::OUString & aNewText, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !mpTxtNode )
return;
@@ -237,7 +237,7 @@ void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, c
// text::XFlatParagraph:
void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 nLen, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ( !mpTxtNode )
return;
@@ -262,7 +262,7 @@ void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 n
// text::XFlatParagraph:
css::uno::Sequence< ::sal_Int32 > SAL_CALL SwXFlatParagraph::getLanguagePortions() throw (css::uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return css::uno::Sequence< ::sal_Int32>();
}
@@ -314,7 +314,7 @@ void SwXFlatParagraphIterator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
// check if document gets closed...
if(!GetRegisteredIn())
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
mpDoc = 0;
}
}
@@ -329,7 +329,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getFirstPara()
uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XFlatParagraph > xRet;
if (!mpDoc)
@@ -439,7 +439,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getLastPara()
uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(const uno::Reference< text::XFlatParagraph > & xPara)
throw ( uno::RuntimeException, lang::IllegalArgumentException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XFlatParagraph > xRet;
if (!mpDoc)
@@ -486,7 +486,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(co
uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(const uno::Reference< text::XFlatParagraph > & xPara )
throw ( uno::RuntimeException, lang::IllegalArgumentException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XFlatParagraph > xRet;
if (!mpDoc)
@@ -529,3 +529,5 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(c
return xRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 5ee3fc45f6f4..93b80196d9ef 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,7 +68,6 @@
#include <unomap.hxx>
#include <unoprnms.hxx>
#include <unoevent.hxx>
-#include <com/sun/star/table/BorderLine.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/style/GraphicLocation.hpp>
@@ -104,7 +104,7 @@
#include <frmatr.hxx>
#include <ndtxt.hxx>
#include <ndgrf.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/printer.hxx>
#include <SwStyleNameMapper.hxx>
@@ -131,8 +131,8 @@ using ::com::sun::star::frame::XModel;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::style::XStyleFamiliesSupplier;
-const sal_Char __FAR_DATA sPackageProtocol[] = "vnd.sun.star.Package:";
-const sal_Char __FAR_DATA sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject:";
+const sal_Char sPackageProtocol[] = "vnd.sun.star.Package:";
+const sal_Char sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject:";
/****************************************************************************
Rahmenbeschreibung
@@ -145,45 +145,30 @@ public:
virtual ~BaseFrameProperties_Impl();
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 );
+ bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny );
+ bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound);
-// const SfxItemPropertyMap* GetMap() const {return _pMap;}
- sal_Bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, sal_Bool& rSizeFound);
-
- virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0;
+ virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) = 0;
};
-/* -----------------------------12.06.01 15:46--------------------------------
- ---------------------------------------------------------------------------*/
BaseFrameProperties_Impl::~BaseFrameProperties_Impl()
{
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
void BaseFrameProperties_Impl::SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWID, nMemberId, rVal );
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
-sal_Bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny)
+bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny)
{
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
-//void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny )
-//{
-// rAny = rxPropertySet->getPropertyValue( rPropertyName );
-//}
-/* -----------------29.06.98 09:55-------------------
- *
- * --------------------------------------------------*/
-sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, sal_Bool& rSizeFound)
+
+bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound)
{
- sal_Bool bRet = sal_True;
+ bool bRet = true;
//Anker kommt auf jeden Fall in den Set
SwFmtAnchor aAnchor ( static_cast < const SwFmtAnchor & > ( rFromSet.Get ( RES_ANCHOR ) ) );
{
@@ -450,7 +435,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
if( pWidth || pHeight ||pRelH || pRelW || pSize ||pSizeType ||
pWidthType ||pSyncWidth || pSyncHeight )
{
- rSizeFound = sal_True;
+ rSizeFound = true;
SwFmtFrmSize aFrmSz ( static_cast < const :: SwFmtFrmSize& > ( rFromSet.Get ( RES_FRM_SIZE ) ) );
if(pWidth)
bRet &= ((SfxPoolItem&)aFrmSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS);
@@ -478,7 +463,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
}
else
{
- rSizeFound = sal_False;
+ rSizeFound = false;
SwFmtFrmSize aFrmSz;
awt::Size aSize;
aSize.Width = 2 * MM50;
@@ -506,7 +491,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
rToSet.Put(aAttr);
}
- // DVO, OD 01.10.2003 #i18732#
+ // #i18732#
const ::uno::Any* pFollowTextFlow = 0;
GetProperty(RES_FOLLOW_TEXT_FLOW, 0, pFollowTextFlow);
if ( pFollowTextFlow )
@@ -516,7 +501,7 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
rToSet.Put(aFmtFollowTextFlow);
}
- // OD 2004-05-04 #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS
+ // #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS
const ::uno::Any* pWrapInfluenceOnObjPos = 0;
GetProperty(RES_WRAP_INFLUENCE_ON_OBJPOS, MID_WRAP_INFLUENCE, pWrapInfluenceOnObjPos);
if ( pWrapInfluenceOnObjPos )
@@ -528,31 +513,21 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
return bRet;
}
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
class SwFrameProperties_Impl : public BaseFrameProperties_Impl
{
-protected:
-// SwFrameProperties_Impl(/*const :: SfxItemPropertyMap* pMap*/) :
-// BaseFrameProperties_Impl(/*pMap*/){}
public:
SwFrameProperties_Impl();
virtual ~SwFrameProperties_Impl(){}
- virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
+ bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound);
};
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
+
SwFrameProperties_Impl::SwFrameProperties_Impl():
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ )
{
}
-/* -----------------22.06.98 11:27-------------------
- *
- * --------------------------------------------------*/
+
inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const :: uno::Any *pAny)
{
if ( pAny )
@@ -562,12 +537,13 @@ inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, con
rToSet.Put(aCol);
}
}
-sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItemSet&, sal_Bool& rSizeFound)
+
+bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItemSet&, bool& rSizeFound)
{
//Properties fuer alle Frames
const ::uno::Any *pStyleName;
SwDocStyleSheet* pStyle = NULL;
- sal_Bool bRet;
+ bool bRet;
if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
{
@@ -601,6 +577,7 @@ sal_Bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet,
}
return bRet;
}
+
/****************************************************************************
Grafik-Descriptor
****************************************************************************/
@@ -610,20 +587,15 @@ public:
SwGraphicProperties_Impl();
virtual ~SwGraphicProperties_Impl(){}
- virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
+ virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound);
};
-/* -----------------27.06.98 14:53-------------------
- *
- * --------------------------------------------------*/
+
SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) :
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ )
{
}
-/* -----------------27.06.98 14:40-------------------
- *
- * --------------------------------------------------*/
-inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, sal_Bool &rRet )
+inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, bool &rRet )
{
if(pHEvenMirror || pHOddMirror || pVMirror )
{
@@ -638,14 +610,14 @@ inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet,
}
}
-sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
+bool SwGraphicProperties_Impl::AnyToItemSet(
SwDoc* pDoc,
SfxItemSet& rFrmSet,
SfxItemSet& rGrSet,
- sal_Bool& rSizeFound)
+ bool& rSizeFound)
{
//Properties fuer alle Frames
- sal_Bool bRet;
+ bool bRet;
const ::uno::Any *pStyleName;
SwDocStyleSheet* pStyle = NULL;
@@ -709,9 +681,6 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
return bRet;
}
-/* -----------------4/1/2003 13:54-------------------
-
- --------------------------------------------------*/
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
@@ -720,14 +689,11 @@ public:
SwFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT)*/ ){}
virtual ~SwOLEProperties_Impl(){}
- virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
+ virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound);
};
-/* -----------------4/1/2003 15:32-------------------
-
- --------------------------------------------------*/
-sal_Bool SwOLEProperties_Impl::AnyToItemSet(
- SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound)
+bool SwOLEProperties_Impl::AnyToItemSet(
+ SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound)
{
const ::uno::Any* pTemp;
if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp) )
@@ -740,17 +706,12 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet(
/******************************************************************
* SwXFrame
******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -762,30 +723,21 @@ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& r
}
return 0;
}
-/*-----------------24.03.98 14:49-------------------
-
---------------------------------------------------*/
TYPEINIT1(SwXFrame, SwClient);
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFrame");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
{
return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")||
!rServiceName.compareToAscii("com.sun.star.text.TextContent") ||
!rServiceName.compareToAscii("com.sun.star.document.LinkTarget");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(3);
@@ -796,8 +748,7 @@ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::R
return aRet;
}
-
-/*-- 14.01.99 11:31:52---------------------------------------------------
+/*-----------------------------------------------------------------------
Dieser CTor legt den Frame als Descriptor an
-----------------------------------------------------------------------*/
SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pDoc) :
@@ -805,7 +756,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pD
m_pPropSet(pSet),
m_pDoc ( pDoc ),
eType(eSet),
- bIsDescriptor(sal_True),
+ bIsDescriptor(true),
m_pCopySource( 0 )
{
// Register ourselves as a listener to the document (via the page descriptor)
@@ -851,9 +802,6 @@ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pD
}
}
-/*-- 11.12.98 15:05:01---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertySet* pSet) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (container::XNamed*)this),
@@ -861,28 +809,21 @@ SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertyS
m_pDoc( 0 ),
eType(eSet),
pProps(0),
- bIsDescriptor(sal_False),
+ bIsDescriptor(false),
m_pCopySource(0)
{
}
-/*-- 11.12.98 15:05:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFrame::~SwXFrame()
{
delete m_pCopySource;
delete pProps;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
-/*-- 11.12.98 15:05:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXFrame::getName(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String sRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -893,12 +834,10 @@ OUString SwXFrame::getName(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return sRet;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
String sTmpName(rName);
if(pFmt)
@@ -914,9 +853,7 @@ void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) throw( uno::RuntimeException )
{
uno::Reference< beans::XPropertySetInfo > xRef;
@@ -945,9 +882,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) th
}
return xRef;
}
-/*-- 15.05.06 12:21:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::SetSelection(SwPaM& rCopySource)
{
if(m_pCopySource)
@@ -956,9 +891,6 @@ void SwXFrame::SetSelection(SwPaM& rCopySource)
m_pCopySource->SetMark();
*m_pCopySource->GetMark() = *rCopySource.End();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
{
@@ -994,7 +926,7 @@ SwFrmFmt *lcl_GetFrmFmt( const :: uno::Any& rValue, SwDoc *pDoc )
OUString uTemp;
rValue >>= uTemp;
String sStyle;
- SwStyleNameMapper::FillUIName(String (uTemp), sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, sal_True );
+ SwStyleNameMapper::FillUIName(String (uTemp), sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true);
SwDocStyleSheet* pStyle =
(SwDocStyleSheet*)pDocSh->GetStyleSheetPool()->Find(sStyle,
SFX_STYLE_FAMILY_FRAME);
@@ -1008,7 +940,7 @@ SwFrmFmt *lcl_GetFrmFmt( const :: uno::Any& rValue, SwDoc *pDoc )
void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
const :: SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName);
@@ -1017,12 +949,12 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
if(pFmt)
{
- sal_Bool bNextFrame = sal_False;
+ bool bNextFrame = false;
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw beans::PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
SwDoc* pDoc = pFmt->GetDoc();
- if ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID) ||
+ if ( ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) ||
(FN_PARAM_COUNTOUR_PP == pEntry->nWID) ||
(FN_UNO_IS_AUTOMATIC_CONTOUR == pEntry->nWID) ||
(FN_UNO_IS_PIXEL_CONTOUR == pEntry->nWID) )
@@ -1103,7 +1035,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
else if( FN_UNO_TITLE == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
OUString uTemp;
aValue >>= uTemp;
@@ -1116,7 +1048,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
else if( FN_UNO_DESCRIPTION == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
OUString uTemp;
aValue >>= uTemp;
@@ -1149,7 +1081,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
if ( pFly )
{
const :: SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_ANCHOR, sal_False, &pItem ))
+ if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_ANCHOR, false, &pItem ))
{
pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrmFmtSetRange );
pSet->Put( *pItem );
@@ -1347,7 +1279,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId)
{
- sal_Bool bDone = sal_False;
+ bool bDone = false;
uno::Reference<text::XTextFrame> xFrame;
if(aValue >>= xFrame)
{
@@ -1368,7 +1300,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
aAnchor.SetType(FLY_AT_FLY);
aSet.Put(aAnchor);
pDoc->SetFlyFrmAttr( *pFmt, aSet );
- bDone = sal_True;
+ bDone = true;
}
}
if(!bDone)
@@ -1426,7 +1358,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
if (pFly)
{
const :: SfxPoolItem* pItem;
- if( SFX_ITEM_SET == aSet.GetItemState( RES_ANCHOR, sal_False, &pItem ))
+ if( SFX_ITEM_SET == aSet.GetItemState( RES_ANCHOR, false, &pItem ))
{
aSet.Put( *pItem );
::lcl_ChkAndSetNewAnchor( *pFly, aSet );
@@ -1471,13 +1403,11 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aAny;
SwFrmFmt* pFmt = GetFrmFmt();
const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName);
@@ -1565,7 +1495,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
else
{
- String sPrefix( RTL_CONSTASCII_STRINGPARAM(sGraphicObjectProtocol) );
+ String sPrefix( RTL_CONSTASCII_USTRINGPARAM(sGraphicObjectProtocol) );
String sId( pGrfNode->GetGrfObj().GetUniqueID(),
RTL_TEXTENCODING_ASCII_US );
(sGrfName = sPrefix) += sId;
@@ -1612,7 +1542,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
else if( FN_UNO_TITLE == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
// assure that <SdrObject> instance exists.
GetOrCreateSdrObject( pFlyFmt );
@@ -1622,7 +1552,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
else if( FN_UNO_DESCRIPTION == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
// assure that <SdrObject> instance exists.
GetOrCreateSdrObject( pFlyFmt );
@@ -1682,7 +1612,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
if ( FN_EMBEDDED_OBJECT == pEntry->nWID )
{
// ensure the
- ASSERT( pDoc->GetDocShell(), "no doc shell => no client site" );
+ OSL_ENSURE( pDoc->GetDocShell(), "no doc shell => no client site" );
if ( pDoc->GetDocShell() )
pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xIP, embed::Aspects::MSOLE_CONTENT ) );
aAny <<= xIP;
@@ -1743,63 +1673,51 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw uno::RuntimeException();
return aAny;
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 12.09.00 14:04:53---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aPropertyNames(1);
OUString* pNames = aPropertyNames.getArray();
pNames[0] = rPropertyName;
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aPropertyNames);
return aStates.getConstArray()[0];
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
const uno::Sequence< OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< beans::PropertyState > aStates(aPropertyNames.getLength());
beans::PropertyState* pStates = aStates.getArray();
SwFrmFmt* pFmt = GetFrmFmt();
@@ -1858,13 +1776,11 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
throw uno::RuntimeException();
return aStates;
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -1874,7 +1790,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 ) );
- sal_Bool bNextFrame;
+ bool bNextFrame;
if( pEntry->nWID &&
pEntry->nWID != FN_UNO_ANCHOR_TYPES &&
pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME)
@@ -1910,7 +1826,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
else if( FN_UNO_TITLE == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
// assure that <SdrObject> instance exists.
GetOrCreateSdrObject( pFlyFmt );
@@ -1920,7 +1836,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
else if( FN_UNO_DESCRIPTION == pEntry->nWID )
{
SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(pFmt);
- ASSERT( pFmt,
+ OSL_ENSURE( pFmt,
"unexpected type of <pFmt> --> crash" );
// assure that <SdrObject> instance exists.
GetOrCreateSdrObject( pFlyFmt );
@@ -1957,13 +1873,11 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
}
-/*-- 12.09.00 14:04:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -1985,26 +1899,20 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:06---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -2017,12 +1925,9 @@ void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXFrame::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if ( pFmt )
{
@@ -2048,12 +1953,10 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException )
}
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2072,23 +1975,19 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim
throw uno::RuntimeException();
return aRef;
}
-/* -----------------14.01.99 12:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::ResetDescriptor()
{
- bIsDescriptor = sal_False;
+ bIsDescriptor = false;
mxStyleData.clear();
mxStyleFamily.clear();
DELETEZ(pProps);
}
-/* -----------------18.02.99 13:34-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsDescriptor())
throw uno::RuntimeException();
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
@@ -2106,20 +2005,20 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
if(pDoc)
{
SwUnoInternalPaM aIntPam(*pDoc);
- //das muss jetzt sal_True liefern
+ //das muss jetzt true liefern
::sw::XTextRangeToSwPaM(aIntPam, xTextRange);
SwNode& rNode = pDoc->GetNodes().GetEndOfContent();
SwPaM aPam(rNode);
aPam.Move( fnMoveBackward, fnGoDoc );
- static sal_uInt16 __READONLY_DATA aFrmAttrRange[] =
+ static sal_uInt16 const aFrmAttrRange[] =
{
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER,
0
};
- static sal_uInt16 __READONLY_DATA aGrAttrRange[] =
+ static sal_uInt16 const aGrAttrRange[] =
{
RES_GRFATR_BEGIN, RES_GRFATR_END-1,
0
@@ -2128,7 +2027,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
SfxItemSet aFrmSet(pDoc->GetAttrPool(), aFrmAttrRange );
//jetzt muessen die passenden Items in den Set
- sal_Bool bSizeFound;
+ bool bSizeFound;
if(!pProps->AnyToItemSet( pDoc, aFrmSet, aGrSet, bSizeFound))
throw lang::IllegalArgumentException();
//der TextRange wird einzeln behandelt
@@ -2141,7 +2040,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
const SfxPoolItem* pItem;
RndStdIds eAnchorId = FLY_AT_PARA;
- if(SFX_ITEM_SET == aFrmSet.GetItemState(RES_ANCHOR, sal_False, &pItem) )
+ if(SFX_ITEM_SET == aFrmSet.GetItemState(RES_ANCHOR, false, &pItem) )
{
eAnchorId = ((const SwFmtAnchor*)pItem)->GetAnchorId();
if( FLY_AT_FLY == eAnchorId &&
@@ -2272,22 +2171,19 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
}
const ::uno::Any* pSurroundContour;
if(pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUR, pSurroundContour))
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SURROUND_CONTOUR)), *pSurroundContour);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SURROUND_CONTOUR)), *pSurroundContour);
const ::uno::Any* pContourOutside;
if(pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUROUTSIDE, pContourOutside))
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_OUTSIDE)), *pContourOutside);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_OUTSIDE)), *pContourOutside);
const ::uno::Any* pContourPoly;
if(pProps->GetProperty(FN_PARAM_COUNTOUR_PP, 0, pContourPoly))
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_POLY_POLYGON)), *pContourPoly);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_CONTOUR_POLY_POLYGON)), *pContourPoly);
const ::uno::Any* pPixelContour;
if(pProps->GetProperty(FN_UNO_IS_PIXEL_CONTOUR, 0, pPixelContour))
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_PIXEL_CONTOUR)), *pPixelContour);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_PIXEL_CONTOUR)), *pPixelContour);
const ::uno::Any* pAutoContour;
if(pProps->GetProperty(FN_UNO_IS_AUTOMATIC_CONTOUR, 0, pAutoContour))
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_AUTOMATIC_CONTOUR)), *pAutoContour);
-// const ::uno::Any* pAltText;
-// if(pProps->GetProperty(FN_UNO_ALTERNATIVE_TEXT, 0, pAltText))
-// setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ALTERNATIVE_TEXT)), *pAltText);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_AUTOMATIC_CONTOUR)), *pAutoContour);
}
else
{
@@ -2306,7 +2202,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
if( !aClassName.MakeId( aCLSID ) )
{
lang::IllegalArgumentException aExcept;
- aExcept.Message = OUString::createFromAscii("CLSID invalid");
+ aExcept.Message = OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID invalid"));
throw aExcept;
}
@@ -2366,7 +2262,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
::svt::EmbeddedObjectRef xObjRef( xIPObj, nAspect );
pFmt2 = pDoc->Insert(aPam, xObjRef, &aFrmSet, NULL, NULL );
- ASSERT( pFmt2, "Doc->Insert(notxt) failed." );
+ OSL_ENSURE( pFmt2, "Doc->Insert(notxt) failed." );
pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL);
pFmt2->Add(this);
@@ -2392,33 +2288,29 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
GetOrCreateSdrObject( pFmt );
const ::uno::Any* pOrder;
if( pProps->GetProperty(FN_UNO_Z_ORDER, 0, pOrder) )
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_Z_ORDER)), *pOrder);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_Z_ORDER)), *pOrder);
const ::uno::Any* pReplacement;
if( pProps->GetProperty(FN_UNO_REPLACEMENT_GRAPHIC, 0, pReplacement) )
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_GRAPHIC)), *pReplacement);
- // --> OD 2009-07-13 #i73249#
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_GRAPHIC)), *pReplacement);
// new attribute Title
const ::uno::Any* pTitle;
if ( pProps->GetProperty(FN_UNO_TITLE, 0, pTitle) )
{
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_TITLE)), *pTitle);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_TITLE)), *pTitle);
}
// new attribute Description
const ::uno::Any* pDescription;
if ( pProps->GetProperty(FN_UNO_DESCRIPTION, 0, pDescription) )
{
- setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_DESCRIPTION)), *pDescription);
+ setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_DESCRIPTION)), *pDescription);
}
- // <--
}
else
throw lang::IllegalArgumentException();
//setzt das Flag zurueck und loescht den Descriptor-Pointer
ResetDescriptor();
}
-/* -----------------------------04.04.01 14:27--------------------------------
- ---------------------------------------------------------------------------*/
void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2428,21 +2320,11 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
else if(0 != (pFmt = GetFrmFmt()))
{
uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
- SwXTextRange* pRange = 0;
- OTextCursorHelper* pCursor = 0;
- if(xRangeTunnel.is())
- {
- pRange = reinterpret_cast< SwXTextRange * >(
- sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) ));
- pCursor = reinterpret_cast< OTextCursorHelper * >(
- sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
- }
SwDoc* pDoc = pFmt->GetDoc();
SwUnoInternalPaM aIntPam(*pDoc);
if (::sw::XTextRangeToSwPaM(aIntPam, xTextRange))
{
- SfxItemSet aSet( pDoc->GetAttrPool(),
- RES_ANCHOR, RES_ANCHOR );
+ SfxItemSet aSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR );
aSet.SetParent(&pFmt->GetAttrSet());
SwFmtAnchor aAnchor = (const SwFmtAnchor&)aSet.Get(RES_ANCHOR);
aAnchor.SetAnchor( aIntPam.Start() );
@@ -2453,96 +2335,72 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw lang::IllegalArgumentException();
}
}
-/*-- 22.04.99 08:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::RuntimeException aRuntime;
aRuntime.Message = C2U("position cannot be determined with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::RuntimeException aRuntime;
aRuntime.Message = C2U("position cannot be changed with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException )
{
const ::uno::Any aVal = getPropertyValue(C2U("Size"));
awt::Size* pRet = (awt::Size*)aVal.getValue();
return *pRet;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setSize(const awt::Size& aSize)
throw( beans::PropertyVetoException, uno::RuntimeException )
{
const ::uno::Any aVal(&aSize, ::getCppuType(static_cast<const awt::Size*>(0)));
setPropertyValue(C2U("Size"), aVal);
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException )
{
return C2U("FrameShape");
}
-
/******************************************************************
* SwXTextFrame
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) :
SwXText(0, CURSOR_FRAME),
SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME), _pDoc )
{
}
-/*-- 11.12.98 15:23:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame(SwFrmFmt& rFmt) :
SwXText(rFmt.GetDoc(), CURSOR_FRAME),
SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME))
{
}
-/*-- 11.12.98 15:23:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::~SwXTextFrame()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -2553,9 +2411,7 @@ void SAL_CALL SwXTextFrame::release( )throw()
aRet = SwXTextFrameBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextFrameTypes = SwXTextFrameBaseClass::getTypes();
@@ -2580,31 +2436,25 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim
return aTextFrameTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
+ static bool bInit = false;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
+ rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
+ bInit = true;
}
return aId;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException )
{
return this;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXTextFrame::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -2625,12 +2475,10 @@ SwXTextFrame::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextCursor > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2674,12 +2522,10 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw(
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextCursor > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
SwUnoInternalPaM aPam(*GetDoc());
@@ -2703,100 +2549,78 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< container::XEnumeration > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
SwPosition aPos(pFmt->GetCntnt().GetCntntIdx()->GetNode());
::std::auto_ptr<SwUnoCrsr> pUnoCursor(
- GetDoc()->CreateUnoCrsr(aPos, sal_False));
+ GetDoc()->CreateUnoCrsr(aPos, false));
pUnoCursor->Move(fnMoveForward, fnGoNode);
// // no Cursor in protected sections
// SwCrsrSaveState aSave( *pUnoCrsr );
-// if(pUnoCrsr->IsInProtectTable( sal_True ) ||
+// if(pUnoCrsr->IsInProtectTable(true) ||
// pUnoCrsr->IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS ))
// throw uno::RuntimeException() );
aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_FRAME);
}
return aRef;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFrame::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<uno::Reference<text::XTextRange>*>(0));
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFrame::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextFrame::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwXFrame::dispose();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFrame");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")||
COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
@@ -2806,16 +2630,12 @@ uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( un
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.Text");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextFrame::operator new( size_t t) throw()
{
return SwXTextFrameBaseClass::operator new( t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::operator delete( void * p) throw()
{
SwXTextFrameBaseClass::operator delete(p);
@@ -2826,9 +2646,7 @@ uno::Reference<container::XNameReplace > SAL_CALL SwXTextFrame::getEvents()
{
return new SwFrameEventDescriptor( *this );
}
-/* -----------------------------10.01.01 13:27--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2838,13 +2656,11 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
return nRet;
}
-/* -----------------------------19.03.2002 16:43------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
::uno::Any aRet;
if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE))||
rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE)))
@@ -2857,48 +2673,36 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
aRet = SwXFrame::getPropertyValue(rPropertyName);
return aRet;
}
+
/******************************************************************
* SwXTextGraphicObject
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc)
{
}
-/*-- 11.12.98 16:02:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC))
{
}
-/*-- 11.12.98 16:02:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::~SwXTextGraphicObject()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType )
throw(uno::RuntimeException)
{
@@ -2907,9 +2711,7 @@ void SAL_CALL SwXTextGraphicObject::release( )throw()
aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXTextGraphicObject::getTypes( ) throw(uno::RuntimeException)
{
@@ -2929,78 +2731,60 @@ uno::Sequence< uno::Type > SAL_CALL
return aGraphicTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
+ static bool bInit = false;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
+ rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
+ bInit = true;
}
return aId;
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextGraphicObject::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:02:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwXFrame::dispose();
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextGraphicObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") ||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3010,23 +2794,17 @@ uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextGraphicObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextGraphicObject::operator new( size_t t) throw()
{
return SwXTextGraphicObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::operator delete( void * p) throw()
{
SwXTextGraphicObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextGraphicObject::getEvents()
throw(uno::RuntimeException)
@@ -3034,51 +2812,32 @@ uno::Reference<container::XNameReplace> SAL_CALL
return new SwFrameEventDescriptor( *this );
}
-/******************************************************************
- *
- ******************************************************************/
-/*-- 11.12.98 16:16:53---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc)
{
}
-/*-- 11.12.98 16:16:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT))
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::~SwXTextEmbeddedObject()
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::acquire()throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::release()throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException)
{
@@ -3087,9 +2846,7 @@ void SAL_CALL SwXTextEmbeddedObject::release()throw()
aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass::getTypes();
@@ -3109,61 +2866,46 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un
return aTextEmbeddedTypes;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
+ static bool bInit = false;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
+ rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
+ bInit = true;
}
return aId;
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextEmbeddedObject::getAnchor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwXFrame::dispose();
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( uno::RuntimeException )
{
@@ -3206,11 +2948,6 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
return xRet;
}
-/* --18.05.2006 16:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
-
uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject()
throw( uno::RuntimeException )
{
@@ -3304,25 +3041,18 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme
return uno::Reference< graphic::XGraphic >();
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextEmbeddedObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3332,23 +3062,17 @@ uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextEmbeddedObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextEmbeddedObject::operator new( size_t t) throw()
{
return SwXTextEmbeddedObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::operator delete( void * p) throw()
{
SwXTextEmbeddedObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextEmbeddedObject::getEvents()
throw(uno::RuntimeException)
@@ -3356,29 +3080,21 @@ uno::Reference<container::XNameReplace> SAL_CALL
return new SwFrameEventDescriptor( *this );
}
-
-/******************************************************************
- *
- ******************************************************************/
TYPEINIT1(SwXOLEListener, SwClient);
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) :
SwClient(&rOLEFmt),
xOLEModel(xOLE)
{
}
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::~SwXOLEListener()
{}
void SwXOLEListener::modified( const lang::EventObject& /*rEvent*/ )
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwOLENode* pNd = 0;
SwFmt* pFmt = GetFmt();
@@ -3403,17 +3119,14 @@ void SwXOLEListener::modified( const lang::EventObject& /*rEvent*/ )
}
// if the OLE-Node is UI-Active do nothing
- pNd->SetOLESizeInvalid( sal_True );
+ pNd->SetOLESizeInvalid(true);
pNd->GetDoc()->SetOLEObjModified();
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
void SwXOLEListener::disposing( const lang::EventObject& rEvent )
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< util::XModifyListener > xListener( this );
@@ -3428,12 +3141,10 @@ void SwXOLEListener::disposing( const lang::EventObject& rEvent )
}
catch(uno::Exception const &)
{
- DBG_ERROR("OLE Listener couldn't be removed");
+ OSL_FAIL("OLE Listener couldn't be removed");
}
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
ClientModify(this, pOld, pNew);
@@ -3441,3 +3152,4 @@ void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
xOLEModel = 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index d0d74fa023c7..1e6f98b63496 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <rtl/uuid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
@@ -57,7 +58,6 @@ using ::rtl::OUString;
/******************************************************************
* SwXFootnote
******************************************************************/
-
class SwXFootnote::Impl
: public SwClient
{
@@ -105,9 +105,6 @@ public:
};
-/* -----------------------------07.01.00 12:39--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwXFootnote::Impl::Invalidate()
{
if (GetRegisteredIn())
@@ -119,9 +116,6 @@ void SwXFootnote::Impl::Invalidate()
m_rThis.SetDoc(0);
}
-/* -----------------18.01.99 09:12-------------------
- *
- * --------------------------------------------------*/
void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -145,25 +139,18 @@ void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 10.12.98 15:31:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXFootnote::SwXFootnote(const bool bEndnote)
: SwXText(0, CURSOR_FOOTNOTE)
, m_pImpl( new SwXFootnote::Impl(*this, 0, 0, bEndnote) )
{
}
-/*-- 10.12.98 15:31:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnote::SwXFootnote(SwDoc & rDoc, const SwFmtFtn& rFmt)
: SwXText(& rDoc, CURSOR_FOOTNOTE)
, m_pImpl( new SwXFootnote::Impl(*this, &rDoc, &rFmt, rFmt.IsEndNote()) )
{
}
-/*-- 10.12.98 15:31:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnote::~SwXFootnote()
{
}
@@ -177,24 +164,6 @@ SwXFootnote::GetXFootnote(
// to do this properly requires the SwXFootnote to register at the
// SwFmtFtn directly, not at the unocallback
// also this function must return a uno Reference!
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXFootnote::Impl * pXFootnote = static_cast<SwXFootnote::Impl*>(
- aIter.First( TYPE( SwXFootnote::Impl )));
- while (pXFootnote)
- {
- SwDoc *const pDoc = pXFootnote->m_rThis.GetDoc();
- if (pDoc)
- {
- SwFmtFtn const*const pFtn = pXFootnote->GetFootnoteFormat();
- if (pFtn == &rFootnoteFmt)
- {
- return & pXFootnote->m_rThis;
- }
- }
- pXFootnote = static_cast<SwXFootnote::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
@@ -208,17 +177,12 @@ SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt)
: new SwXFootnote(rDoc, rFootnoteFmt);
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXFootnote::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -227,18 +191,12 @@ throw (uno::RuntimeException)
return (nRet) ? nRet : SwXText::getSomething(rId);
}
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXFootnote::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXFootnote");
}
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesFootnote[] =
{
"com.sun.star.text.TextContent",
@@ -246,14 +204,16 @@ static char const*const g_ServicesFootnote[] =
"com.sun.star.text.Text",
"com.sun.star.text.Endnote", // NB: only supported for endnotes!
};
+
static const size_t g_nServicesEndnote(
- sizeof(g_ServicesFootnote)/sizeof(g_ServicesFootnote[0]));
+ SAL_N_ELEMENTS(g_ServicesFootnote));
+
static const size_t g_nServicesFootnote( g_nServicesEndnote - 1 ); // NB: omit!
sal_Bool SAL_CALL SwXFootnote::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return ::sw::SupportsServiceImpl(
(m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote,
g_ServicesFootnote, rServiceName);
@@ -262,15 +222,12 @@ throw (uno::RuntimeException)
uno::Sequence< OUString > SAL_CALL
SwXFootnote::getSupportedServiceNames() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return ::sw::GetSupportedServiceNamesImpl(
(m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote,
g_ServicesFootnote);
}
-/* -----------------------------21.03.00 15:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXFootnote::getTypes() throw (uno::RuntimeException)
{
@@ -279,13 +236,10 @@ SwXFootnote::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
-/* -----------------------------21.03.00 15:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL
SwXFootnote::getImplementationId() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -295,9 +249,7 @@ SwXFootnote::getImplementationId() throw (uno::RuntimeException)
}
return aId;
}
-/* -----------------------------21.03.00 15:46--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXFootnote::queryInterface(const uno::Type& rType)
throw (uno::RuntimeException)
@@ -308,12 +260,9 @@ throw (uno::RuntimeException)
: ret;
}
-/*-- 10.12.98 15:31:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXFootnote::getLabel() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
::rtl::OUString sRet;
SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat();
@@ -332,13 +281,10 @@ OUString SAL_CALL SwXFootnote::getLabel() throw (uno::RuntimeException)
return sRet;
}
-/*-- 10.12.98 15:31:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat();
if(pFmt)
@@ -360,14 +306,11 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException)
}
}
-/* -----------------18.02.99 13:32-------------------
- *
- * --------------------------------------------------*/
void SAL_CALL
SwXFootnote::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_bIsDescriptor)
{
@@ -432,13 +375,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
SetDoc(pNewDoc);
}
-/*-- 10.12.98 15:31:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXFootnote::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
@@ -451,12 +391,10 @@ SwXFootnote::getAnchor() throw (uno::RuntimeException)
SwXTextRange::CreateXTextRange(*GetDoc(), *aPam.Start(), aPam.End());
return xRet;
}
-/*-- 10.12.98 15:31:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
@@ -468,15 +406,12 @@ void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException)
GetDoc()->DeleteAndJoin( aPam );
}
-/*-- 10.12.98 15:31:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXFootnote::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetFootnoteFormat())
{
@@ -484,15 +419,13 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 10.12.98 15:31:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXFootnote::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetFootnoteFormat() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -501,9 +434,6 @@ throw (uno::RuntimeException)
}
}
-/* -----------------06.05.99 15:31-------------------
- *
- * --------------------------------------------------*/
const SwStartNode *SwXFootnote::GetStartNode() const
{
SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat();
@@ -524,13 +454,10 @@ SwXFootnote::CreateCursor() throw (uno::RuntimeException)
return createTextCursor();
}
-/*-- 10.12.98 15:31:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXFootnote::createTextCursor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
@@ -545,15 +472,12 @@ SwXFootnote::createTextCursor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 10.12.98 15:31:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXFootnote::createTextCursorByRange(
const uno::Reference< text::XTextRange > & xTextPosition)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
@@ -579,13 +503,10 @@ throw (uno::RuntimeException)
return xRet;
}
-/*-- 13.06.00 14:28:23---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXFootnote::createEnumeration() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
@@ -599,38 +520,27 @@ SwXFootnote::createEnumeration() throw (uno::RuntimeException)
return xRet;
}
-/*-- 13.06.00 14:28:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXFootnote::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/*-- 13.06.00 14:28:24---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXFootnote::hasElements() throw (uno::RuntimeException)
{
return sal_True;
}
-/*-- 11.09.00 13:12:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXFootnote::getPropertySetInfo()
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRet =
aSwMapProvider.GetPropertySet(PROPERTY_MAP_FOOTNOTE)
->getPropertySetInfo();
return xRet;
}
-/*-- 11.09.00 13:12:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXFootnote::setPropertyValue(const ::rtl::OUString&, const uno::Any&)
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -640,15 +550,13 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
//no values to be set
throw lang::IllegalArgumentException();
}
-/*-- 11.09.00 13:12:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXFootnote::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName))
@@ -683,9 +591,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 11.09.00 13:12:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXFootnote::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -730,3 +635,4 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXFootnote::removeVetoableChangeListener(): not implemented");
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 7fc598921b72..c94bdb72151b 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,15 +38,9 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <tools/debug.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <editeng/unolingu.hxx>
-#include <com/sun/star/text/ChapterFormat.hpp>
-#include <com/sun/star/text/ReferenceFieldPart.hpp>
-#include <com/sun/star/text/BibliographyDataField.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/text/XTextDocument.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <hints.hxx>
#include <cmdid.h>
#include <swtypes.hxx>
@@ -76,7 +71,6 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-//-----------------------------------------------------------------------------
static OUString
lcl_AnyToString(uno::Any const& rVal) throw (lang::IllegalArgumentException)
{
@@ -87,7 +81,7 @@ lcl_AnyToString(uno::Any const& rVal) throw (lang::IllegalArgumentException)
}
return sRet;
}
-//-----------------------------------------------------------------------------
+
static sal_Int16
lcl_AnyToInt16(uno::Any const& rVal) throw (lang::IllegalArgumentException)
{
@@ -98,7 +92,7 @@ lcl_AnyToInt16(uno::Any const& rVal) throw (lang::IllegalArgumentException)
}
return nRet;
}
-//-----------------------------------------------------------------------------
+
static sal_Bool
lcl_AnyToBool(uno::Any const& rVal) throw (lang::IllegalArgumentException)
{
@@ -119,6 +113,7 @@ throw (lang::IllegalArgumentException)
? (rBitMask | nBit)
: (rBitMask & ~nBit);
}
+
static void
lcl_BitMaskToAny(uno::Any & o_rValue,
const sal_uInt16 nBitMask, const sal_uInt16 nBit)
@@ -127,7 +122,6 @@ lcl_BitMaskToAny(uno::Any & o_rValue,
o_rValue <<= bRet;
}
-//-----------------------------------------------------------------------------
static void
lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName)
{
@@ -150,7 +144,7 @@ lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName)
//has to be non-const-casted
((SwTOXType*)pNewType)->Add(&rTOXBase);
}
-//-----------------------------------------------------------------------------
+
static const char cUserDefined[] = "User-Defined";
static const char cUserSuffix[] = " (user)";
#define USER_LEN 12
@@ -171,7 +165,7 @@ void lcl_ConvertTOUNameToProgrammaticName(OUString& rTmp)
rTmp += C2U(cUserSuffix);
}
}
-//-----------------------------------------------------------------------------
+
static void
lcl_ConvertTOUNameToUserName(OUString& rTmp)
{
@@ -192,9 +186,6 @@ lcl_ConvertTOUNameToUserName(OUString& rTmp)
}
}
-/* -----------------13.09.99 16:39-------------------
-
- --------------------------------------------------*/
typedef ::cppu::WeakImplHelper2
< lang::XServiceInfo
, container::XIndexReplace
@@ -240,9 +231,6 @@ public:
};
-/* -----------------13.09.99 16:39-------------------
-
- --------------------------------------------------*/
typedef ::cppu::WeakImplHelper2
< lang::XServiceInfo
, container::XIndexReplace
@@ -289,14 +277,9 @@ public:
};
-
/******************************************************************
* SwXDocumentIndex
******************************************************************/
-
-/* -----------------20.06.98 11:06-------------------
- *
- * --------------------------------------------------*/
class SwDocIndexDescriptorProperties_Impl
{
private:
@@ -310,9 +293,7 @@ public:
const OUString& GetTypeName() const { return m_sUserTOXTypeName; }
void SetTypeName(const OUString& rSet) { m_sUserTOXTypeName = rSet; }
};
-/* -----------------20.06.98 11:41-------------------
- *
- * --------------------------------------------------*/
+
SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl(
SwTOXType const*const pType)
{
@@ -410,9 +391,6 @@ public:
};
-/*-- 14.12.98 09:35:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -423,26 +401,18 @@ void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 14.12.98 09:35:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndex::SwXDocumentIndex(
SwTOXBaseSection const& rBaseSection, SwDoc & rDoc)
: m_pImpl( new SwXDocumentIndex::Impl( *this,
rDoc, rBaseSection.SwTOXBase::GetType(), & rBaseSection) )
{
}
-/* -----------------15.01.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
SwXDocumentIndex::SwXDocumentIndex(const TOXTypes eType, SwDoc& rDoc)
: m_pImpl( new SwXDocumentIndex::Impl( *this, rDoc, eType, 0) )
{
}
-/*-- 14.12.98 09:35:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndex::~SwXDocumentIndex()
{
}
@@ -465,17 +435,12 @@ SwXDocumentIndex::CreateXDocumentIndex(
return xIndex;
}
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXDocumentIndex::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -483,46 +448,39 @@ throw (uno::RuntimeException)
return ::sw::UnoTunnelImpl<SwXDocumentIndex>(rId, this);
}
-/* -----------------------------06.04.00 15:01--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndex::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXDocumentIndex");
}
-/* -----------------------------06.04.00 15:01--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndex::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return C2U("com.sun.star.text.BaseIndex") == rServiceName
|| ((TOX_INDEX == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.DocumentIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.DocumentIndex")))
|| ((TOX_CONTENT == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.ContentIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.ContentIndex")))
|| ((TOX_USER == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.UserDefinedIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.UserDefinedIndex")))
|| ((TOX_ILLUSTRATIONS == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.IllustrationsIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.IllustrationsIndex")))
|| ((TOX_TABLES == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.TableIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TableIndex")))
|| ((TOX_OBJECTS == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.ObjectIndex"))
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.ObjectIndex")))
|| ((TOX_AUTHORITIES == m_pImpl->m_eTOXType) &&
- rServiceName.equalsAscii("com.sun.star.text.Bibliography"));
+ rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.Bibliography")));
}
-/* -----------------------------06.04.00 15:01--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXDocumentIndex::getSupportedServiceNames() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
uno::Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray();
@@ -554,13 +512,10 @@ SwXDocumentIndex::getSupportedServiceNames() throw (uno::RuntimeException)
return aRet;
}
-/*-- 14.12.98 09:35:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXDocumentIndex::getServiceName()
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
sal_uInt16 nObjectType = SW_SERVICE_TYPE_INDEX;
switch (m_pImpl->m_eTOXType)
@@ -584,12 +539,9 @@ throw (uno::RuntimeException)
return SwXServiceProvider::GetProviderName(nObjectType);
}
-/*-- 14.12.98 09:35:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
SwTOXBaseSection *const pTOXBase = (pFmt) ?
@@ -603,22 +555,16 @@ void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException)
pTOXBase->UpdatePageNum();
}
-/*-- 14.12.98 09:35:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXDocumentIndex::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
const uno::Reference< beans::XPropertySetInfo > xRef =
m_pImpl->m_rPropSet.getPropertySetInfo();
return xRef;
}
-/*-- 14.12.98 09:35:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue)
@@ -626,7 +572,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SfxItemPropertySimpleEntry const*const pEntry =
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
@@ -736,7 +682,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
case WID_CREATE_FROM_OUTLINE:
lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OUTLINELEVEL);
break;
-// case WID_PARAGRAPH_STYLE_NAMES :DBG_ERROR("not implemented")
+// case WID_PARAGRAPH_STYLE_NAMES :OSL_FAIL("not implemented")
// break;
case WID_CREATE_FROM_CHAPTER:
rTOXBase.SetFromChapter(lcl_AnyToBool(rValue));
@@ -936,15 +882,12 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
}
-/*-- 14.12.98 09:35:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SfxItemPropertySimpleEntry const*const pEntry =
@@ -1287,9 +1230,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 14.12.98 09:35:06---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1334,14 +1274,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXDocumentIndex::removeVetoableChangeListener(): not implemented");
}
-/* -----------------18.02.99 13:39-------------------
- *
- * --------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_bIsDescriptor)
{
@@ -1399,13 +1336,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->m_bIsDescriptor = sal_False;
}
-/*-- 15.01.99 14:23:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXDocumentIndex::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
if (!pSectionFmt)
@@ -1428,9 +1362,6 @@ SwXDocumentIndex::getAnchor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 15.01.99 15:46:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void lcl_RemoveChildSections(SwSectionFmt& rParentFmt)
{
SwSections aTmpArr;
@@ -1452,7 +1383,7 @@ void lcl_RemoveChildSections(SwSectionFmt& rParentFmt)
void SAL_CALL SwXDocumentIndex::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
if (pSectionFmt)
@@ -1463,15 +1394,12 @@ void SAL_CALL SwXDocumentIndex::dispose() throw (uno::RuntimeException)
}
}
-/*-- 15.01.99 15:46:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetRegisteredIn())
{
@@ -1479,15 +1407,13 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 15.01.99 15:46:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetRegisteredIn() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -1496,12 +1422,9 @@ throw (uno::RuntimeException)
}
}
-/* -----------------30.07.99 11:28-------------------
-
- --------------------------------------------------*/
OUString SAL_CALL SwXDocumentIndex::getName() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
OUString uRet;
SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
@@ -1519,13 +1442,11 @@ OUString SAL_CALL SwXDocumentIndex::getName() throw (uno::RuntimeException)
}
return uRet;
}
-/* -----------------30.07.99 11:28-------------------
- --------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::setName(const OUString& rName) throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!rName.getLength())
{
@@ -1574,9 +1495,6 @@ uno::Reference<frame::XModel> SwXDocumentIndex::GetModel()
/******************************************************************
* SwXDocumentIndexMark
******************************************************************/
-/* -----------------21.04.99 09:36-------------------
- *
- * --------------------------------------------------*/
static sal_uInt16
lcl_TypeToPropertyMap_Mark(const TOXTypes eType)
{
@@ -1671,9 +1589,6 @@ public:
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
};
-/* -----------------------------16.10.00 11:24--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwXDocumentIndexMark::Impl::Invalidate()
{
if (GetRegisteredIn())
@@ -1693,9 +1608,6 @@ void SwXDocumentIndexMark::Impl::Invalidate()
m_pTOXMark = 0;
}
-/*-- 14.12.98 10:25:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -1706,25 +1618,18 @@ void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 14.12.98 10:25:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndexMark::SwXDocumentIndexMark(const TOXTypes eToxType)
: m_pImpl( new SwXDocumentIndexMark::Impl(*this, 0, eToxType, 0, 0) )
{
}
-/*-- 14.12.98 10:25:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDocumentIndexMark::SwXDocumentIndexMark(SwDoc & rDoc,
SwTOXType & rType, SwTOXMark & rMark)
: m_pImpl( new SwXDocumentIndexMark::Impl(*this, &rDoc, rType.GetType(),
&rType, &rMark) )
{
}
-/*-- 14.12.98 10:25:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDocumentIndexMark::~SwXDocumentIndexMark()
{
}
@@ -1747,17 +1652,12 @@ SwXDocumentIndexMark::CreateXDocumentIndexMark(
return xTOXMark;
}
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXDocumentIndexMark::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1772,22 +1672,17 @@ static const sal_Char cIdxMarkAsian[] = "com.sun.star.text.DocumentIndexMarkAsi
static const sal_Char cUserMark[] = "com.sun.star.text.UserIndexMark";
static const sal_Char cTextContent[] = "com.sun.star.text.TextContent";
-/* -----------------------------06.04.00 15:07--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXDocumentIndexMark");
}
-/* -----------------------------06.04.00 15:07--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return rServiceName.equalsAscii(cBaseMark)
|| rServiceName.equalsAscii(cTextContent)
@@ -1800,13 +1695,11 @@ throw (uno::RuntimeException)
|| ((m_pImpl->m_eTOXType == TOX_INDEX)
&& rServiceName.equalsAscii(cIdxMarkAsian));
}
-/* -----------------------------06.04.00 15:07--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXDocumentIndexMark::getSupportedServiceNames() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
const sal_Int32 nCnt = (m_pImpl->m_eTOXType == TOX_INDEX) ? 4 : 3;
uno::Sequence< OUString > aRet(nCnt);
@@ -1832,13 +1725,10 @@ SwXDocumentIndexMark::getSupportedServiceNames() throw (uno::RuntimeException)
return aRet;
}
-/*-- 14.12.98 10:25:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndexMark::getMarkEntry() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sRet;
SwTOXType *const pType = m_pImpl->GetTOXType();
@@ -1856,14 +1746,12 @@ SwXDocumentIndexMark::getMarkEntry() throw (uno::RuntimeException)
}
return sRet;
}
-/*-- 14.12.98 10:25:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTOXType *const pType = m_pImpl->GetTOXType();
if (pType && m_pImpl->m_pTOXMark)
@@ -1893,15 +1781,12 @@ throw (uno::RuntimeException)
}
}
-/* -----------------18.02.99 13:40-------------------
- *
- * --------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::attach(
const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_bIsDescriptor)
{
@@ -1966,7 +1851,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
SwUnoInternalPaM aPam(*pDoc);
- //das muss jetzt sal_True liefern
+ //which must now return sal_True
::sw::XTextRangeToSwPaM(aPam, xTextRange);
SwTOXMark aMark (pTOXType);
if (m_pImpl->m_sAltText.getLength())
@@ -2105,13 +1990,10 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark(
const_cast<SwTOXType &>(rTOXType).Add(& m_TypeDepend);
}
-/*-- 14.12.98 10:25:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTOXType *const pType = m_pImpl->GetTOXType();
if (!pType || !m_pImpl->m_pTOXMark)
@@ -2142,13 +2024,10 @@ SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 14.12.98 10:25:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTOXType *const pType = m_pImpl->GetTOXType();
if (pType && m_pImpl->m_pTOXMark)
@@ -2156,15 +2035,13 @@ SwXDocumentIndexMark::dispose() throw (uno::RuntimeException)
m_pImpl->DeleteTOXMark(); // call Invalidate() via modify!
}
}
-/*-- 14.12.98 10:25:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetRegisteredIn())
{
@@ -2172,15 +2049,13 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 14.12.98 10:25:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetRegisteredIn() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -2189,13 +2064,10 @@ throw (uno::RuntimeException)
}
}
-/*-- 14.12.98 10:25:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXDocumentIndexMark::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xInfos[3];
int nPos = 0;
@@ -2221,9 +2093,6 @@ SwXDocumentIndexMark::getPropertySetInfo() throw (uno::RuntimeException)
return xInfos[nPos];
}
-/*-- 14.12.98 10:25:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue)
@@ -2231,7 +2100,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SfxItemPropertySimpleEntry const*const pEntry =
m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName);
@@ -2350,15 +2219,12 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
}
-/*-- 14.12.98 10:25:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SfxItemPropertySimpleEntry const*const pEntry =
@@ -2460,9 +2326,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 14.12.98 10:25:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndexMark::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -2507,27 +2370,18 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXDocumentIndexMark::removeVetoableChangeListener(): not implemented");
}
-
/******************************************************************
* SwXDocumentIndexes
******************************************************************/
-/*-- 05.05.99 13:14:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndexes::SwXDocumentIndexes(SwDoc *const _pDoc)
: SwUnoCollection(_pDoc)
{
}
-/*-- 05.05.99 13:15:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDocumentIndexes::~SwXDocumentIndexes()
{
}
-/* -----------------------------06.04.00 15:08--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndexes::getImplementationName() throw (uno::RuntimeException)
{
@@ -2538,8 +2392,9 @@ static char const*const g_ServicesDocumentIndexes[] =
{
"com.sun.star.text.DocumentIndexes",
};
+
static const size_t g_nServicesDocumentIndexes(
- sizeof(g_ServicesDocumentIndexes)/sizeof(g_ServicesDocumentIndexes[0]));
+ SAL_N_ELEMENTS(g_ServicesDocumentIndexes));
sal_Bool SAL_CALL
SwXDocumentIndexes::supportsService(const OUString& rServiceName)
@@ -2556,13 +2411,10 @@ SwXDocumentIndexes::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesDocumentIndexes, g_ServicesDocumentIndexes);
}
-/*-- 05.05.99 13:15:01---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL
SwXDocumentIndexes::getCount() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
@@ -2581,15 +2433,12 @@ SwXDocumentIndexes::getCount() throw (uno::RuntimeException)
return nRet;
}
-/*-- 05.05.99 13:15:01---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndexes::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
@@ -2616,15 +2465,12 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
throw lang::IndexOutOfBoundsException();
}
-/*-- 31.01.00 10:12:31---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndexes::getByName(const OUString& rName)
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
@@ -2650,13 +2496,10 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
throw container::NoSuchElementException();
}
-/*-- 31.01.00 10:12:31---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXDocumentIndexes::getElementNames() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
@@ -2690,14 +2533,11 @@ SwXDocumentIndexes::getElementNames() throw (uno::RuntimeException)
return aRet;
}
-/*-- 31.01.00 10:12:31---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndexes::hasByName(const OUString& rName)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
@@ -2720,17 +2560,12 @@ throw (uno::RuntimeException)
return sal_False;
}
-/*-- 05.05.99 13:15:01---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXDocumentIndexes::getElementType() throw (uno::RuntimeException)
{
return text::XDocumentIndex::static_type();
}
-/*-- 05.05.99 13:15:02---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndexes::hasElements() throw (uno::RuntimeException)
{
@@ -2740,25 +2575,16 @@ SwXDocumentIndexes::hasElements() throw (uno::RuntimeException)
/******************************************************************
* SwXDocumentIndex::StyleAccess_Impl
******************************************************************/
-
-/*-- 13.09.99 16:52:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndex::StyleAccess_Impl::StyleAccess_Impl(
SwXDocumentIndex& rParentIdx)
: m_xParent(&rParentIdx)
{
}
-/*-- 13.09.99 16:52:29---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDocumentIndex::StyleAccess_Impl::~StyleAccess_Impl()
{
}
-/* -----------------------------06.04.00 15:08--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::getImplementationName()
throw (uno::RuntimeException)
@@ -2770,8 +2596,9 @@ static char const*const g_ServicesIndexStyleAccess[] =
{
"com.sun.star.text.DocumentIndexParagraphStyles",
};
+
static const size_t g_nServicesIndexStyleAccess(
- sizeof(g_ServicesIndexStyleAccess)/sizeof(g_ServicesIndexStyleAccess[0]));
+ SAL_N_ELEMENTS(g_ServicesIndexStyleAccess));
sal_Bool SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::supportsService(
@@ -2790,16 +2617,13 @@ throw (uno::RuntimeException)
g_nServicesIndexStyleAccess, g_ServicesIndexStyleAccess);
}
-/*-- 13.09.99 16:52:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::replaceByIndex(
sal_Int32 nIndex, const uno::Any& rElement)
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(nIndex < 0 || nIndex > MAXLEVEL)
{
@@ -2830,23 +2654,19 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
}
rTOXBase.SetStyleNames(sSetStyles, static_cast<sal_uInt16>(nIndex));
}
-/*-- 13.09.99 16:52:29---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::getCount() throw (uno::RuntimeException)
{
return MAXLEVEL;
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(nIndex < 0 || nIndex > MAXLEVEL)
{
@@ -2873,18 +2693,14 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::Any aRet(&aStyles, ::getCppuType((uno::Sequence<OUString>*)0));
return aRet;
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::getElementType()
throw (uno::RuntimeException)
{
return ::getCppuType((uno::Sequence<OUString>*)0);
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndex::StyleAccess_Impl::hasElements() throw (uno::RuntimeException)
{
@@ -2894,24 +2710,16 @@ SwXDocumentIndex::StyleAccess_Impl::hasElements() throw (uno::RuntimeException)
/******************************************************************
* SwXDocumentIndex::TokenAccess_Impl
******************************************************************/
-/*-- 13.09.99 16:52:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXDocumentIndex::TokenAccess_Impl::TokenAccess_Impl(
SwXDocumentIndex& rParentIdx)
: m_xParent(&rParentIdx)
{
}
-/*-- 13.09.99 16:52:29---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDocumentIndex::TokenAccess_Impl::~TokenAccess_Impl()
{
}
-/* -----------------------------06.04.00 15:08--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::getImplementationName()
throw (uno::RuntimeException)
@@ -2923,8 +2731,9 @@ static char const*const g_ServicesIndexTokenAccess[] =
{
"com.sun.star.text.DocumentIndexLevelFormat",
};
+
static const size_t g_nServicesIndexTokenAccess(
- sizeof(g_ServicesIndexTokenAccess)/sizeof(g_ServicesIndexTokenAccess[0]));
+ SAL_N_ELEMENTS(g_ServicesIndexTokenAccess));
sal_Bool SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::supportsService(
@@ -2962,16 +2771,13 @@ static const struct TokenType g_TokenTypes[] =
{ 0, static_cast<enum FormTokenType>(0) }
};
-/*-- 13.09.99 16:52:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::replaceByIndex(
sal_Int32 nIndex, const uno::Any& rElement)
throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
@@ -2997,7 +2803,8 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
SwFormToken aToken(TOKEN_END);
for(sal_Int32 j = 0; j < nProperties; j++)
{
- if (pProperties[j].Name.equalsAscii("TokenType"))
+ if (pProperties[j].Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("TokenType")))
{
const OUString sTokenType =
lcl_AnyToString(pProperties[j].Value);
@@ -3090,7 +2897,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
}
aToken.nChapterFormat = nFormat;
}
-//--->i53420
+// #i53420#
else if (pProperties[j].Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("ChapterLevel")))
{
@@ -3101,7 +2908,6 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
}
aToken.nOutlineLevel = nLevel;
}
-//<---
else if (pProperties[j].Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("BibliographyDataField")))
{
@@ -3136,7 +2942,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
{
aToken.eTokenType = TOKEN_ENTRY;
}
-//---> i53420
+// #i53420#
// check for chapter format allowed values if it was TOKEN_ENTRY_NO type
// only allowed value are CF_NUMBER and CF_NUM_NOPREPST_TITLE
// reading from file
@@ -3151,7 +2957,6 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
throw lang::IllegalArgumentException();
}
}
-//<---
sPattern += aToken.GetString();
}
SwForm aForm(rTOXBase.GetTOXForm());
@@ -3159,27 +2964,21 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
rTOXBase.SetTOXForm(aForm);
}
-/*-- 13.09.99 16:52:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::getCount() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const sal_Int32 nRet = m_xParent->m_pImpl->GetFormMax();
return nRet;
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
@@ -3215,7 +3014,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
{
case TOKEN_ENTRY_NO:
{
-//--->i53420
+// #i53420#
// writing to file (from doc to properties)
sal_Int32 nElements = 2;
sal_Int32 nCurrentElement = 0;
@@ -3236,7 +3035,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
pArr[nCurrentElement].Name = C2U("TokenType");
pArr[nCurrentElement++].Value <<=
- OUString::createFromAscii("TokenEntryNumber");
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TokenEntryNumber"));
pArr[nCurrentElement].Name = C2U("CharacterStyleName");
pArr[nCurrentElement++].Value <<= aProgCharStyle;
@@ -3266,7 +3065,6 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
pArr[nCurrentElement].Name = C2U("ChapterLevel");
pArr[nCurrentElement].Value <<= aToken.nOutlineLevel;
}
-//<---
}
break;
case TOKEN_ENTRY: // no difference between Entry and Entry Text
@@ -3276,7 +3074,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
pArr[0].Name = C2U("TokenType");
- pArr[0].Value <<= OUString::createFromAscii("TokenEntryText");
+ pArr[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("TokenEntryText"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
@@ -3288,7 +3086,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
pArr[0].Name = C2U("TokenType");
- pArr[0].Value <<= OUString::createFromAscii("TokenTabStop");
+ pArr[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("TokenTabStop"));
if(SVX_TAB_ADJUST_END == aToken.eTabAlign)
{
@@ -3319,7 +3117,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
pArr[0].Name = C2U("TokenType");
- pArr[0].Value <<= OUString::createFromAscii("TokenText");
+ pArr[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("TokenText"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
@@ -3334,7 +3132,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
pArr[0].Name = C2U("TokenType");
- pArr[0].Value <<= OUString::createFromAscii("TokenPageNumber");
+ pArr[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("TokenPageNumber"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
@@ -3346,7 +3144,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
beans::PropertyValue* pArr = rCurTokenSeq.getArray();
pArr[0].Name = C2U("TokenType");
- pArr[0].Value <<= OUString::createFromAscii("TokenChapterInfo");
+ pArr[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("TokenChapterInfo"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
@@ -3372,11 +3170,9 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
break;
}
pArr[2].Value <<= nVal;
-//--->i53420
+// #i53420#
pArr[3].Name = C2U("ChapterLevel");
- //
pArr[3].Value <<= aToken.nOutlineLevel;
-//<---
}
break;
case TOKEN_LINK_START:
@@ -3386,7 +3182,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
pArr[0].Name = C2U("TokenType");
pArr[0].Value <<=
- OUString::createFromAscii("TokenHyperlinkStart");
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TokenHyperlinkStart"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
}
@@ -3398,7 +3194,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
pArr[0].Name = C2U("TokenType");
pArr[0].Value <<=
- OUString::createFromAscii("TokenHyperlinkEnd");
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TokenHyperlinkEnd"));
}
break;
case TOKEN_AUTHORITY:
@@ -3408,7 +3204,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
pArr[0].Name = C2U("TokenType");
pArr[0].Value <<=
- OUString::createFromAscii("TokenBibliographyDataField");
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TokenBibliographyDataField"));
pArr[1].Name = C2U("CharacterStyleName");
pArr[1].Value <<= aProgCharStyle;
@@ -3422,7 +3218,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
;
}
- aIt++; // #i21237#
+ ++aIt; // #i21237#
}
uno::Any aRet;
@@ -3430,18 +3226,13 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
return aRet;
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::getElementType()
throw (uno::RuntimeException)
{
return ::getCppuType((uno::Sequence< beans::PropertyValues >*)0);
}
-/*-- 13.09.99 16:52:30---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXDocumentIndex::TokenAccess_Impl::hasElements()
throw (uno::RuntimeException)
@@ -3449,3 +3240,4 @@ throw (uno::RuntimeException)
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index b0ef867efe71..b6ed84989dbf 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,8 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/text/PageNumberType.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
-// --> OD 2004-08-06 #i28749#
+// #i28749#
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
-// <--
#include <swtypes.hxx>
#include <unomap.hxx>
#include <unoprnms.hxx>
@@ -64,9 +64,6 @@ using namespace ::comphelper;
SwUnoPropertyMapProvider aSwMapProvider;
-/* -----------------24.06.98 18:12-------------------
- *
- * --------------------------------------------------*/
SwUnoPropertyMapProvider::SwUnoPropertyMapProvider()
{
for( sal_uInt16 i = 0; i < PROPERTY_MAP_END; i++ )
@@ -76,9 +73,6 @@ SwUnoPropertyMapProvider::SwUnoPropertyMapProvider()
}
}
-/* -----------------19.02.99 08:31-------------------
- *
- * --------------------------------------------------*/
SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{
}
@@ -131,9 +125,6 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{SW_PROP_NMID(UNO_NAME_REDLINE_TEXT), 0, CPPU_E2T(CPPUTYPE_REFTEXT), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
{SW_PROP_NMID(UNO_NAME_MERGE_LAST_PARA), 0, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},
-/* -----------------24.06.98 18:12-------------------
- *
- * --------------------------------------------------*/
#define COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \
{ SW_PROP_NMID(UNO_NAME_PARA_STYLE_NAME), FN_UNO_PARA_STYLE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \
{ SW_PROP_NMID(UNO_NAME_PAGE_STYLE_NAME), FN_UNO_PAGE_STYLE, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, \
@@ -152,7 +143,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
{ SW_PROP_NMID(UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE), FN_UNO_PARA_CONT_PREV_SUBTREE, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0 }, \
{ SW_PROP_NMID(UNO_NAME_PARA_LIST_LABEL_STRING), FN_UNO_PARA_NUM_STRING, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0 }, \
- { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, //#outline level, zhaojianwei
+ { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
#define COMMON_HYPERLINK_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_HYPER_LINK_U_R_L), RES_TXTATR_INETFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID ,MID_URL_URL}, \
@@ -296,9 +287,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
#define ANCHOR_TYPES_PROPERTY { SW_PROP_NMID(UNO_NAME_ANCHOR_TYPES), FN_UNO_ANCHOR_TYPES, CPPU_E2T(CPPUTYPE_SEQANCHORTYPE),PropertyAttribute::READONLY, 0xff},
-// OD 18.09.2003 #i18732# - add property
-// OD 2004-05-05 #i28701# - add property 'WrapInfluenceOnObjPos'
-// OD 2009-07-13 #i73249# - add properties 'Title' and 'Description'
+// #i18732# #i28701# #i73249#
#define COMMON_FRAME_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_ANCHOR_PAGE_NO), RES_ANCHOR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, MID_ANCHOR_PAGENUM }, \
{ SW_PROP_NMID(UNO_NAME_ANCHOR_TYPE), RES_ANCHOR, CPPU_E2T(CPPUTYPE_TXTCNTANCHOR), PROPERTY_NONE, MID_ANCHOR_ANCHORTYPE}, \
@@ -380,8 +369,6 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
{ SW_PROP_NMID(UNO_NAME_CHAR_DIFF_HEIGHT_COMPLEX), RES_CHRATR_CTL_FONTSIZE , CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , MID_FONTHEIGHT_DIFF|CONVERT_TWIPS},
-//#outline level, zhaojianwei delete { SW_PROP_NMID(UNO_NAME_DEFAULT_OUTLINE_LEVEL), FN_UNO_DEFAULT_OUTLINE_LEVEL, CPPU_E2T(CPPUTYPE_INT8), PropertyAttribute::MAYBEVOID, 0},
-//add { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
#define COMMON_PARA_STYLE_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_BREAK_TYPE), RES_BREAK, CPPU_E2T(CPPUTYPE_BREAK), PROPERTY_NONE, 0},\
{ SW_PROP_NMID(UNO_NAME_PAGE_DESC_NAME), RES_PAGEDESC, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, MID_PAGEDESC_PAGEDESCNAME },\
@@ -535,7 +522,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, 0}, \
{ SW_PROP_NMID(UNO_NAME_PARA_CONDITIONAL_STYLE_NAME), RES_FRMATR_CONDITIONAL_STYLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, \
{ SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
- { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, //#outline level,zhaojianwei
+ { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN
TABSTOPS_MAP_ENTRY
COMMON_TEXT_CONTENT_PROPERTIES
@@ -689,9 +676,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_FILTER), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_LOCATION), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
- // --> OD 2005-06-06 #i50322# - add missing map entry for transparency of graphic background
+ // #i50322# - add missing map entry for transparency of graphic background
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_TRANSPARENCY), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_GRAPHIC_TRANSPARENCY},
- // <--
{ SW_PROP_NMID(UNO_NAME_LEFT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_L_MARGIN|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_RIGHT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},
{ SW_PROP_NMID(UNO_NAME_HORI_ORIENT), RES_HORI_ORIENT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE ,MID_HORIORIENT_ORIENT },
@@ -743,9 +729,9 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_IS_AUTO_UPDATE), FN_UNO_IS_AUTO_UPDATE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0},
- // OD 18.09.2003 #i18732#
+ // #i18732#
{ SW_PROP_NMID(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // OD 2004-05-05 #i28701#
+ // #i28701#
{ SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE},
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
{0,0,0,0,0,0}
@@ -924,9 +910,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
{ SW_PROP_NMID(UNO_NAME_TABLE_NAME), FN_UNO_TABLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0 },
{ SW_PROP_NMID(UNO_NAME_PAGE_STYLE_NAME), RES_PAGEDESC, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
- // --> collapsing borders DVO, FME 2005-05-27 #i29550#
+ // #i29550#
{ SW_PROP_NMID(UNO_NAME_COLLAPSING_BORDERS), RES_COLLAPSING_BORDERS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // <-- collapsing
_REDLINE_NODE_PROPERTIES
{0,0,0,0,0,0}
};
@@ -978,17 +963,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_LOCATION), FN_UNO_TABLE_CELL_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PropertyAttribute::MAYBEVOID|PropertyAttribute::MAYBEVOID ,MID_GRAPHIC_POSITION},
{ SW_PROP_NMID(UNO_NAME_BACK_TRANSPARENT), FN_UNO_TABLE_CELL_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID|PropertyAttribute::MAYBEVOID ,MID_GRAPHIC_TRANSPARENT },
{ SW_PROP_NMID(UNO_NAME_NUMBER_FORMAT), RES_BOXATR_FORMAT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID ,0 },
- // commented properties already found in
- // COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN_01
-// { SW_PROP_NMID(UNO_NAME_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BOTTOM_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BORDER_DISTANCE|CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_LEFT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_TOP_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BOTTOM_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
{ SW_PROP_NMID(UNO_NAME_VERT_ORIENT), RES_VERT_ORIENT, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE ,MID_VERTORIENT_ORIENT },
{ SW_PROP_NMID(UNO_NAME_CHART_ROW_AS_LABEL), FN_UNO_RANGE_ROW_LABEL, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0},
{ SW_PROP_NMID(UNO_NAME_CHART_COLUMN_AS_LABEL), FN_UNO_RANGE_COL_LABEL, CPPU_E2T(CPPUTYPE_BOOLEAN) , PropertyAttribute::MAYBEVOID, 0},
@@ -1010,9 +984,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_FILE_LINK), WID_SECT_LINK , CPPU_E2T(CPPUTYPE_SECTFILELNK), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_IS_VISIBLE), WID_SECT_VISIBLE , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_IS_PROTECTED), WID_SECT_PROTECTED, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // --> FME 2004-06-22 #114856# edit in readonly sections
{ SW_PROP_NMID(UNO_NAME_EDIT_IN_READONLY), WID_SECT_EDIT_IN_READONLY, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // <--
{ SW_PROP_NMID(UNO_NAME_LINK_REGION), WID_SECT_REGION , CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_TEXT_COLUMNS), RES_COL, CPPU_E2T(CPPUTYPE_REFTEXTCOL), PROPERTY_NONE, MID_COLUMNS},
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
@@ -1044,10 +1016,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
_REDLINE_NODE_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_IS_CURRENTLY_VISIBLE), WID_SECT_CURRENTLY_VISIBLE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
- /* -> #109700# */
{ SW_PROP_NMID(UNO_NAME_SECT_LEFT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_L_MARGIN|CONVERT_TWIPS}, \
{ SW_PROP_NMID(UNO_NAME_SECT_RIGHT_MARGIN), RES_LR_SPACE, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, MID_R_MARGIN|CONVERT_TWIPS}, \
- /* <- #1097001# */
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aSectionPropertyMap_Impl;
@@ -1060,7 +1030,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_SEARCH_ALL), WID_SEARCH_ALL, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SEARCH_BACKWARDS), WID_BACKWARDS, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SEARCH_CASE_SENSITIVE), WID_CASE_SENSITIVE, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_SEARCH_IN_SELECTION), WID_IN_SELECTION, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SEARCH_REGULAR_EXPRESSION), WID_REGULAR_EXPRESSION, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SEARCH_SIMILARITY), WID_SIMILARITY, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SEARCH_SIMILARITY_ADD), WID_SIMILARITY_ADD, CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, 0},
@@ -1084,7 +1053,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_CHAIN_PREV_NAME), RES_CHAIN, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID ,MID_CHAIN_PREVNAME},
/*not impl*/ { SW_PROP_NMID(UNO_NAME_CLIENT_MAP), RES_URL, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_URL_CLIENTMAP },
{ SW_PROP_NMID(UNO_NAME_EDIT_IN_READONLY), RES_EDIT_IN_READONLY, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_GRAPHIC), RES_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
{ SW_PROP_NMID(UNO_NAME_TEXT_COLUMNS), RES_COL, CPPU_E2T(CPPUTYPE_REFTEXTCOL), PROPERTY_NONE, MID_COLUMNS},
//next elements are part of the service description
{ SW_PROP_NMID(UNO_NAME_FRAME_HEIGHT_ABSOLUTE), RES_FRM_SIZE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS },
@@ -1115,7 +1083,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_GRAPHIC_FILTER), FN_UNO_GRAPHIC_FILTER, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0 },
{ SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), 0, 0 },
{ SW_PROP_NMID(UNO_NAME_ACTUAL_SIZE), FN_UNO_ACTUAL_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::READONLY, CONVERT_TWIPS},
-// { SW_PROP_NMID(UNO_NAME_ALTERNATIVE_TEXT), FN_UNO_ALTERNATIVE_TEXT,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE , 0 },
{ SW_PROP_NMID(UNO_NAME_CONTOUR_POLY_POLYGON), FN_PARAM_COUNTOUR_PP, CPPU_E2T(CPPUTYPE_PNTSEQSEQ), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_IS_PIXEL_CONTOUR), FN_UNO_IS_PIXEL_CONTOUR, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0 },
{ SW_PROP_NMID(UNO_NAME_IS_AUTOMATIC_CONTOUR), FN_UNO_IS_AUTOMATIC_CONTOUR , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0 },
@@ -1151,7 +1118,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ 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}
};
aMapEntriesArr[nPropertyId] = aEmbeddedPropertyMap_Impl;
@@ -1182,11 +1148,11 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_TEXT_RANGE), FN_TEXT_RANGE, CPPU_E2T(CPPUTYPE_REFTXTRANGE), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_OPAQUE), RES_OPAQUE, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_ANCHOR_POSITION), FN_ANCHOR_POSITION, CPPU_E2T(CPPUTYPE_AWTPOINT), PropertyAttribute::READONLY, 0},
- // OD 2004-05-04 #i26791#
+ // #i26791#
{ SW_PROP_NMID(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
{ SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE},
- // --> OD 2004-08-06 #i28749#
+ // #i28749#
{ SW_PROP_NMID( UNO_NAME_TRANSFORMATION_IN_HORI_L2R),
FN_SHAPE_TRANSFORMATION_IN_HORI_L2R,
CPPU_E2T(CPPUTYPE_TRANSFORMATIONINHORIL2R),
@@ -1195,8 +1161,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
FN_SHAPE_POSITION_LAYOUT_DIR,
CPPU_E2T(CPPUTYPE_INT16),
PROPERTY_NONE, 0},
- // <--
- // --> OD 2004-10-28 #i36248#
+ // #i36248#
{ SW_PROP_NMID( UNO_NAME_STARTPOSITION_IN_HORI_L2R),
FN_SHAPE_STARTPOSITION_IN_HORI_L2R,
CPPU_E2T(CPPUTYPE_AWTPOINT),
@@ -1205,11 +1170,9 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
FN_SHAPE_ENDPOSITION_IN_HORI_L2R,
CPPU_E2T(CPPUTYPE_AWTPOINT),
PropertyAttribute::READONLY, 0},
- // <--
- // --> OD 2006-11-09 #i71182#
+ // #i71182#
// missing map entry for property <PageToogle>
{ SW_PROP_NMID(UNO_NAME_PAGE_TOGGLE), RES_HORI_ORIENT, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_HORIORIENT_PAGETOGGLE },
- // <--
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aShapeMap_Impl;
@@ -1272,7 +1235,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_USE_DASH), WID_USE_DASH , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_USE_UPPER_CASE), WID_USE_UPPER_CASE , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_LEVEL_FORMAT), WID_LEVEL_FORMAT , CPPU_E2T(CPPUTYPE_REFIDXREPL) , PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_??? ), WID_??? , &_getReflection , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_MAIN_ENTRY_CHARACTER_STYLE_NAME), WID_MAIN_ENTRY_CHARACTER_STYLE_NAME , CPPU_E2T(CPPUTYPE_OUSTRING) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_TEXT_COLUMNS), RES_COL, CPPU_E2T(CPPUTYPE_REFTEXTCOL), PROPERTY_NONE, MID_COLUMNS},
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
@@ -1303,14 +1265,11 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_LEVEL), WID_LEVEL , CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_MARKS), WID_CREATE_FROM_MARKS , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_OUTLINE), WID_CREATE_FROM_OUTLINE , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_PARAGRAPH_STYLE_NAMES), WID_PARAGRAPH_STYLE_NAMES , CPPU_E2T(CPPUTYPE_REFIDXREPL) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_IS_PROTECTED), WID_PROTECTED , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_LEVEL_FORMAT), WID_LEVEL_FORMAT , CPPU_E2T(CPPUTYPE_REFIDXREPL) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_LEVEL_PARAGRAPH_STYLES), WID_LEVEL_PARAGRAPH_STYLES , CPPU_E2T(CPPUTYPE_REFIDXREPL) , PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_LEVEL_PARAGRAPH_STYLES), WID_CREATE_FROM_PARAGRAPH_STYLES, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_RECALC_TAB_STOPS), WID_RECALC_TAB_STOPS , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_??? ), WID_??? , &_getReflection , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_TEXT_COLUMNS), RES_COL, CPPU_E2T(CPPUTYPE_REFTEXTCOL), PROPERTY_NONE, MID_COLUMNS},
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL },
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_FILTER), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_FILTER },
@@ -1341,7 +1300,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{
_BASE_INDEX_PROPERTIES_
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_MARKS), WID_CREATE_FROM_MARKS , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
- // { SW_PROP_NMID(UNO_NAME_PARAGRAPH_STYLE_NAMES), WID_PARAGRAPH_STYLE_NAMES , CPPU_E2T(CPPUTYPE_REFIDXREPL) , PROPERTY_NONE,0},
{ SW_PROP_NMID(UNO_NAME_CREATE_FROM_CHAPTER), WID_CREATE_FROM_CHAPTER , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_IS_PROTECTED), WID_PROTECTED , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_USE_LEVEL_FROM_SOURCE), WID_USE_LEVEL_FROM_SOURCE , CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0},
@@ -1471,8 +1429,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_SIZE_TYPE), RES_FRM_SIZE, CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, MID_FRMSIZE_SIZE_TYPE },
{ SW_PROP_NMID(UNO_NAME_WIDTH_TYPE), RES_FRM_SIZE, CPPU_E2T(CPPUTYPE_INT16) , PROPERTY_NONE, MID_FRMSIZE_WIDTH_TYPE },
{ SW_PROP_NMID(UNO_NAME_IS_SPLIT_ALLOWED), RES_ROW_SPLIT, CPPU_E2T(CPPUTYPE_BOOLEAN) , PropertyAttribute::MAYBEVOID, 0},
- // { SW_PROP_NMID(UNO_NAME_HEIGHT), RES_FRM_SIZE, CPPU_E2T(CPPUTYPE_INT32) , PROPERTY_NONE, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS },
- // { SW_PROP_NMID(UNO_NAME_SHADOW_FORMAT), RES_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},
{0,0,0,0,0,0}
};
@@ -1494,17 +1450,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_LOCATION), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRAPHICLOC), PROPERTY_NONE ,MID_GRAPHIC_POSITION},
{ SW_PROP_NMID(UNO_NAME_NUMBER_FORMAT), RES_BOXATR_FORMAT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID ,0 },
{ SW_PROP_NMID(UNO_NAME_BACK_TRANSPARENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE , MID_GRAPHIC_TRANSPARENT },
- // commented ones are already part of
- // COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN_01:
-// { SW_PROP_NMID(UNO_NAME_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BOTTOM_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, BOTTOM_BORDER|CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BORDER_DISTANCE|CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_LEFT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, LEFT_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_TOP_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, TOP_BORDER_DISTANCE |CONVERT_TWIPS },
-// { SW_PROP_NMID(UNO_NAME_BOTTOM_BORDER_DISTANCE), RES_BOX, CPPU_E2T(CPPUTYPE_INT32), 0, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },
{ SW_PROP_NMID(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, CPPU_E2T(CPPUTYPE_REFNAMECNT), PropertyAttribute::MAYBEVOID, 0 },
{ SW_PROP_NMID(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, CPPU_E2T(CPPUTYPE_REFTEXTSECTION), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },
{ SW_PROP_NMID(UNO_NAME_IS_PROTECTED), RES_PROTECT, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, MID_PROTECT_CONTENT},
@@ -1581,11 +1526,13 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_CHAR_LOCALE), RES_CHRATR_LANGUAGE , CPPU_E2T(CPPUTYPE_LOCALE), PropertyAttribute::MAYBEVOID, MID_LANG_LOCALE },
{ SW_PROP_NMID(UNO_NAME_CHARACTER_COUNT), WID_DOC_CHAR_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_DIALOG_LIBRARIES), WID_DOC_DIALOG_LIBRARIES, CPPU_E2T(CPPUTYPE_REFLIBCONTAINER), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_VBA_DOCOBJ), WID_DOC_VBA_DOCOBJ, CPPU_E2T(CPPUTYPE_PROPERTYVALUE), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_INDEX_AUTO_MARK_FILE_U_R_L), WID_DOC_AUTO_MARK_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_PARAGRAPH_COUNT), WID_DOC_PARA_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_RECORD_CHANGES), WID_DOC_CHANGES_RECORD, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_SHOW_CHANGES), WID_DOC_CHANGES_SHOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_WORD_COUNT), WID_DOC_WORD_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_IS_TEMPLATE), WID_DOC_ISTEMPLATEID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_WORD_SEPARATOR), WID_DOC_WORD_SEPARATOR, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_HIDE_FIELD_TIPS), WID_DOC_HIDE_TIPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_REDLINE_DISPLAY_TYPE), WID_DOC_REDLINE_DISPLAY, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0},
@@ -1598,9 +1545,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{ SW_PROP_NMID(UNO_NAME_LOCK_UPDATES), WID_DOC_LOCK_UPDATES, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
{ SW_PROP_NMID(UNO_NAME_HAS_VALID_SIGNATURES), WID_DOC_HAS_VALID_SIGNATURES, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
{ SW_PROP_NMID(UNO_NAME_BUILDID), WID_DOC_BUILDID, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0},
- // --> OD 2006-03-21 #b6375613#
{ SW_PROP_NMID(UNO_NAME_APPLY_WORKAROUND_FOR_B6375613), WID_APPLY_WORKAROUND_FOR_B6375613, CPPU_E2T(CPPUTYPE_BOOLEAN), 0, 0},
- // <--
{0,0,0,0,0,0}
};
aMapEntriesArr[nPropertyId] = aDocMap_Impl;
@@ -1695,9 +1640,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
COMMON_HYPERLINK_PROPERTIES
{ SW_PROP_NMID(UNO_NAME_CHAR_STYLE_NAME), RES_TXTATR_CHARFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0},
{ SW_PROP_NMID(UNO_NAME_IS_SPLIT_ALLOWED), RES_ROW_SPLIT, CPPU_E2T(CPPUTYPE_BOOLEAN) , PropertyAttribute::MAYBEVOID, 0},
- // --> collapsing borders DVO, FME 2005-05-27 #i29550#
+ // #i29550#
{ SW_PROP_NMID(UNO_NAME_COLLAPSING_BORDERS), RES_COLLAPSING_BORDERS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
- // <-- collapsing
//text grid enhancement for better CJK support. 2007-04-01
//just export the default page mode property, other properties are not handled in this version
@@ -2492,7 +2436,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
break;
default:
- DBG_ERROR( "unexpected property map ID" );
+ OSL_FAIL( "unexpected property map ID" );
}
//fill the character pointers and types into the arrays
SfxItemPropertyMapEntry* p = aMapEntriesArr[nPropertyId];
@@ -2511,9 +2455,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
}
return aMapEntriesArr[nPropertyId];
}
-/*-- 17.02.2009 15:29:58---------------------------------------------------
- -----------------------------------------------------------------------*/
const SfxItemPropertySet* SwUnoPropertyMapProvider::GetPropertySet( sal_uInt16 nPropertyId)
{
if( !aPropertySetArr[nPropertyId] )
@@ -3108,17 +3050,10 @@ const SfxItemPropertySet* SwUnoPropertyMapProvider::GetPropertySet( sal_uInt16
return aPropertySetArr[nPropertyId];
}
-/* -----------------04.07.98 11:42-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwItemPropertySet::FillItem(SfxItemSet& /*rSet*/, sal_uInt16 /*nWhich*/, sal_Bool /*bGetProperty*/) const
{
sal_Bool bRet = sal_False;
-/* if(nWhich == SID_ATTR_PAGE_PAPERBIN)
- {
- rSet.Put(SvxPaperBinItem(SID_ATTR_PAGE_PAPERBIN, 0));
- bRet = sal_True;
- }*/
return bRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index d09f195e4dc4..23998469c2b8 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,7 +107,7 @@
#include <unoidx.hxx>
#include <unoframe.hxx>
#include <fmthdft.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <fmtflcnt.hxx>
#define _SVSTDARR_USHORTS
@@ -129,7 +130,6 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-
/****************************************************************************
static methods
****************************************************************************/
@@ -141,17 +141,15 @@ uno::Sequence< sal_Int8 > CreateUnoTunnelId()
rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
return aSeq;
}
+
/****************************************************************************
Hilfsklassen
****************************************************************************/
-
-/* -----------------13.05.98 12:15-------------------
- *
- * --------------------------------------------------*/
SwUnoInternalPaM::SwUnoInternalPaM(SwDoc& rDoc) :
SwPaM(rDoc.GetNodes())
{
}
+
SwUnoInternalPaM::~SwUnoInternalPaM()
{
while( GetNext() != this)
@@ -181,9 +179,6 @@ SwUnoInternalPaM& SwUnoInternalPaM::operator=(const SwPaM& rPaM)
return *this;
}
-/*-----------------09.03.98 08:29-------------------
-
---------------------------------------------------*/
void SwUnoCursorHelper::SelectPam(SwPaM & rPam, const bool bExpand)
{
if (bExpand)
@@ -199,9 +194,6 @@ void SwUnoCursorHelper::SelectPam(SwPaM & rPam, const bool bExpand)
}
}
-/* -----------------20.05.98 14:59-------------------
- *
- * --------------------------------------------------*/
void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
{
if (!rPam.HasMark())
@@ -267,9 +259,6 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
}
}
-/* -----------------06.07.98 07:33-------------------
- *
- * --------------------------------------------------*/
static void
lcl_setCharStyle(SwDoc *const pDoc, const uno::Any & rValue, SfxItemSet & rSet)
throw (lang::IllegalArgumentException)
@@ -295,9 +284,7 @@ throw (lang::IllegalArgumentException)
rSet.Put(aFmt);
}
};
-/* -----------------08.06.06 10:43-------------------
- *
- * --------------------------------------------------*/
+
static void
lcl_setAutoStyle(IStyleAccess & rStyleAccess, const uno::Any & rValue,
SfxItemSet & rSet, const bool bPara)
@@ -324,9 +311,7 @@ throw (lang::IllegalArgumentException)
throw lang::IllegalArgumentException();
}
};
-/* -----------------30.06.98 08:46-------------------
- *
- * --------------------------------------------------*/
+
void
SwUnoCursorHelper::SetTxtFmtColl(const uno::Any & rAny, SwPaM & rPaM)
throw (lang::IllegalArgumentException)
@@ -358,9 +343,6 @@ throw (lang::IllegalArgumentException)
pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
}
-/* -----------------06.07.98 07:38-------------------
- *
- * --------------------------------------------------*/
bool
SwUnoCursorHelper::SetPageDesc(
const uno::Any& rValue, SwDoc & rDoc, SfxItemSet & rSet)
@@ -412,9 +394,6 @@ SwUnoCursorHelper::SetPageDesc(
return true;
}
-/* -----------------30.06.98 10:29-------------------
- *
- * --------------------------------------------------*/
static void
lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue)
{
@@ -545,9 +524,6 @@ lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue)
rItemSet.Put(*pRuby);
}
-/* -----------------17.09.98 09:44-------------------
- *
- * --------------------------------------------------*/
bool
SwUnoCursorHelper::SetCursorPropertyValue(
SfxItemPropertySimpleEntry const& rEntry, const uno::Any& rValue,
@@ -593,11 +569,7 @@ throw (lang::IllegalArgumentException)
{
// multi selection is not considered
SwTxtNode *const pTxtNd = rPam.GetNode()->GetTxtNode();
- // --> OD 2008-05-14 #refactorlists# - check on list style not needed
-// const SwNumRule* pRule = pTxtNd->GetNumRule();
-// if( FN_UNO_NUM_LEVEL == rEntry.nWID && pRule != NULL )
if (FN_UNO_NUM_LEVEL == rEntry.nWID)
- // <--
{
sal_Int16 nLevel = 0;
if (rValue >>= nLevel)
@@ -685,9 +657,6 @@ throw (lang::IllegalArgumentException)
return bRet;
}
-/* -----------------30.06.98 08:39-------------------
- *
- * --------------------------------------------------*/
SwFmtColl *
SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
{
@@ -734,7 +703,7 @@ SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional)
return (bError) ? 0 : pFmt;
}
-/* -----------------26.06.98 16:20-------------------
+/* --------------------------------------------------
* Hilfsfunktion fuer PageDesc
* --------------------------------------------------*/
SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName)
@@ -772,7 +741,6 @@ SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName)
/******************************************************************
* SwXTextCursor
******************************************************************/
-
class SwXTextCursor::Impl
: public SwClient
{
@@ -845,7 +813,6 @@ void SwXTextCursor::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
SwUnoCrsr const* SwXTextCursor::GetCursor() const
{
return m_pImpl->GetCursor();
@@ -856,9 +823,6 @@ SwUnoCrsr * SwXTextCursor::GetCursor()
return m_pImpl->GetCursor();
}
-/*-- 09.12.98 14:19:01---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwPaM const* SwXTextCursor::GetPaM() const
{
return m_pImpl->GetCursor();
@@ -869,25 +833,16 @@ SwPaM * SwXTextCursor::GetPaM()
return m_pImpl->GetCursor();
}
-/*-- 09.12.98 14:19:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwDoc const* SwXTextCursor::GetDoc() const
{
return m_pImpl->GetCursor() ? m_pImpl->GetCursor()->GetDoc() : 0;
}
-/* -----------------22.07.99 13:52-------------------
- --------------------------------------------------*/
SwDoc * SwXTextCursor::GetDoc()
{
return m_pImpl->GetCursor() ? m_pImpl->GetCursor()->GetDoc() : 0;
}
-
-/*-- 09.12.98 14:19:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextCursor::SwXTextCursor(
SwDoc & rDoc,
uno::Reference< text::XText > const& xParent,
@@ -899,9 +854,6 @@ SwXTextCursor::SwXTextCursor(
{
}
-/* -----------------04.03.99 09:02-------------------
- *
- * --------------------------------------------------*/
SwXTextCursor::SwXTextCursor(uno::Reference< text::XText > const& xParent,
SwPaM const& rSourceCursor, const enum CursorType eType)
: m_pImpl( new SwXTextCursor::Impl(*this, *rSourceCursor.GetDoc(), eType,
@@ -910,16 +862,10 @@ SwXTextCursor::SwXTextCursor(uno::Reference< text::XText > const& xParent,
{
}
-/*-- 09.12.98 14:19:20---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextCursor::~SwXTextCursor()
{
}
-/*-- 09.12.98 14:19:18---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
const bool bForceExpandHints)
{
@@ -956,7 +902,6 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
}
}
-
enum ForceIntoMetaMode { META_CHECK_BOTH, META_INIT_START, META_INIT_END };
static sal_Bool
@@ -966,14 +911,14 @@ lcl_ForceIntoMeta(SwPaM & rCursor,
{
sal_Bool bRet( sal_True ); // means not forced in META_CHECK_BOTH
SwXMeta const * const pXMeta( dynamic_cast<SwXMeta*>(xParentText.get()) );
- ASSERT(pXMeta, "no parent?");
+ OSL_ENSURE(pXMeta, "no parent?");
if (!pXMeta)
throw uno::RuntimeException();
SwTxtNode * pTxtNode;
xub_StrLen nStart;
xub_StrLen nEnd;
const bool bSuccess( pXMeta->SetContentRange(pTxtNode, nStart, nEnd) );
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (!bSuccess)
throw uno::RuntimeException();
// force the cursor back into the meta if it has moved outside
@@ -1010,7 +955,7 @@ bool SwXTextCursor::IsAtEndOfMeta() const
SwUnoCrsr const * const pCursor( m_pImpl->GetCursor() );
SwXMeta const*const pXMeta(
dynamic_cast<SwXMeta*>(m_pImpl->m_xParentText.get()) );
- ASSERT(pXMeta, "no meta?");
+ OSL_ENSURE(pXMeta, "no meta?");
if (pCursor && pXMeta)
{
SwTxtNode * pTxtNode;
@@ -1018,7 +963,7 @@ bool SwXTextCursor::IsAtEndOfMeta() const
xub_StrLen nEnd;
const bool bSuccess(
pXMeta->SetContentRange(pTxtNode, nStart, nEnd) );
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (bSuccess)
{
const SwPosition end(*pTxtNode, nEnd);
@@ -1033,17 +978,11 @@ bool SwXTextCursor::IsAtEndOfMeta() const
return false;
}
-/*-- 09.12.98 14:19:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXTextCursor::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXTextCursor");
}
-/*-- 09.12.98 14:19:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
static char const*const g_ServicesTextCursor[] =
{
"com.sun.star.text.TextCursor",
@@ -1055,8 +994,9 @@ static char const*const g_ServicesTextCursor[] =
"com.sun.star.style.ParagraphPropertiesComplex",
"com.sun.star.text.TextSortable",
};
+
static const size_t g_nServicesTextCursor(
- sizeof(g_ServicesTextCursor)/sizeof(g_ServicesTextCursor[0]));
+ SAL_N_ELEMENTS(g_ServicesTextCursor));
sal_Bool SAL_CALL SwXTextCursor::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -1072,17 +1012,12 @@ SwXTextCursor::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextCursor, g_ServicesTextCursor);
}
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextCursor::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXTextCursor::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1091,12 +1026,9 @@ throw (uno::RuntimeException)
return (nRet) ? nRet : OTextCursorHelper::getSomething(rId);
}
-/*-- 09.12.98 14:18:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextCursor::collapseToStart() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1109,12 +1041,10 @@ void SAL_CALL SwXTextCursor::collapseToStart() throw (uno::RuntimeException)
rUnoCursor.DeleteMark();
}
}
-/*-- 09.12.98 14:18:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextCursor::collapseToEnd() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1127,12 +1057,10 @@ void SAL_CALL SwXTextCursor::collapseToEnd() throw (uno::RuntimeException)
rUnoCursor.DeleteMark();
}
}
-/*-- 09.12.98 14:18:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextCursor::isCollapsed() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_True;
SwUnoCrsr *const pUnoCrsr = m_pImpl->GetCursor();
@@ -1143,14 +1071,11 @@ sal_Bool SAL_CALL SwXTextCursor::isCollapsed() throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::goLeft(sal_Int16 nCount, sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1164,14 +1089,12 @@ throw (uno::RuntimeException)
}
return bRet;
}
-/*-- 09.12.98 14:18:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::goRight(sal_Int16 nCount, sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1186,13 +1109,10 @@ throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1244,13 +1164,11 @@ SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException)
lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, META_INIT_START);
}
}
-/*-- 09.12.98 14:18:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::gotoEnd(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1279,7 +1197,7 @@ SwXTextCursor::gotoRange(
const uno::Reference< text::XTextRange > & xRange, sal_Bool bExpand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xRange.is())
{
@@ -1401,12 +1319,9 @@ throw (uno::RuntimeException)
}
}
-/*-- 09.12.98 14:18:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextCursor::isStartOfWord() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1414,12 +1329,10 @@ sal_Bool SAL_CALL SwXTextCursor::isStartOfWord() throw (uno::RuntimeException)
rUnoCursor.IsStartWordWT( i18n::WordType::DICTIONARY_WORD );
return bRet;
}
-/*-- 09.12.98 14:18:44---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextCursor::isEndOfWord() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1428,13 +1341,10 @@ sal_Bool SAL_CALL SwXTextCursor::isEndOfWord() throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1478,13 +1388,10 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1521,13 +1428,10 @@ SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1559,13 +1463,11 @@ SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:46---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1598,13 +1500,10 @@ SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:46---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::isStartOfSentence() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1623,13 +1522,11 @@ SwXTextCursor::isStartOfSentence() throw (uno::RuntimeException)
}
return bRet;
}
-/*-- 09.12.98 14:18:47---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::isEndOfSentence() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1650,13 +1547,10 @@ SwXTextCursor::isEndOfSentence() throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1687,14 +1581,12 @@ SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw (uno::RuntimeException)
}
return bRet;
}
-/*-- 09.12.98 14:18:47---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoPreviousSentence(sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1719,14 +1611,11 @@ throw (uno::RuntimeException)
return bRet;
}
-/* -----------------15.10.99 08:24-------------------
-
- --------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoStartOfSentence(sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1746,13 +1635,11 @@ throw (uno::RuntimeException)
}
return bRet;
}
-/* -----------------15.10.99 08:24-------------------
- --------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1774,26 +1661,21 @@ SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::isStartOfParagraph() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
const sal_Bool bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor);
return bRet;
}
-/*-- 09.12.98 14:18:48---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::isEndOfParagraph() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1801,14 +1683,11 @@ SwXTextCursor::isEndOfParagraph() throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoStartOfParagraph(sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1829,13 +1708,11 @@ throw (uno::RuntimeException)
DBG_ASSERT( bRet, "gotoStartOfParagraph failed" );
return bRet;
}
-/*-- 09.12.98 14:18:49---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1857,13 +1734,10 @@ SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1875,14 +1749,12 @@ SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw (uno::RuntimeException)
const sal_Bool bRet = rUnoCursor.MovePara(fnParaNext, fnParaStart);
return bRet;
}
-/*-- 09.12.98 14:18:50---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXTextCursor::gotoPreviousParagraph(sal_Bool Expand)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1895,24 +1767,18 @@ throw (uno::RuntimeException)
return bRet;
}
-/*-- 09.12.98 14:18:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SAL_CALL
SwXTextCursor::getText() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_xParentText;
}
-/*-- 09.12.98 14:18:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXTextCursor::getStart() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1934,13 +1800,11 @@ SwXTextCursor::getStart() throw (uno::RuntimeException)
}
return xRet;
}
-/*-- 09.12.98 14:18:51---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXTextCursor::getEnd() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1963,12 +1827,9 @@ SwXTextCursor::getEnd() throw (uno::RuntimeException)
return xRet;
}
-/*-- 09.12.98 14:18:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXTextCursor::getString() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -1976,13 +1837,11 @@ OUString SAL_CALL SwXTextCursor::getString() throw (uno::RuntimeException)
SwUnoCursorHelper::GetTextFromPam(rUnoCursor, aTxt);
return aTxt;
}
-/*-- 09.12.98 14:18:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::setString(const OUString& aString) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
(void) rUnoCursor; // just to check if valid
@@ -1994,9 +1853,6 @@ SwXTextCursor::setString(const OUString& aString) throw (uno::RuntimeException)
DeleteAndInsert(aString, bForceExpandHints);
}
-/* -----------------------------03.05.00 12:56--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Any SwUnoCursorHelper::GetPropertyValue(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
@@ -2032,9 +1888,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aAny;
}
-/* -----------------------------03.05.00 12:57--------------------------------
- ---------------------------------------------------------------------------*/
void SwUnoCursorHelper::SetPropertyValue(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName,
@@ -2074,9 +1928,6 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
SwUnoCursorHelper::SetCrsrAttr(rPaM, aItemSet, nAttrMode, bTableMode);
}
-/* -----------------------------03.05.00 13:16--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState >
SwUnoCursorHelper::GetPropertyStates(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
@@ -2190,9 +2041,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
return aRet;
}
-/* -----------------------------03.05.00 13:17--------------------------------
- ---------------------------------------------------------------------------*/
beans::PropertyState SwUnoCursorHelper::GetPropertyState(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
@@ -2205,9 +2054,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY );
return aSeq[0];
}
-/* -----------------------------03.05.00 13:20--------------------------------
- ---------------------------------------------------------------------------*/
static void
lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
SvUShortsSort const*const pWhichIds = 0 )
@@ -2230,7 +2077,6 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
rDoc.ResetAttrs(*pTemp, sal_True, pWhichIds);
}
-
void SwUnoCursorHelper::SetPropertyToDefault(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
@@ -2272,9 +2118,6 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
}
-/* -----------------------------03.05.00 13:19--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Any SwUnoCursorHelper::GetPropertyDefault(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
@@ -2301,13 +2144,10 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 09.12.98 14:18:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXTextCursor::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRef;
if(!xRef.is())
@@ -2329,9 +2169,6 @@ SwXTextCursor::getPropertySetInfo() throw (uno::RuntimeException)
return xRef;
}
-/*-- 09.12.98 14:18:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue)
@@ -2339,7 +2176,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2369,15 +2206,12 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
}
-/*-- 09.12.98 14:18:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXTextCursor::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2401,9 +2235,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aAny;
}
-/*-- 09.12.98 14:18:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -2415,9 +2246,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXTextCursor::addPropertyChangeListener(): not implemented");
}
-/*-- 09.12.98 14:18:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::removePropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -2429,9 +2257,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXTextCursor::removePropertyChangeListener(): not implemented");
}
-/*-- 09.12.98 14:18:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::addVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -2443,9 +2268,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXTextCursor::addVetoableChangeListener(): not implemented");
}
-/*-- 09.12.98 14:18:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::removeVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -2457,14 +2279,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXTextCursor::removeVetoableChangeListener(): not implemented");
}
-/*-- 05.03.99 11:36:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
beans::PropertyState SAL_CALL
SwXTextCursor::getPropertyState(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2472,15 +2291,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
rUnoCursor, m_pImpl->m_rPropSet, rPropertyName);
return eRet;
}
-/*-- 05.03.99 11:36:11---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SAL_CALL
SwXTextCursor::getPropertyStates(
const uno::Sequence< OUString >& rPropertyNames)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2488,9 +2305,6 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
rUnoCursor, m_pImpl->m_rPropSet, rPropertyNames);
}
-/*-- 05.03.99 11:36:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::setPropertyToDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
@@ -2499,9 +2313,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
setPropertiesToDefault ( aSequence );
}
-/*-- 05.03.99 11:36:12---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXTextCursor::getPropertyDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -2516,9 +2328,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
static sal_uInt16 g_ParaResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- // --> OD 2008-02-25 #refactorlists#
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- // <--
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
0
};
@@ -2551,7 +2361,7 @@ void SAL_CALL
SwXTextCursor::setAllPropertiesToDefault()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2575,7 +2385,7 @@ SwXTextCursor::setPropertiesToDefault(
const uno::Sequence< OUString >& rPropertyNames)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2647,7 +2457,7 @@ SwXTextCursor::getPropertyDefaults(
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -2687,40 +2497,31 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 10.03.2008 09:58:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::makeRedline(
const ::rtl::OUString& rRedlineType,
const uno::Sequence< beans::PropertyValue >& rRedlineProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::makeRedline(rUnoCursor, rRedlineType, rRedlineProperties);
}
-/*-- 09.12.98 14:18:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextCursor::insertDocumentFromURL(const OUString& rURL,
const uno::Sequence< beans::PropertyValue >& rOptions)
throw (lang::IllegalArgumentException, io::IOException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
SwUnoCursorHelper::InsertFile(&rUnoCursor, rURL, rOptions);
}
-/* -----------------------------15.12.00 14:01--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue >
SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable)
{
@@ -2792,20 +2593,14 @@ SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable)
return aRet;
}
-/*-- 09.12.98 14:18:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SAL_CALL
SwXTextCursor::createSortDescriptor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwUnoCursorHelper::CreateSortDescriptor(false);
}
-/* -----------------------------15.12.00 14:06--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool SwUnoCursorHelper::ConvertSortProperties(
const uno::Sequence< beans::PropertyValue >& rDescriptor,
SwSortOptions& rSortOpt)
@@ -2843,7 +2638,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
const OUString& rPropName = pProperties[n].Name;
// old and new sortdescriptor
- if (rPropName.equalsAscii("IsSortInTable"))
+ if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsSortInTable")))
{
if (aValue.getValueType() == ::getBooleanCppuType())
{
@@ -2854,7 +2649,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if (rPropName.equalsAscii("Delimiter"))
+ else if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Delimiter")))
{
sal_Unicode uChar = sal_Unicode();
if (aValue >>= uChar)
@@ -2867,7 +2662,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
}
}
// old sortdescriptor
- else if (rPropName.equalsAscii("SortColumns"))
+ else if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SortColumns")))
{
bOldSortdescriptor = sal_True;
sal_Bool bTemp(sal_False);
@@ -2880,7 +2675,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if ( rPropName.equalsAscii("IsCaseSensitive"))
+ else if ( rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsCaseSensitive")))
{
bOldSortdescriptor = sal_True;
sal_Bool bTemp(sal_False);
@@ -2893,7 +2688,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if (rPropName.equalsAscii("CollatorLocale"))
+ else if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CollatorLocale")))
{
bOldSortdescriptor = sal_True;
lang::Locale aLocale;
@@ -2981,7 +2776,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
}
}
// new sortdescriptor
- else if (rPropName.equalsAscii("IsSortColumns"))
+ else if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsSortColumns")))
{
bNewSortdescriptor = sal_True;
if (aValue.getValueType() == ::getBooleanCppuType())
@@ -2994,7 +2789,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
bRet = sal_False;
}
}
- else if (rPropName.equalsAscii("SortFields"))
+ else if (rPropName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SortFields")))
{
bNewSortdescriptor = sal_True;
uno::Sequence < table::TableSortField > aFields;
@@ -3053,14 +2848,11 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties(
return bRet && rSortOpt.aKeys.Count() > 0;
}
-/*-- 09.12.98 14:19:00---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextCursor::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -3100,16 +2892,13 @@ throw (uno::RuntimeException)
}
}
-/* -----------------------------03.04.00 09:11--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXTextCursor::createContentEnumeration(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
- if (!rServiceName.equalsAscii("com.sun.star.text.TextContent"))
+ if (!rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent")))
{
throw uno::RuntimeException();
}
@@ -3121,13 +2910,10 @@ throw (uno::RuntimeException)
return xRet;
}
-/* -----------------------------07.03.01 14:53--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXTextCursor::createEnumeration() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
@@ -3165,36 +2951,26 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException)
return xRet;
}
-/* -----------------------------07.03.01 15:43--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextCursor::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/* -----------------------------07.03.01 15:43--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextCursor::hasElements() throw (uno::RuntimeException)
{
return sal_True;
}
-/* -----------------------------03.04.00 09:11--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXTextCursor::getAvailableServiceNames() throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString::createFromAscii("com.sun.star.text.TextContent");
+ pArray[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextContent"));
return aRet;
}
-// ---------------------------------------------------------------------------
IMPLEMENT_FORWARD_REFCOUNT( SwXTextCursor,SwXTextCursor_Base )
uno::Any SAL_CALL
@@ -3206,3 +2982,4 @@ throw (uno::RuntimeException)
: SwXTextCursor_Base::queryInterface(rType);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 3990355937d4..54324b24e74a 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,7 +106,7 @@
#include <unoidx.hxx>
#include <unoframe.hxx>
#include <fmthdft.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <fmtflcnt.hxx>
#define _SVSTDARR_USHORTS
@@ -131,7 +132,6 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-
namespace sw {
sal_Bool SupportsServiceImpl(
@@ -155,14 +155,13 @@ GetSupportedServiceNamesImpl(
uno::Sequence< ::rtl::OUString > ret(nServices);
for (size_t i = 0; i < nServices; ++i)
{
- ret[i] = C2U(pServices[i]);
+ ret[i] = rtl::OUString::createFromAscii(pServices[i]);
}
return ret;
}
} // namespace sw
-
namespace sw {
void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget)
@@ -189,7 +188,7 @@ void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget)
struct FrameDependSortListLess
{
bool operator() (FrameDependSortListEntry const& r1,
- FrameDependSortListEntry const& r2)
+ FrameDependSortListEntry const& r2) const
{
return (r1.nIndex < r2.nIndex)
|| ((r1.nIndex == r2.nIndex) && (r1.nOrder < r2.nOrder));
@@ -280,9 +279,6 @@ UnoActionContext::UnoActionContext(SwDoc *const pDoc)
}
}
-/*-----------------04.03.98 11:56-------------------
-
---------------------------------------------------*/
UnoActionContext::~UnoActionContext()
{
// Doc may already have been removed here
@@ -309,9 +305,6 @@ UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc)
}
}
-/* -----------------07.07.98 12:05-------------------
- *
- * --------------------------------------------------*/
UnoActionRemoveContext::~UnoActionRemoveContext()
{
SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
@@ -321,10 +314,6 @@ UnoActionRemoveContext::~UnoActionRemoveContext()
}
}
-
-/*-- 10.12.98 11:52:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
@@ -344,10 +333,6 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
-/*-- 09.12.98 14:19:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
const SfxItemSet& rSet,
const SetAttrMode nAttrMode, const bool bTableMode)
@@ -391,9 +376,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
}
//<-end,zhaojianwei
}
-/*-- 09.12.98 14:19:04---------------------------------------------------
- -----------------------------------------------------------------------*/
// --> OD 2006-07-12 #i63870#
// split third parameter <bCurrentAttrOnly> into new parameters <bOnlyTxtAttr>
// and <bGetFromChrFmt> to get better control about resulting <SfxItemSet>
@@ -466,7 +449,6 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam,
/******************************************************************
* SwXParagraphEnumeration
******************************************************************/
-
class SwXParagraphEnumeration::Impl
: public SwClient
{
@@ -546,9 +528,6 @@ void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
ClientModify(this, pOld, pNew);
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::SwXParagraphEnumeration(
uno::Reference< text::XText > const& xParent,
::std::auto_ptr<SwUnoCrsr> pCursor,
@@ -558,30 +537,24 @@ SwXParagraphEnumeration::SwXParagraphEnumeration(
pStartNode, pTable) )
{
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::~SwXParagraphEnumeration()
{
}
-/* -----------------------------06.04.00 16:33--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParagraphEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParagraphEnumeration");
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParagraphEnum[] =
{
"com.sun.star.text.ParagraphEnumeration",
};
+
static const size_t g_nServicesParagraphEnum(
- sizeof(g_ServicesParagraphEnum)/sizeof(g_ServicesParagraphEnum[0]));
+ SAL_N_ELEMENTS(g_ServicesParagraphEnum));
sal_Bool SAL_CALL
SwXParagraphEnumeration::supportsService(const OUString& rServiceName)
@@ -590,9 +563,7 @@ throw (uno::RuntimeException)
return ::sw::SupportsServiceImpl(
g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParagraphEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
@@ -601,19 +572,13 @@ throw (uno::RuntimeException)
g_nServicesParagraphEnum, g_ServicesParagraphEnum);
}
-/*-- 10.12.98 11:52:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return (m_pImpl->m_bFirstParagraph) ? sal_True : m_pImpl->m_xNextPara.is();
}
-/*-- 14.08.03 13:10:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
//!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx
static SwTableNode *
@@ -632,7 +597,6 @@ lcl_FindTopLevelTable(
return pLast;
}
-
static bool
lcl_CursorIsInSection(
SwUnoCrsr const*const pUnoCrsr, SwStartNode const*const pOwnStartNode)
@@ -650,7 +614,6 @@ lcl_CursorIsInSection(
return bRes;
}
-
uno::Reference< text::XTextContent >
SwXParagraphEnumeration::Impl::NextElement_Impl()
throw (container::NoSuchElementException, lang::WrappedTargetException,
@@ -754,14 +717,12 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
return xRef;
}
-/*-- 10.12.98 11:52:14---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParagraphEnumeration::nextElement()
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (m_pImpl->m_bFirstParagraph)
{
@@ -783,7 +744,6 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
/******************************************************************
* SwXTextRange
******************************************************************/
-
class SwXTextRange::Impl
: public SwClient
{
@@ -859,7 +819,6 @@ void SwXTextRange::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
SwXTextRange::SwXTextRange(SwPaM& rPam,
const uno::Reference< text::XText > & xParent,
const enum RangePosition eRange)
@@ -894,7 +853,6 @@ SwDoc * SwXTextRange::GetDoc()
return & m_pImpl->m_rDoc;
}
-
void SwXTextRange::Invalidate()
{
m_pImpl->Invalidate();
@@ -960,7 +918,7 @@ throw (uno::RuntimeException)
OUString SAL_CALL
SwXTextRange::getImplementationName() throw (uno::RuntimeException)
{
- return OUString::createFromAscii("SwXTextRange");
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("SwXTextRange"));
}
static char const*const g_ServicesTextRange[] =
@@ -973,8 +931,9 @@ static char const*const g_ServicesTextRange[] =
"com.sun.star.style.ParagraphPropertiesAsian",
"com.sun.star.style.ParagraphPropertiesComplex",
};
+
static const size_t g_nServicesTextRange(
- sizeof(g_ServicesTextRange)/sizeof(g_ServicesTextRange[0]));
+ SAL_N_ELEMENTS(g_ServicesTextRange));
sal_Bool SAL_CALL SwXTextRange::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -993,7 +952,7 @@ SwXTextRange::getSupportedServiceNames() throw (uno::RuntimeException)
uno::Reference< text::XText > SAL_CALL
SwXTextRange::getText() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_xParentText.is())
{
@@ -1016,7 +975,7 @@ SwXTextRange::getText() throw (uno::RuntimeException)
uno::Reference< text::XTextRange > SAL_CALL
SwXTextRange::getStart() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
::sw::mark::IMark const * const pBkmk = m_pImpl->GetBookmark();
@@ -1044,7 +1003,7 @@ SwXTextRange::getStart() throw (uno::RuntimeException)
uno::Reference< text::XTextRange > SAL_CALL
SwXTextRange::getEnd() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
::sw::mark::IMark const * const pBkmk = m_pImpl->GetBookmark();
@@ -1071,7 +1030,7 @@ SwXTextRange::getEnd() throw (uno::RuntimeException)
OUString SAL_CALL SwXTextRange::getString() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sRet;
// for tables there is no bookmark, thus also no text
@@ -1087,7 +1046,7 @@ OUString SAL_CALL SwXTextRange::getString() throw (uno::RuntimeException)
void SAL_CALL SwXTextRange::setString(const OUString& rString)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
DeleteAndInsert(rString, false);
}
@@ -1348,9 +1307,9 @@ uno::Reference< container::XEnumeration > SAL_CALL
SwXTextRange::createContentEnumeration(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
- if (!rServiceName.equalsAscii("com.sun.star.text.TextContent"))
+ if (!rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent")))
{
throw uno::RuntimeException();
}
@@ -1375,7 +1334,7 @@ throw (uno::RuntimeException)
uno::Reference< container::XEnumeration > SAL_CALL
SwXTextRange::createEnumeration() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1415,14 +1374,14 @@ SwXTextRange::getAvailableServiceNames() throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString::createFromAscii("com.sun.star.text.TextContent");
+ pArray[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextContent"));
return aRet;
}
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXTextRange::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Reference< beans::XPropertySetInfo > xRef =
m_pImpl->m_rPropSet.getPropertySetInfo();
@@ -1436,7 +1395,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1453,7 +1412,7 @@ SwXTextRange::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1513,7 +1472,7 @@ beans::PropertyState SAL_CALL
SwXTextRange::getPropertyState(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1529,7 +1488,7 @@ uno::Sequence< beans::PropertyState > SAL_CALL
SwXTextRange::getPropertyStates(const uno::Sequence< OUString >& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1544,7 +1503,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
void SAL_CALL SwXTextRange::setPropertyToDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1561,7 +1520,7 @@ SwXTextRange::getPropertyDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1579,7 +1538,7 @@ SwXTextRange::makeRedline(
const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc() || !m_pImpl->GetBookmark())
{
@@ -1593,7 +1552,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
/******************************************************************
* SwXTextRanges
******************************************************************/
-
class SwXTextRanges::Impl
: public SwClient
{
@@ -1631,17 +1589,11 @@ public:
};
-/*-- 10.12.98 13:57:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------10.12.98 14:25-------------------
- *
- * --------------------------------------------------*/
void SwXTextRanges::Impl::MakeRanges()
{
SwUnoCrsr *const pCursor = GetCursor();
@@ -1668,32 +1620,21 @@ const SwUnoCrsr* SwXTextRanges::GetCursor() const
return m_pImpl->GetCursor();
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::SwXTextRanges(SwPaM *const pPaM)
: m_pImpl( new SwXTextRanges::Impl(pPaM) )
{
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::~SwXTextRanges()
{
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXTextRanges::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1707,23 +1648,19 @@ throw (uno::RuntimeException)
* danach wird ein Array mit uno::Reference< XTextPosition > angelegt
*
****************************************************************************/
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXTextRanges::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXTextRanges");
}
-/* -----------------------------06.04.00 16:36--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesTextRanges[] =
{
"com.sun.star.text.TextRanges",
};
+
static const size_t g_nServicesTextRanges(
- sizeof(g_ServicesTextRanges)/sizeof(g_ServicesTextRanges[0]));
+ SAL_N_ELEMENTS(g_ServicesTextRanges));
sal_Bool SAL_CALL SwXTextRanges::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -1732,9 +1669,6 @@ throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges, rServiceName);
}
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
{
@@ -1742,23 +1676,18 @@ SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges);
}
-/*-- 10.12.98 13:57:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL SwXTextRanges::getCount() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return static_cast<sal_Int32>(m_pImpl->m_Ranges.size());
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextRanges::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if ((nIndex < 0) ||
(static_cast<size_t>(nIndex) >= m_pImpl->m_Ranges.size()))
@@ -1770,26 +1699,18 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
return ret;
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextRanges::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/*-- 10.12.98 13:57:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException)
{
// no mutex necessary: getCount() does locking
return getCount() > 0;
}
-/* -----------------11.12.98 10:07-------------------
- *
- * --------------------------------------------------*/
void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
{
// Start/EndAction
@@ -1816,7 +1737,6 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
/******************************************************************
* SwXParaFrameEnumeration
******************************************************************/
-
class SwXParaFrameEnumeration::Impl
: public SwClient
{
@@ -1852,10 +1772,6 @@ public:
};
-/*-- 23.03.99 13:22:37---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
struct InvalidFrameDepend {
bool operator() (::boost::shared_ptr<SwDepend> const & rEntry)
{ return !rEntry->GetRegisteredIn(); }
@@ -1879,9 +1795,6 @@ void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/* -----------------23.03.99 13:38-------------------
- *
- * --------------------------------------------------*/
static sal_Bool
lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
uno::Reference<text::XTextContent> & o_rNextObject,
@@ -1946,9 +1859,6 @@ lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr,
}
}
-/*-- 23.03.99 13:22:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::SwXParaFrameEnumeration(
const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode,
SwFrmFmt *const pFmt)
@@ -2006,20 +1916,15 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames);
}
}
-/*-- 23.03.99 13:22:30---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::~SwXParaFrameEnumeration()
{
}
-/*-- 23.03.99 13:22:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->GetCursor())
throw uno::RuntimeException();
@@ -2029,14 +1934,12 @@ SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
: lcl_CreateNextObject(*m_pImpl->GetCursor(),
m_pImpl->m_xNextObject, m_pImpl->m_Frames);
}
-/*-- 23.03.99 13:22:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement()
throw (container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->GetCursor())
{
@@ -2058,24 +1961,19 @@ throw (container::NoSuchElementException,
return aRet;
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParaFrameEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParaFrameEnumeration");
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParaFrameEnum[] =
{
"com.sun.star.util.ContentEnumeration",
};
+
static const size_t g_nServicesParaFrameEnum(
- sizeof(g_ServicesParaFrameEnum)/sizeof(g_ServicesParaFrameEnum[0]));
+ SAL_N_ELEMENTS(g_ServicesParaFrameEnum));
sal_Bool SAL_CALL
SwXParaFrameEnumeration::supportsService(const OUString& rServiceName)
@@ -2085,9 +1983,6 @@ throw (uno::RuntimeException)
g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParaFrameEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
@@ -2096,3 +1991,4 @@ throw (uno::RuntimeException)
g_nServicesParaFrameEnum, g_ServicesParaFrameEnum);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 0c26b7efc849..605f08dfbbf2 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,7 +42,7 @@
#include <unocrsrhelper.hxx>
#include <doc.hxx>
#include <ndtxt.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <docsh.hxx>
@@ -60,10 +61,6 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-
-/* -----------------------------01.12.00 18:09--------------------------------
-
- ---------------------------------------------------------------------------*/
class SwParaSelection
{
SwCursor & m_rCursor;
@@ -101,11 +98,9 @@ SwParaSelection::~SwParaSelection()
}
}
-
/******************************************************************
* forward declarations
******************************************************************/
-
beans::PropertyState lcl_SwXParagraph_getPropertyState(
const SwTxtNode& rTxtNode,
const SwAttrSet** ppSet,
@@ -116,7 +111,6 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState(
/******************************************************************
* SwXParagraph
******************************************************************/
-
class SwXParagraph::Impl
: public SwClient
{
@@ -189,9 +183,6 @@ public:
};
-/*-- 11.12.98 08:12:58---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXParagraph::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -201,17 +192,11 @@ void SwXParagraph::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 11.12.98 08:12:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraph::SwXParagraph()
: m_pImpl( new SwXParagraph::Impl(*this) )
{
}
-/*-- 11.12.98 08:12:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraph::SwXParagraph(
uno::Reference< text::XText > const & xParent,
SwTxtNode & rTxtNode,
@@ -221,9 +206,6 @@ SwXParagraph::SwXParagraph(
{
}
-/*-- 11.12.98 08:12:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraph::~SwXParagraph()
{
}
@@ -290,17 +272,12 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM)
return true;
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXParagraph::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -308,17 +285,12 @@ throw (uno::RuntimeException)
return ::sw::UnoTunnelImpl<SwXParagraph>(rId, this);
}
-/* -----------------------------06.04.00 16:37--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParagraph::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParagraph");
}
-/* -----------------------------06.04.00 16:37--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParagraph[] =
{
"com.sun.star.text.TextContent",
@@ -330,8 +302,9 @@ static char const*const g_ServicesParagraph[] =
"com.sun.star.style.ParagraphPropertiesAsian",
"com.sun.star.style.ParagraphPropertiesComplex",
};
+
static const size_t g_nServicesParagraph(
- sizeof(g_ServicesParagraph)/sizeof(g_ServicesParagraph[0]));
+ SAL_N_ELEMENTS(g_ServicesParagraph));
sal_Bool SAL_CALL
SwXParagraph::supportsService(const OUString& rServiceName)
@@ -340,9 +313,7 @@ throw (uno::RuntimeException)
return ::sw::SupportsServiceImpl(
g_nServicesParagraph, g_ServicesParagraph, rServiceName);
}
-/* -----------------------------06.04.00 16:37--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParagraph::getSupportedServiceNames() throw (uno::RuntimeException)
{
@@ -350,9 +321,6 @@ SwXParagraph::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesParagraph, g_ServicesParagraph);
}
-/* -----------------------------11.07.00 14:48--------------------------------
-
- ---------------------------------------------------------------------------*/
void
SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode)
{
@@ -372,22 +340,17 @@ SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode)
}
}
-/*-- 11.12.98 08:12:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXParagraph::getPropertySetInfo()
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRef =
m_pImpl->m_rPropSet.getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 08:12:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::setPropertyValue(const OUString& rPropertyName,
const uno::Any& rValue)
@@ -395,7 +358,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence<OUString> aPropertyNames(1);
aPropertyNames.getArray()[0] = rPropertyName;
uno::Sequence<uno::Any> aValues(1);
@@ -403,24 +366,19 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
m_pImpl->SetPropertyValues_Impl( aPropertyNames, aValues );
}
-/*-- 11.12.98 08:12:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any
SwXParagraph::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence<OUString> aPropertyNames(1);
aPropertyNames.getArray()[0] = rPropertyName;
const uno::Sequence< uno::Any > aRet =
m_pImpl->GetPropertyValues_Impl(aPropertyNames);
return aRet.getConstArray()[0];
}
-/* -----------------------------02.04.01 11:43--------------------------------
- ---------------------------------------------------------------------------*/
void SwXParagraph::Impl::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
@@ -465,7 +423,7 @@ void SAL_CALL SwXParagraph::setPropertyValues(
throw (beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// workaround for bad designed API
try
@@ -482,9 +440,6 @@ throw (beans::PropertyVetoException, lang::IllegalArgumentException,
}
}
-/* -----------------------------02.04.01 11:43--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXParagraph::Impl::GetPropertyValues_Impl(
const uno::Sequence< OUString > & rPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -526,14 +481,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aValues;
}
-/* -----------------------------04.11.03 11:43--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SAL_CALL
SwXParagraph::getPropertyValues(const uno::Sequence< OUString >& rPropertyNames)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -557,9 +509,6 @@ throw (uno::RuntimeException)
return aValues;
}
-/* -----------------------------02.04.01 11:43--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::addPropertiesChangeListener(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -568,9 +517,7 @@ throw (uno::RuntimeException)
OSL_ENSURE(false,
"SwXParagraph::addPropertiesChangeListener(): not implemented");
}
-/* -----------------------------02.04.01 11:43--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw (uno::RuntimeException)
@@ -578,9 +525,7 @@ throw (uno::RuntimeException)
OSL_ENSURE(false,
"SwXParagraph::removePropertiesChangeListener(): not implemented");
}
-/* -----------------------------02.04.01 11:43--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::firePropertiesChangeEvent(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -589,9 +534,6 @@ void SAL_CALL SwXParagraph::firePropertiesChangeEvent(
OSL_ENSURE(false,
"SwXParagraph::firePropertiesChangeEvent(): not implemented");
}
-/* -----------------------------25.09.03 11:09--------------------------------
-
- ---------------------------------------------------------------------------*/
/* disabled for #i46921# */
@@ -601,7 +543,7 @@ SwXParagraph::setPropertyValuesTolerant(
const uno::Sequence< uno::Any >& rValues )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (rPropertyNames.getLength() != rValues.getLength())
{
@@ -664,7 +606,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
catch (beans::UnknownPropertyException &)
{
// should not occur because property was searched for before
- DBG_ERROR( "unexpected exception catched" );
+ OSL_FAIL( "unexpected exception catched" );
pFailed[ nFailed++ ].Result =
beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
}
@@ -689,13 +631,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return aFailed;
}
-
uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL
SwXParagraph::getPropertyValuesTolerant(
const uno::Sequence< OUString >& rPropertyNames )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< beans::GetDirectPropertyTolerantResult > aTmpRes(
m_pImpl->GetPropertyValuesTolerant_Impl( rPropertyNames, false ) );
@@ -713,25 +654,23 @@ throw (uno::RuntimeException)
return aRes;
}
-
uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL
SwXParagraph::getDirectPropertyValuesTolerant(
const uno::Sequence< OUString >& rPropertyNames )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_pImpl->GetPropertyValuesTolerant_Impl( rPropertyNames, true );
}
-
uno::Sequence< beans::GetDirectPropertyTolerantResult >
SwXParagraph::Impl::GetPropertyValuesTolerant_Impl(
const uno::Sequence< OUString >& rPropertyNames,
bool bDirectValuesOnly )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(GetTxtNodeOrThrow());
@@ -820,7 +759,7 @@ throw (uno::RuntimeException)
catch (beans::UnknownPropertyException &)
{
// should not occur because property was searched for before
- DBG_ERROR( "unexpected exception caught" );
+ OSL_FAIL( "unexpected exception caught" );
rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
}
catch (lang::IllegalArgumentException &)
@@ -843,9 +782,6 @@ throw (uno::RuntimeException)
return aResult;
}
-/* -----------------------------12.09.00 11:09--------------------------------
-
- ---------------------------------------------------------------------------*/
bool ::sw::GetDefaultTextContentValue(
uno::Any& rAny, const OUString& rPropertyName, sal_uInt16 nWID)
{
@@ -877,9 +813,7 @@ bool ::sw::GetDefaultTextContentValue(
}
return sal_True;
}
-/*-- 11.12.98 08:12:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -891,9 +825,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXParagraph::addPropertyChangeListener(): not implemented");
}
-/*-- 11.12.98 08:12:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::removePropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -905,9 +836,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXParagraph::removePropertyChangeListener(): not implemented");
}
-/*-- 11.12.98 08:12:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::addVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -919,9 +847,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXParagraph::addVetoableChangeListener(): not implemented");
}
-/*-- 11.12.98 08:12:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::removeVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -933,7 +858,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXParagraph::removeVetoableChangeListener(): not implemented");
}
-//-----------------------------------------------------------------------------
beans::PropertyState lcl_SwXParagraph_getPropertyState(
// SwUnoCrsr& rUnoCrsr,
const SwTxtNode& rTxtNode,
@@ -993,14 +917,11 @@ throw (beans::UnknownPropertyException)
return eRet;
}
-/*-- 05.03.99 11:37:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
beans::PropertyState SAL_CALL
SwXParagraph::getPropertyState(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1019,16 +940,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
lcl_SwXParagraph_getPropertyState(rTxtNode, &pSet, *pEntry, bDummy);
return eRet;
}
-/*-- 05.03.99 11:37:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SAL_CALL
SwXParagraph::getPropertyStates(
const uno::Sequence< OUString >& PropertyNames)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1066,14 +984,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
return aRet;
}
-/*-- 05.03.99 11:37:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::setPropertyToDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1143,15 +1058,12 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
}
-/*-- 05.03.99 11:37:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXParagraph::getPropertyDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1181,27 +1093,21 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 11.12.98 08:12:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXParagraph::attach(const uno::Reference< text::XTextRange > & /*xTextRange*/)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// SwXParagraph will only created in order to be inserted by
// 'insertTextContentBefore' or 'insertTextContentAfter' therefore
// they cannot be attached
throw uno::RuntimeException();
}
-/*-- 11.12.98 08:12:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXParagraph::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1214,12 +1120,9 @@ SwXParagraph::getAnchor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 11.12.98 08:12:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode *const pTxtNode( m_pImpl->GetTxtNode() );
if (pTxtNode)
@@ -1234,14 +1137,11 @@ void SAL_CALL SwXParagraph::dispose() throw (uno::RuntimeException)
}
}
-/*-- 11.12.98 08:12:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetTxtNode())
{
@@ -1249,14 +1149,12 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 11.12.98 08:12:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetTxtNode() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -1265,13 +1163,10 @@ throw (uno::RuntimeException)
}
}
-/*-- 11.12.98 08:12:53---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXParagraph::createEnumeration() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1283,40 +1178,29 @@ SwXParagraph::createEnumeration() throw (uno::RuntimeException)
return xRef;
}
-/*-- 11.12.98 08:12:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXParagraph::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/*-- 11.12.98 08:12:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXParagraph::hasElements() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return (GetTxtNode()) ? sal_True : sal_False;
}
-/*-- 11.12.98 08:12:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SAL_CALL
SwXParagraph::getText() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_xParentText;
}
-/*-- 11.12.98 08:12:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXParagraph::getStart() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1329,13 +1213,11 @@ SwXParagraph::getStart() throw (uno::RuntimeException)
new SwXTextRange(aPam, xParent);
return xRet;
}
-/*-- 11.12.98 08:12:56---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXParagraph::getEnd() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow());
@@ -1349,12 +1231,9 @@ SwXParagraph::getEnd() throw (uno::RuntimeException)
return xRet;
}
-/*-- 11.12.98 08:12:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXParagraph::getString() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString aRet;
SwTxtNode const*const pTxtNode( GetTxtNode() );
if (pTxtNode)
@@ -1374,13 +1253,11 @@ OUString SAL_CALL SwXParagraph::getString() throw (uno::RuntimeException)
}
return aRet;
}
-/*-- 11.12.98 08:12:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXParagraph::setString(const OUString& aString)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwTxtNode const*const pTxtNode( GetTxtNode() );
if (pTxtNode)
@@ -1407,16 +1284,13 @@ throw (uno::RuntimeException)
}
}
-/* -----------------23.03.99 12:49-------------------
- *
- * --------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXParagraph::createContentEnumeration(const OUString& rServiceName)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
- if (!rServiceName.equalsAscii("com.sun.star.text.TextContent"))
+ if (!rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent")))
{
throw uno::RuntimeException();
}
@@ -1429,9 +1303,7 @@ throw (uno::RuntimeException)
new SwXParaFrameEnumeration(aPam, PARAFRAME_PORTION_PARAGRAPH);
return xRet;
}
-/* -----------------23.03.99 12:49-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SAL_CALL
SwXParagraph::getAvailableServiceNames() throw (uno::RuntimeException)
{
@@ -1441,7 +1313,6 @@ SwXParagraph::getAvailableServiceNames() throw (uno::RuntimeException)
return aRet;
}
-
// MetadatableMixin
::sfx2::Metadatable* SwXParagraph::GetCoreObject()
{
@@ -1460,3 +1331,4 @@ uno::Reference<frame::XModel> SwXParagraph::GetModel()
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 6e68c8582d26..28bd86c51759 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <cmdid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svl/itemprop.hxx>
@@ -58,11 +59,9 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-
/******************************************************************
* SwXTextPortion
******************************************************************/
-
static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
{
SwUnoCrsr* pUnoCursor =
@@ -75,9 +74,6 @@ static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
pUnoCursor->Add(& rPortion);
}
-/*-- 11.12.98 09:56:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
uno::Reference< text::XText > const& rParent,
SwTextPortionType eType)
@@ -100,9 +96,6 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
init(*this, pPortionCrsr);
}
-/* -----------------24.03.99 16:30-------------------
- *
- * --------------------------------------------------*/
SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
uno::Reference< text::XText > const& rParent,
SwFrmFmt& rFmt )
@@ -122,9 +115,6 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
init(*this, pPortionCrsr);
}
-/* -----------------------------19.02.01 10:52--------------------------------
-
- ---------------------------------------------------------------------------*/
SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
SwTxtRuby const& rAttr,
uno::Reference< text::XText > const& xParent,
@@ -154,30 +144,23 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
}
}
-/*-- 11.12.98 09:56:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextPortion::~SwXTextPortion()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
delete pUnoCrsr;
}
-/*-- 11.12.98 09:56:56---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXTextPortion::getText()
throw( uno::RuntimeException )
{
return m_xParentText;
}
-/*-- 11.12.98 09:56:56---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextPortion::getStart()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -188,13 +171,11 @@ throw( uno::RuntimeException )
xRet = new SwXTextRange(aPam, xParent);
return xRet;
}
-/*-- 11.12.98 09:56:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextPortion::getEnd()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -205,13 +186,11 @@ throw( uno::RuntimeException )
xRet = new SwXTextRange(aPam, xParent);
return xRet;
}
-/*-- 11.12.98 09:56:57---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextPortion::getString()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString aTxt;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -227,25 +206,21 @@ throw( uno::RuntimeException )
}
return aTxt;
}
-/*-- 11.12.98 09:56:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::setString(const OUString& aString) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
throw uno::RuntimeException();
SwUnoCursorHelper::SetString(*pUnoCrsr, aString);
}
-/*-- 11.12.98 09:56:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextPortion::getPropertySetInfo()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
//! PropertySetInfo for text portion extensions
static uno::Reference< beans::XPropertySetInfo >
xTxtPorExtRef = aSwMapProvider.GetPropertySet(
@@ -258,15 +233,13 @@ throw( uno::RuntimeException )
return (PORTION_REDLINE_START == m_ePortionType ||
PORTION_REDLINE_END == m_ePortionType) ? xRedlPorRef : xTxtPorExtRef;
}
-/*-- 11.12.98 09:56:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException,
beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
throw uno::RuntimeException();
@@ -274,9 +247,7 @@ void SwXTextPortion::setPropertyValue(const OUString& rPropertyName,
SwUnoCursorHelper::SetPropertyValue(*pUnoCrsr, *m_pPropSet,
rPropertyName, aValue);
}
-/*-- 04.11.03 09:56:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::GetPropertyValue(
uno::Any &rVal,
const SfxItemPropertySimpleEntry& rEntry,
@@ -320,7 +291,7 @@ void SwXTextPortion::GetPropertyValue(
OUString sRet;
if( pRet )
- sRet = C2U( pRet );
+ sRet = rtl::OUString::createFromAscii( pRet );
rVal <<= sRet;
}
break;
@@ -430,7 +401,6 @@ void SwXTextPortion::GetPropertyValue(
}
}
-
uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames )
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -462,21 +432,17 @@ uno::Sequence< uno::Any > SAL_CALL SwXTextPortion::GetPropertyValues_Impl(
}
return aValues;
}
-/*-- 11.12.98 09:56:58---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextPortion::getPropertyValue(
const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< ::rtl::OUString > aPropertyNames(1);
aPropertyNames.getArray()[0] = rPropertyName;
return GetPropertyValues_Impl(aPropertyNames).getConstArray()[0];
}
-/* -----------------------------02.04.01 11:44--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextPortion::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
@@ -511,7 +477,7 @@ void SwXTextPortion::setPropertyValues(
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// workaround for bad designed API
try
@@ -527,14 +493,12 @@ void SwXTextPortion::setPropertyValues(
throw aWExc;
}
}
-/* -----------------------------02.04.01 11:44--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXTextPortion::getPropertyValues(
const uno::Sequence< OUString >& rPropertyNames )
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -553,18 +517,14 @@ uno::Sequence< uno::Any > SwXTextPortion::getPropertyValues(
return aValues;
}
-/* -----------------------------29.09.03 11:44--------------------------------
-
- ---------------------------------------------------------------------------*/
/* disabled for #i46921# */
-
uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPropertyValuesTolerant(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (rPropertyNames.getLength() != rValues.getLength())
throw lang::IllegalArgumentException();
@@ -610,7 +570,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr
catch (beans::UnknownPropertyException &)
{
// should not occur because property was searched for before
- DBG_ERROR( "unexpected exception catched" );
+ OSL_FAIL( "unexpected exception catched" );
pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
}
catch (lang::IllegalArgumentException &)
@@ -631,12 +591,11 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr
return aFailed;
}
-
uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SwXTextPortion::getPropertyValuesTolerant(
const uno::Sequence< OUString >& rPropertyNames )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Sequence< beans::GetDirectPropertyTolerantResult > aTmpRes(
GetPropertyValuesTolerant_Impl( rPropertyNames, sal_False ) );
@@ -651,22 +610,20 @@ uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SwXTextPortion::getPr
return aRes;
}
-
uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::getDirectPropertyValuesTolerant(
const uno::Sequence< OUString >& rPropertyNames )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return GetPropertyValuesTolerant_Impl( rPropertyNames, sal_True );
}
-
uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::GetPropertyValuesTolerant_Impl(
const uno::Sequence< OUString >& rPropertyNames,
sal_Bool bDirectValuesOnly )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = this->GetCursor();
if(!pUnoCrsr)
@@ -725,7 +682,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
catch (beans::UnknownPropertyException &)
{
// should not occur because property was searched for before
- DBG_ERROR( "unexpected exception catched" );
+ OSL_FAIL( "unexpected exception catched" );
aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
}
catch (lang::IllegalArgumentException &)
@@ -755,33 +712,23 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
return aResult;
}
-
-/* -----------------------------02.04.01 11:44--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwXTextPortion::addPropertiesChangeListener(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{}
-/* -----------------------------02.04.01 11:44--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextPortion::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{}
-/* -----------------------------02.04.01 11:44--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextPortion::firePropertiesChangeEvent(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{}
-/*-- 11.12.98 09:56:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::addPropertyChangeListener(
const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
@@ -789,34 +736,26 @@ void SwXTextPortion::addPropertyChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 09:56:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 09:56:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 09:56:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 08.03.99 09:41:43---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -834,14 +773,12 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN
}
return eRet;
}
-/*-- 08.03.99 09:41:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates(
const uno::Sequence< OUString >& rPropertyNames)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if(!pUnoCrsr)
throw uno::RuntimeException();
@@ -862,13 +799,11 @@ uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates(
}
return aRet;
}
-/*-- 08.03.99 09:41:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::setPropertyToDefault(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
throw uno::RuntimeException();
@@ -876,13 +811,11 @@ void SwXTextPortion::setPropertyToDefault(const OUString& rPropertyName)
SwUnoCursorHelper::SetPropertyToDefault(
*pUnoCrsr, *m_pPropSet, rPropertyName);
}
-/*-- 08.03.99 09:41:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -893,24 +826,19 @@ uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName)
return aRet;
}
-/*-- 11.12.98 09:56:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextPortion::attach(const uno::Reference< text::XTextRange > & /*xTextRange*/)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// SwXTextPortion cannot be created at the factory therefore
// they cannot be attached
throw uno::RuntimeException();
}
-/*-- 11.12.98 09:57:00---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextPortion::getAnchor()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > aRet;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
@@ -919,13 +847,11 @@ throw( uno::RuntimeException )
aRet = new SwXTextRange(*pUnoCrsr, m_xParentText);
return aRet;
}
-/*-- 11.12.98 09:57:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::dispose()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
throw uno::RuntimeException();
@@ -933,33 +859,27 @@ throw( uno::RuntimeException )
setString(aEmptyStr);
pUnoCrsr->Remove(this);
}
-/*-- 11.12.98 09:57:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetRegisteredIn())
throw uno::RuntimeException();
m_ListenerContainer.AddListener(aListener);
}
-/*-- 11.12.98 09:57:01---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetRegisteredIn() || !m_ListenerContainer.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/* -----------------24.03.99 13:30-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumeration(const OUString& /*aServiceName*/)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if(!pUnoCrsr)
throw uno::RuntimeException();
@@ -970,17 +890,13 @@ uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumerat
return xRet;
}
-/* -----------------------------04.07.01 08:52--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------04.07.01 08:52--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -992,32 +908,26 @@ sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
}
return 0;
}
-/* -----------------24.03.99 13:30-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextPortion::getAvailableServiceNames()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRet(1);
OUString* pArray = aRet.getArray();
pArray[0] = C2U("com.sun.star.text.TextContent");
return aRet;
}
-/* -----------------25.03.99 10:30-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextPortion::getImplementationName()
throw( uno::RuntimeException )
{
return C2U("SwXTextPortion");
}
-/* -----------------25.03.99 10:30-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextPortion::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if(!pUnoCrsr)
throw uno::RuntimeException();
@@ -1036,13 +946,11 @@ sal_Bool SwXTextPortion::supportsService(const OUString& rServiceName) throw( un
return bRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextPortion::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
if (!pUnoCrsr)
throw uno::RuntimeException();
@@ -1058,9 +966,7 @@ throw( uno::RuntimeException )
pArray[6] = C2U("com.sun.star.style.ParagraphPropertiesComplex");
return aRet;
}
-/*-- 11.12.98 09:57:01---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextPortion::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -1070,3 +976,4 @@ void SwXTextPortion::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 560fdc27a5b3..3226f6b19b42 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,7 +58,7 @@
#include <unoidx.hxx>
#include <redline.hxx>
#include <crsskip.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <set>
@@ -83,7 +84,6 @@ static void lcl_CreatePortions(
FrameDependSortList_t & i_rFrames,
const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos );
-
namespace
{
static const sal_uInt8 BKM_TYPE_START = 0;
@@ -112,7 +112,7 @@ namespace
struct BookmarkCompareStruct
{
bool operator () ( const SwXBookmarkPortion_ImplSharedPtr &r1,
- const SwXBookmarkPortion_ImplSharedPtr &r2 )
+ const SwXBookmarkPortion_ImplSharedPtr &r2 ) const
{
// #i16896# for bookmark portions at the same position, the start should
// always precede the end. Hence compare positions, and use bookmark type
@@ -193,21 +193,15 @@ namespace
}
}
-
/******************************************************************
* SwXTextPortionEnumeration
******************************************************************/
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething(
const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
@@ -220,26 +214,20 @@ throw(uno::RuntimeException)
}
return 0;
}
-/* -----------------------------06.04.00 16:39--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextPortionEnumeration::getImplementationName()
throw( RuntimeException )
{
return C2U("SwXTextPortionEnumeration");
}
-/* -----------------------------06.04.00 16:39--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool
SwXTextPortionEnumeration::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return C2U("com.sun.star.text.TextPortionEnumeration") == rServiceName;
}
-/* -----------------------------06.04.00 16:39--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextPortionEnumeration::getSupportedServiceNames()
throw( RuntimeException )
{
@@ -249,9 +237,6 @@ throw( RuntimeException )
return aRet;
}
-/*-- 27.01.99 10:44:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextPortionEnumeration::SwXTextPortionEnumeration(
SwPaM& rParaCrsr,
uno::Reference< XText > const & xParentText,
@@ -283,34 +268,27 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
pUnoCrsr->Add(this);
}
-/*-- 27.01.99 10:44:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextPortionEnumeration::~SwXTextPortionEnumeration()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCursor();
delete pUnoCrsr;
}
-/*-- 27.01.99 10:44:44---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextPortionEnumeration::hasMoreElements()
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return (m_Portions.size() > 0) ? sal_True : sal_False;
}
-/*-- 27.01.99 10:44:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextPortionEnumeration::nextElement()
throw( container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_Portions.size())
throw container::NoSuchElementException();
@@ -321,8 +299,6 @@ throw( container::NoSuchElementException, lang::WrappedTargetException,
return any;
}
-//======================================================================
-
typedef ::std::deque< xub_StrLen > FieldMarks_t;
static void
@@ -353,13 +329,13 @@ lcl_ExportFieldMark(
SwDoc* pDoc = pUnoCrsr->GetDoc();
//flr: maybe its a good idea to add a special hint to the hints array and rely on the hint segmentation....
const xub_StrLen start = pUnoCrsr->Start()->nContent.GetIndex();
- ASSERT(pUnoCrsr->End()->nContent.GetIndex() == start,
+ OSL_ENSURE(pUnoCrsr->End()->nContent.GetIndex() == start,
"hmm --- why is this different");
pUnoCrsr->Right(1, CRSR_SKIP_CHARS, sal_False, sal_False);
if ( *pUnoCrsr->GetMark() == *pUnoCrsr->GetPoint() )
{
- ASSERT(false, "cannot move cursor?");
+ OSL_ENSURE(false, "cannot move cursor?");
return 0;
}
@@ -376,7 +352,7 @@ lcl_ExportFieldMark(
pUnoCrsr, i_xParentText, PORTION_FIELD_START);
xRef = pPortion;
if (pPortion && pFieldmark && pDoc)
- pPortion->SetBookmark(new SwXFieldmark(false, pFieldmark, pDoc));
+ pPortion->SetBookmark( SwXFieldmark::CreateXFieldmark( *pDoc, *pFieldmark ) );
}
else if (CH_TXT_ATR_FIELDEND == Char)
{
@@ -390,7 +366,7 @@ lcl_ExportFieldMark(
pUnoCrsr, i_xParentText, PORTION_FIELD_END);
xRef = pPortion;
if (pPortion && pFieldmark && pDoc)
- pPortion->SetBookmark(new SwXFieldmark(false, pFieldmark, pDoc));
+ pPortion->SetBookmark( SwXFieldmark::CreateXFieldmark( *pDoc, *pFieldmark ) );
}
else if (CH_TXT_ATR_FORMELEMENT == Char)
{
@@ -404,18 +380,15 @@ lcl_ExportFieldMark(
pUnoCrsr, i_xParentText, PORTION_FIELD_START_END);
xRef = pPortion;
if (pPortion && pFieldmark && pDoc)
- pPortion->SetBookmark(new SwXFieldmark(true, pFieldmark, pDoc));
+ pPortion->SetBookmark( SwXFieldmark::CreateXFieldmark( *pDoc, *pFieldmark ) );
}
else
{
- ASSERT(false, "no fieldmark found?");
+ OSL_ENSURE(false, "no fieldmark found?");
}
return xRef;
}
-/* -----------------------------31.08.00 14:28--------------------------------
-
- ---------------------------------------------------------------------------*/
static Reference<XTextRange>
lcl_CreateRefMarkPortion(
Reference<XText> const& xParent,
@@ -446,7 +419,6 @@ lcl_CreateRefMarkPortion(
return pPortion;
}
-//-----------------------------------------------------------------------------
static void
lcl_InsertRubyPortion(
TextRangeList_t & rPortions,
@@ -460,7 +432,6 @@ lcl_InsertRubyPortion(
pPortion->SetCollapsed(rAttr.GetEnd() ? false : true);
}
-//-----------------------------------------------------------------------------
static Reference<XTextRange>
lcl_CreateTOXMarkPortion(
Reference<XText> const& xParent,
@@ -490,7 +461,6 @@ lcl_CreateTOXMarkPortion(
return pPortion;
}
-//-----------------------------------------------------------------------------
static uno::Reference<text::XTextRange>
lcl_CreateMetaPortion(
uno::Reference<text::XText> const& xParent,
@@ -517,7 +487,6 @@ lcl_CreateMetaPortion(
return pPortion;
}
-//-----------------------------------------------------------------------------
static void
lcl_ExportBookmark(
TextRangeList_t & rPortions,
@@ -585,11 +554,6 @@ lcl_ExportSoftPageBreak(
}
}
-
-/* -----------------------------18.12.00 14:51--------------------------------
-
- ---------------------------------------------------------------------------*/
-//-----------------------------------------------------------------------------
#define REDLINE_PORTION_START_REMOVE 0//removed redlines are visible
#define REDLINE_PORTION_END_REMOVE 1//removed redlines are visible
#define REDLINE_PORTION_REMOVE 2//removed redlines are NOT visible
@@ -634,7 +598,6 @@ struct RedlineCompareStruct
typedef std::multiset < SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct >
SwXRedlinePortion_ImplList;
-//-----------------------------------------------------------------------------
static Reference<XTextRange>
lcl_ExportHints(
PortionStack_t & rPortionStack,
@@ -694,7 +657,7 @@ lcl_ExportHints(
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
{
- ASSERT(*pAttr->GetStart() != *pAttr->GetEnd(),
+ OSL_ENSURE(*pAttr->GetStart() != *pAttr->GetEnd(),
"empty meta?");
if ((i_nStartPos > 0) &&
(*pAttr->GetStart() < i_nStartPos))
@@ -713,7 +676,7 @@ lcl_ExportHints(
PortionList_t Top = rPortionStack.top();
if (Top.second != pAttr)
{
- ASSERT(false, "ExportHints: stack error" );
+ OSL_ENSURE(false, "ExportHints: stack error" );
}
else
{
@@ -846,7 +809,7 @@ lcl_ExportHints(
case RES_TXTATR_CHARFMT:
break; // these are handled as properties of a "Text" portion
default:
- DBG_ERROR("unknown attribute");
+ OSL_FAIL("unknown attribute");
break;
}
}
@@ -885,7 +848,6 @@ lcl_ExportHints(
return xRef;
}
-//-----------------------------------------------------------------------------
void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr,
const xub_StrLen nCurrentIndex,
const sal_Int32 nNextFrameIndex, const sal_Int32 nNextPortionIndex,
@@ -926,7 +888,6 @@ void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr,
}
}
-//-----------------------------------------------------------------------------
static void
lcl_FillRedlineArray(SwDoc const & rDoc, SwUnoCrsr const & rUnoCrsr,
SwXRedlinePortion_ImplList& rRedArr )
@@ -954,7 +915,6 @@ lcl_FillRedlineArray(SwDoc const & rDoc, SwUnoCrsr const & rUnoCrsr,
}
}
-//-----------------------------------------------------------------------------
static void
lcl_FillSoftPageBreakArray(
SwUnoCrsr const & rUnoCrsr, SwSoftPageBreakList& rBreakArr )
@@ -965,9 +925,6 @@ lcl_FillSoftPageBreakArray(
pTxtNode->fillSoftPageBreakList( rBreakArr );
}
-/* -----------------------------19.12.00 12:25--------------------------------
-
- ---------------------------------------------------------------------------*/
static void
lcl_ExportRedline(
TextRangeList_t & rPortions,
@@ -999,9 +956,6 @@ lcl_ExportRedline(
}
}
-/* -----------------------------19.12.00 13:09--------------------------------
-
- ---------------------------------------------------------------------------*/
static void
lcl_ExportBkmAndRedline(
TextRangeList_t & rPortions,
@@ -1022,7 +976,6 @@ lcl_ExportBkmAndRedline(
lcl_ExportSoftPageBreak(rPortions, xParent, pUnoCrsr, rBreakArr, nIndex);
}
-//-----------------------------------------------------------------------------
static sal_Int32
lcl_ExportFrames(
TextRangeList_t & rPortions,
@@ -1049,7 +1002,6 @@ lcl_ExportFrames(
return i_rFrames.size() ? i_rFrames.front().nIndex : -1;
}
-//-----------------------------------------------------------------------------
static sal_Int32
lcl_GetNextIndex(
SwXBookmarkPortion_ImplList const & rBkmArr,
@@ -1077,7 +1029,6 @@ lcl_GetNextIndex(
return nRet;
};
-//-----------------------------------------------------------------------------
static void
lcl_CreatePortions(
TextRangeList_t & i_rPortions,
@@ -1129,7 +1080,7 @@ lcl_CreatePortions(
SwTxtNode * const pTxtNode = pUnoCrsr->GetNode()->GetTxtNode();
if (!pTxtNode)
{
- DBG_ERROR("lcl_CreatePortions: no TextNode - what now ?");
+ OSL_FAIL("lcl_CreatePortions: no TextNode - what now ?");
return;
}
@@ -1163,7 +1114,7 @@ lcl_CreatePortions(
bCursorMoved, nNextAttrIndex);
if (PortionStack.empty())
{
- ASSERT(false, "CreatePortions: stack underflow");
+ OSL_ENSURE(false, "CreatePortions: stack underflow");
return;
}
}
@@ -1180,7 +1131,7 @@ lcl_CreatePortions(
}
else
{
- ASSERT(!FieldMarks.size() ||
+ OSL_ENSURE(!FieldMarks.size() ||
(FieldMarks.front() != nCurrentIndex),
"fieldmark and hint with CH_TXTATR at same pos?");
}
@@ -1212,15 +1163,13 @@ lcl_CreatePortions(
}
}
- ASSERT((PortionStack.size() == 1) && !PortionStack.top().second,
+ OSL_ENSURE((PortionStack.size() == 1) && !PortionStack.top().second,
"CreatePortions: stack error" );
}
-/*-- 27.01.99 10:44:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextPortionEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 7b8e1fc8dadb..9e3437915ee5 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -778,8 +779,12 @@ const SwPropNameTab aPropNameTab = {
/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel
/* 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")},
+// FIXME: these numbers are not correct post merge ...
+/* 0739 UNO_NAME_IS_TEMPLATE */ {MAP_CHAR_LEN("IsTemplate")},
/* 0740 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
+/* 0740 UNO_NAME_VBA_DOCOBJ */ {MAP_CHAR_LEN("ThisVBADocObj")},
+
+/* 0741 UNO_NAME_NESTED_TEXT_CONTENT */ {MAP_CHAR_LEN("NestedTextContent")},
};
const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
@@ -792,3 +797,5 @@ const SwPropNameLen& GetPropName( sal_uInt16 nId )
"GetPropName(): Wrong index" );
return aPropNameTab[ nId - SW_PROPNAME_BEGIN];
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 9e9d042c519d..18b30f77df44 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <com/sun/star/text/XTextTable.hpp>
#include <rtl/ustrbuf.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <pagedesc.hxx>
@@ -56,25 +57,17 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
SwXRedlineText::SwXRedlineText(SwDoc* _pDoc, SwNodeIndex aIndex) :
SwXText(_pDoc, CURSOR_REDLINE),
aNodeIndex(aIndex)
{
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
const SwStartNode* SwXRedlineText::GetStartNode() const
{
return aNodeIndex.GetNode().GetStartNode();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -97,9 +90,7 @@ uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedlineText::getTypes()
throw(uno::RuntimeException)
{
@@ -113,13 +104,11 @@ uno::Sequence<uno::Type> SwXRedlineText::getTypes()
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -129,13 +118,11 @@ uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
}
return aId;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwPosition aPos(aNodeIndex);
SwXTextCursor *const pXCursor =
@@ -174,9 +161,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
return static_cast<text::XWordCursor*>(pXCursor);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
const uno::Reference<text::XTextRange> & aTextRange)
throw( uno::RuntimeException )
@@ -186,55 +171,41 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
xCursor->gotoRange(aTextRange->getEnd(), sal_True);
return xCursor;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwPaM aPam(aNodeIndex);
aPam.Move(fnMoveForward, fnGoNode);
::std::auto_ptr<SwUnoCrsr> pUnoCursor(
GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False));
return new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedlineText::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException)
{
return sal_True; // we always have a content index
}
-/* -----------------------------19.12.00 11:36--------------------------------
- ---------------------------------------------------------------------------*/
SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
const SwUnoCrsr* pPortionCrsr,
uno::Reference< text::XText > xParent, sal_Bool bStart) :
SwXTextPortion(pPortionCrsr, xParent, bStart ? PORTION_REDLINE_START : PORTION_REDLINE_END),
-// SwXText(pPortionCrsr->GetDoc(), CURSOR_REDLINE),
-// SwXRedlineText(pPortionCrsr->GetDoc(), *pRed->GetContentIdx()),
pRedline(pRed)
{
SetCollapsed(!pRedline->HasMark());
}
-/*-- 19.12.00 11:37:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlinePortion::~SwXRedlinePortion()
{
}
-/* -----------------------------19.12.00 11:46--------------------------------
- ---------------------------------------------------------------------------*/
static util::DateTime lcl_DateTimeToUno(const DateTime& rDT)
{
util::DateTime aRetDT;
@@ -248,7 +219,6 @@ static util::DateTime lcl_DateTimeToUno(const DateTime& rDT)
return aRetDT;
}
-// ---------------------------------------------------------------------------
static OUString lcl_RedlineTypeToOUString(RedlineType_t eType)
{
OUString sRet;
@@ -263,7 +233,6 @@ static OUString lcl_RedlineTypeToOUString(RedlineType_t eType)
return sRet;
}
-// ---------------------------------------------------------------------------
static uno::Sequence<beans::PropertyValue> lcl_GetSuccessorProperties(const SwRedline& rRedline)
{
uno::Sequence<beans::PropertyValue> aValues(4);
@@ -272,24 +241,24 @@ static uno::Sequence<beans::PropertyValue> lcl_GetSuccessorProperties(const SwRe
if(pNext)
{
beans::PropertyValue* pValues = aValues.getArray();
- pValues[0].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_AUTHOR));
+ pValues[0].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_AUTHOR));
// GetAuthorString(n) walks the SwRedlineData* chain;
// here we always need element 1
pValues[0].Value <<= OUString(rRedline.GetAuthorString(1));
- pValues[1].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_DATE_TIME));
+ pValues[1].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_DATE_TIME));
pValues[1].Value <<= lcl_DateTimeToUno(pNext->GetTimeStamp());
- pValues[2].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_COMMENT));
+ pValues[2].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_COMMENT));
pValues[2].Value <<= OUString(pNext->GetComment());
- pValues[3].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TYPE));
+ pValues[3].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TYPE));
pValues[3].Value <<= lcl_RedlineTypeToOUString(pNext->GetType());
}
return aValues;
}
-// ---------------------------------------------------------------------------
+
uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Validate();
uno::Any aRet;
if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_TEXT)))
@@ -317,9 +286,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
}
return aRet;
}
-/* -----------------------------19.12.00 15:16--------------------------------
- ---------------------------------------------------------------------------*/
void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
{
SwUnoCrsr* pUnoCrsr = GetCursor();
@@ -334,12 +301,10 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
if(!bFound)
throw uno::RuntimeException();
}
-/* -----------------------------21.03.00 15:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -349,9 +314,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th
}
return aId;
}
-/* -----------------------------11.01.01 16:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw()
{
uno::Any aRet;
@@ -391,9 +354,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
}
return aRet;
}
-/* -----------------------------11.01.01 11:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties(
const SwRedline& rRedline, sal_Bool bIsStart ) throw()
{
@@ -405,25 +366,25 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
sRedlineIdBuf.append( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&rRedline) ) );
sal_Int32 nPropIdx = 0;
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_AUTHOR));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_AUTHOR));
pRet[nPropIdx++].Value <<= OUString(rRedline.GetAuthorString());
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_DATE_TIME));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_DATE_TIME));
pRet[nPropIdx++].Value <<= lcl_DateTimeToUno(rRedline.GetTimeStamp());
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_COMMENT));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_COMMENT));
pRet[nPropIdx++].Value <<= OUString(rRedline.GetComment());
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TYPE));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TYPE));
pRet[nPropIdx++].Value <<= lcl_RedlineTypeToOUString(rRedline.GetType());
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_IDENTIFIER));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_IDENTIFIER));
pRet[nPropIdx++].Value <<= sRedlineIdBuf.makeStringAndClear();
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_IS_COLLAPSED));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_COLLAPSED));
sal_Bool bTmp = !rRedline.HasMark();
pRet[nPropIdx++].Value.setValue(&bTmp, ::getBooleanCppuType()) ;
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_IS_START));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_START));
pRet[nPropIdx++].Value.setValue(&bIsStart, ::getBooleanCppuType()) ;
bTmp = !rRedline.IsDelLastPara();
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_MERGE_LAST_PARA));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_MERGE_LAST_PARA));
pRet[nPropIdx++].Value.setValue(&bTmp, ::getBooleanCppuType()) ;
SwNodeIndex* pNodeIdx = rRedline.GetContentIdx();
@@ -432,7 +393,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
if ( 1 < ( pNodeIdx->GetNode().EndOfSectionIndex() - pNodeIdx->GetNode().GetIndex() ) )
{
uno::Reference<text::XText> xRet = new SwXRedlineText(rRedline.GetDoc(), *pNodeIdx);
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TEXT));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_TEXT));
pRet[nPropIdx++].Value <<= xRet;
}
else {
@@ -441,15 +402,13 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
}
if(pNext)
{
- pRet[nPropIdx].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_REDLINE_SUCCESSOR_DATA));
+ pRet[nPropIdx].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_REDLINE_SUCCESSOR_DATA));
pRet[nPropIdx++].Value <<= lcl_GetSuccessorProperties(rRedline);
}
aRet.realloc(nPropIdx);
return aRet;
}
-/*-- 11.01.01 17:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXRedline, SwClient);
SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
SwXText(&rDoc, CURSOR_REDLINE),
@@ -458,41 +417,32 @@ SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedline::~SwXRedline()
{
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(uno::RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > xRef =
aSwMapProvider.GetPropertySet(PROPERTY_MAP_REDLINE)->getPropertySetInfo();
return xRef;
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_AUTHOR)))
{
- DBG_ERROR("currently not available");
+ OSL_FAIL("currently not available");
}
else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_DATE_TIME)))
{
- DBG_ERROR("currently not available");
-// util::DateTime aDT;
-// if(aValue >>= aDT)
-// pRedline->SetTimeStamp(lcl_DateTimeFromUno(aDT));
+ OSL_FAIL("currently not available");
}
else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_COMMENT)))
{
@@ -501,57 +451,25 @@ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any
}
else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_TYPE)))
{
- DBG_ERROR("currently not available");
+ OSL_FAIL("currently not available");
OUString sTmp; aValue >>= sTmp;
if(!sTmp.getLength())
throw lang::IllegalArgumentException();
-// pRedline->SetType(lcl_OUStringToRedlineType(sTmp));
}
else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_REDLINE_SUCCESSOR_DATA)))
{
- DBG_ERROR("currently not available");
-/* SwRedlineData* pNext = pRedline->GetRedlineData().Next();
- uno::Sequence<beans::PropertyValue> aValues;
- if(!(aValue =>> aValues) || !pNext)
- throw lang::IllegalArgumentException();
-
- const beans::PropertyValue* pValues = aValues.getConstArray();
- for(sal_Int32 nValue = 0; nValue < aValues.getLength(); nValue++)
- {
- if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_AUTHOR.pName)
- {
- DBG_ERROR("currently not available");
- }
- else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_DATE_TIME.pName))
- {
- util::DateTime aDT;
- if(pValues[nValue].Value >>= aDT)
- pNext->SetTimeStamp(lcl_DateTimeFromUno(aDT));
- }
- else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_COMMENT.pName))
- {
- OUString sTmp; pValues[nValue].Value >>= sTmp;
- pNext->SetComment(sTmp);
- }
- else if(pValues[nValue].Name.equalsAscii(UNO_NAME_REDLINE_TYPE.pName))
- {
- OUString sTmp; pValues[nValue].Value >>= sTmp;
- pNext->SetType(lcl_OUStringToRedlineType(sTmp);
- }
- }
-*/ }
+ OSL_FAIL("currently not available");
+ }
else
{
throw lang::IllegalArgumentException();
}
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
uno::Any aRet;
@@ -594,7 +512,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
}
break;
default:
- DBG_ERROR("illegal node type");
+ OSL_FAIL("illegal node type");
}
aRet <<= xRet;
}
@@ -617,42 +535,32 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline);
return aRet;
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addPropertyChangeListener(
const OUString& /*aPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removePropertyChangeListener(
const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -662,12 +570,10 @@ void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pRedline = 0;
}
}
-/*-- 19.12.00 11:37:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< container::XEnumeration > xRet;
if(!pDoc)
throw uno::RuntimeException();
@@ -683,28 +589,22 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) t
}
return xRet;
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedline::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedline::hasElements( ) throw(uno::RuntimeException)
{
if(!pDoc)
throw uno::RuntimeException();
return 0 != pRedline->GetContentIdx();
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!pDoc)
throw uno::RuntimeException();
@@ -737,18 +637,14 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u
}
return xRet;
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursorByRange(
const uno::Reference< text::XTextRange > & /*aTextPosition*/)
throw( uno::RuntimeException )
{
throw uno::RuntimeException();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedline::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -759,9 +655,7 @@ uno::Any SwXRedline::queryInterface( const uno::Type& rType )
}
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedline::getTypes()
throw(uno::RuntimeException)
{
@@ -775,13 +669,11 @@ uno::Sequence<uno::Type> SwXRedline::getTypes()
pTypes[nCurType++] = pBaseTypes[nType];
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -792,3 +684,4 @@ uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
return aId;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index 774e9732e949..332cfc406b4b 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <tools/debug.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unoredlines.hxx>
@@ -47,37 +48,28 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-/*-- 11.01.01 15:28:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXRedlines::SwXRedlines(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlines::~SwXRedlines()
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count();
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
@@ -91,63 +83,49 @@ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
return uno::Reference< container::XEnumeration >(new SwXRedlineEnumeration(*GetDoc()));
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXRedlines::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count() > 0;
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlines");
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/)
throw( uno::RuntimeException )
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
return sal_False;
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
- DBG_ERROR("not implemented");
+ OSL_FAIL("not implemented");
return uno::Sequence< OUString >();
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::XPropertySet* SwXRedlines::GetObject( SwRedline& rRedline, SwDoc& rDoc )
{
SwPageDesc* pStdDesc = rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD);
@@ -163,33 +141,25 @@ beans::XPropertySet* SwXRedlines::GetObject( SwRedline& rRedline, SwDoc& rDoc
pxRedline = new SwXRedline(rRedline, rDoc);
return pxRedline;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::SwXRedlineEnumeration(SwDoc& rDoc) :
pDoc(&rDoc),
nCurrentIndex(0)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::~SwXRedlineEnumeration()
{
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException )
{
if(!pDoc)
throw uno::RuntimeException();
return pDoc->GetRedlineTbl().Count() > nCurrentIndex;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlineEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -203,33 +173,27 @@ uno::Any SwXRedlineEnumeration::nextElement(void)
aRet <<= xRet;
return aRet;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlineEnumeration");
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException )
{
return sal_False;
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
return uno::Sequence< OUString >();
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedlineEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
pDoc = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 1bb59d0eee65..ea10f94d8e10 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unomid.h>
@@ -52,7 +53,6 @@ using ::rtl::OUString;
/******************************************************************
* SwXReferenceMark
******************************************************************/
-
class SwXReferenceMark::Impl
: public SwClient
{
@@ -88,9 +88,6 @@ public:
};
-/* -----------------------------07.01.00 12:51--------------------------------
-
- ---------------------------------------------------------------------------*/
void SwXReferenceMark::Impl::Invalidate()
{
if (IsValid())
@@ -102,9 +99,6 @@ void SwXReferenceMark::Impl::Invalidate()
m_pMarkFmt = 0;
}
-/*-- 11.12.98 10:28:37---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -128,19 +122,12 @@ void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
-/*-- 11.12.98 10:28:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXReferenceMark::SwXReferenceMark(
SwDoc *const pDoc, SwFmtRefMark const*const pRefMark)
: m_pImpl( new SwXReferenceMark::Impl(*this, pDoc, pRefMark) )
{
}
-/*-- 11.12.98 10:28:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXReferenceMark::~SwXReferenceMark()
{
}
@@ -152,20 +139,6 @@ SwXReferenceMark::GetReferenceMark(
// #i105557#: do not iterate over the registered clients: race condition
// to do this properly requires the SwXReferenceMark to register at the
// SwFmtRefMark directly, not at the unocallback
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXReferenceMark::Impl * pXMark =
- static_cast<SwXReferenceMark::Impl*>(
- aIter.First( TYPE( SwXReferenceMark::Impl ) ));
- while (pXMark)
- {
- if (pXMark->m_pMarkFmt == &rMarkFmt)
- {
- return &pXMark->m_rThis;
- }
- pXMark = static_cast<SwXReferenceMark::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
@@ -180,41 +153,33 @@ SwXReferenceMark::CreateXReferenceMark(
: new SwXReferenceMark(&rDoc, &rMarkFmt);
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXReferenceMark::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
{
return ::sw::UnoTunnelImpl<SwXReferenceMark>(rId, this);
}
-/* -----------------------------06.04.00 16:41--------------------------------
- ---------------------------------------------------------------------------*/
OUString SAL_CALL SwXReferenceMark::getImplementationName()
throw (uno::RuntimeException)
{
return C2U("SwXReferenceMark");
}
-/* -----------------------------06.04.00 16:41--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesReferenceMark[] =
{
"com.sun.star.text.TextContent",
"com.sun.star.text.ReferenceMark",
};
+
static const size_t g_nServicesReferenceMark(
- sizeof(g_ServicesReferenceMark)/sizeof(g_ServicesReferenceMark[0]));
+ SAL_N_ELEMENTS(g_ServicesReferenceMark));
sal_Bool SAL_CALL
SwXReferenceMark::supportsService(const OUString& rServiceName)
@@ -223,9 +188,7 @@ throw (uno::RuntimeException)
return ::sw::SupportsServiceImpl(
g_nServicesReferenceMark, g_ServicesReferenceMark, rServiceName);
}
-/* -----------------------------06.04.00 16:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXReferenceMark::getSupportedServiceNames()
throw (uno::RuntimeException)
@@ -234,9 +197,6 @@ throw (uno::RuntimeException)
g_nServicesReferenceMark, g_ServicesReferenceMark);
}
-/* -----------------03.11.99 14:14-------------------
-
- --------------------------------------------------*/
template<typename T> struct NotContainedIn
{
::std::vector<T> const& m_rVector;
@@ -301,8 +261,10 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
}
else
{
- pTxtAttr = rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
- rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK);
+ SwTxtNode *pTxtNd = rPam.GetNode()->GetTxtNode();
+ OSL_ASSERT(pTxtNd);
+ pTxtAttr = pTxtNd ? rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt(
+ rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK) : NULL;
}
if (!pTxtAttr)
@@ -316,14 +278,11 @@ void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam,
pDoc2->GetUnoCallBack()->Add(this);
}
-/*-- 11.12.98 10:28:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXReferenceMark::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->m_bIsDescriptor)
{
@@ -353,13 +312,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->m_pDoc = pDocument;
}
-/*-- 11.12.98 10:28:34---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXReferenceMark::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (m_pImpl->IsValid())
{
@@ -386,12 +342,10 @@ SwXReferenceMark::getAnchor() throw (uno::RuntimeException)
}
return 0;
}
-/*-- 11.12.98 10:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (m_pImpl->IsValid())
{
SwFmtRefMark const*const pNewMark =
@@ -419,14 +373,12 @@ void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException)
m_pImpl->Invalidate();
}
}
-/*-- 11.12.98 10:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->IsValid())
{
@@ -434,14 +386,12 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 11.12.98 10:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->IsValid() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -449,13 +399,11 @@ throw (uno::RuntimeException)
throw uno::RuntimeException();
}
}
-/*-- 11.12.98 10:28:36---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXReferenceMark::getName()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!m_pImpl->IsValid() ||
!m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName))
{
@@ -463,13 +411,11 @@ throw (uno::RuntimeException)
}
return m_pImpl->m_sMarkName;
}
-/*-- 11.12.98 10:28:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::setName(const OUString& rName)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (m_pImpl->m_bIsDescriptor)
{
m_pImpl->m_sMarkName = rName;
@@ -513,22 +459,17 @@ throw (uno::RuntimeException)
}
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXReferenceMark::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRef =
aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH_EXTENSIONS)
->getPropertySetInfo();
return xRef;
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::setPropertyValue(
const OUString& /*rPropertyName*/, const uno::Any& /*rValue*/ )
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -537,9 +478,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
{
throw lang::IllegalArgumentException();
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXReferenceMark::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -553,9 +492,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
return aRet;
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::addPropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
@@ -565,9 +502,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXReferenceMark::addPropertyChangeListener(): not implemented");
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::removePropertyChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
@@ -577,9 +512,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXReferenceMark::removePropertyChangeListener(): not implemented");
}
-/*-- 12.09.00 12:58:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::addVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
@@ -589,9 +522,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXReferenceMark::addVetoableChangeListener(): not implemented");
}
-/*-- 12.09.00 12:58:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXReferenceMark::removeVetoableChangeListener(
const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
@@ -610,12 +541,9 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
#include <fmtmeta.hxx>
#include <docsh.hxx>
-//=============================================================================
-
/******************************************************************
* SwXMetaText
******************************************************************/
-
class SwXMetaText
: public SwXText
{
@@ -736,11 +664,9 @@ SwXMetaText::createTextCursorByRange(
/******************************************************************
* SwXMeta
******************************************************************/
-
// the Meta has a cached list of text portions for its contents
// this list is created by SwXTextPortionEnumeration
// the Meta listens at the SwTxtNode and throws away the cache when it changes
-
class SwXMeta::Impl
: public SwClient
{
@@ -876,7 +802,6 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta,
return xMeta;
}
-
bool SwXMeta::SetContentRange(
SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd ) const
{
@@ -906,7 +831,7 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
xub_StrLen nMetaStart;
xub_StrLen nMetaEnd;
const bool bSuccess( SetContentRange(pTxtNode, nMetaStart, nMetaEnd) );
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (!bSuccess)
throw lang::DisposedException();
@@ -987,8 +912,9 @@ static char const*const g_ServicesMeta[] =
"com.sun.star.text.TextContent",
"com.sun.star.text.InContentMetadata",
};
+
static const size_t g_nServicesMeta(
- sizeof(g_ServicesMeta)/sizeof(g_ServicesMeta[0]));
+ SAL_N_ELEMENTS(g_ServicesMeta));
sal_Bool SAL_CALL
SwXMeta::supportsService(const ::rtl::OUString& rServiceName)
@@ -1004,14 +930,13 @@ SwXMeta::getSupportedServiceNames() throw (uno::RuntimeException)
return ::sw::GetSupportedServiceNamesImpl(g_nServicesMeta, g_ServicesMeta);
}
-
// XComponent
void SAL_CALL
SwXMeta::addEventListener(
uno::Reference< lang::XEventListener> const & xListener )
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
m_pImpl->m_ListenerContainer.AddListener(xListener);
if (m_pImpl->m_bIsDisposed)
@@ -1025,7 +950,7 @@ SwXMeta::removeEventListener(
uno::Reference< lang::XEventListener> const & xListener )
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->m_bIsDisposed)
{
@@ -1036,7 +961,7 @@ throw (uno::RuntimeException)
void SAL_CALL
SwXMeta::dispose() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_pImpl->m_bIsDescriptor)
{
@@ -1051,7 +976,7 @@ SwXMeta::dispose() throw (uno::RuntimeException)
xub_StrLen nMetaStart;
xub_StrLen nMetaEnd;
const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd));
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (bSuccess)
{
// -1 because of CH_TXTATR
@@ -1065,13 +990,12 @@ SwXMeta::dispose() throw (uno::RuntimeException)
}
}
-
void SAL_CALL
SwXMeta::AttachImpl(const uno::Reference< text::XTextRange > & i_xTextRange,
const sal_uInt16 i_nWhich)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_pImpl->m_bIsDisposed)
{
@@ -1140,7 +1064,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
if (!pTxtAttr)
{
- ASSERT(false, "meta inserted, but has no text attribute?");
+ OSL_ENSURE(false, "meta inserted, but has no text attribute?");
throw uno::RuntimeException(
C2S("SwXMeta::attach(): cannot create meta"),
static_cast< ::cppu::OWeakObject* >(this));
@@ -1165,7 +1089,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
uno::Reference< text::XTextRange > SAL_CALL
SwXMeta::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_pImpl->m_bIsDisposed)
{
@@ -1182,7 +1106,7 @@ SwXMeta::getAnchor() throw (uno::RuntimeException)
xub_StrLen nMetaStart;
xub_StrLen nMetaEnd;
const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd));
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (!bSuccess)
{
throw lang::DisposedException(
@@ -1199,35 +1123,35 @@ SwXMeta::getAnchor() throw (uno::RuntimeException)
uno::Reference< text::XText > SAL_CALL
SwXMeta::getText() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return this;
}
uno::Reference< text::XTextRange > SAL_CALL
SwXMeta::getStart() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.getStart();
}
uno::Reference< text::XTextRange > SAL_CALL
SwXMeta::getEnd() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.getEnd();
}
rtl::OUString SAL_CALL
SwXMeta::getString() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.getString();
}
void SAL_CALL
SwXMeta::setString(const rtl::OUString& rString) throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.setString(rString);
}
@@ -1235,7 +1159,7 @@ SwXMeta::setString(const rtl::OUString& rString) throw (uno::RuntimeException)
uno::Reference< text::XTextCursor > SAL_CALL
SwXMeta::createTextCursor() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.createTextCursor();
}
@@ -1244,7 +1168,7 @@ SwXMeta::createTextCursorByRange(
const uno::Reference<text::XTextRange> & xTextPosition)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.createTextCursorByRange(xTextPosition);
}
@@ -1253,7 +1177,7 @@ SwXMeta::insertString(const uno::Reference<text::XTextRange> & xRange,
const rtl::OUString& rString, sal_Bool bAbsorb)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.insertString(xRange, rString, bAbsorb);
}
@@ -1262,7 +1186,7 @@ SwXMeta::insertControlCharacter(const uno::Reference<text::XTextRange> & xRange,
sal_Int16 nControlCharacter, sal_Bool bAbsorb)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.insertControlCharacter(xRange, nControlCharacter,
bAbsorb);
}
@@ -1273,7 +1197,7 @@ SwXMeta::insertTextContent( const uno::Reference<text::XTextRange> & xRange,
const uno::Reference<text::XTextContent> & xContent, sal_Bool bAbsorb)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.insertTextContent(xRange, xContent, bAbsorb);
}
@@ -1282,7 +1206,7 @@ SwXMeta::removeTextContent(
const uno::Reference< text::XTextContent > & xContent)
throw (container::NoSuchElementException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->m_Text.removeTextContent(xContent);
}
@@ -1290,7 +1214,7 @@ SwXMeta::removeTextContent(
uno::Reference< uno::XInterface > SAL_CALL
SwXMeta::getParent() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
SwTxtNode * pTxtNode;
xub_StrLen nMetaStart;
xub_StrLen nMetaEnd;
@@ -1323,7 +1247,7 @@ SwXMeta::getElementType() throw (uno::RuntimeException)
sal_Bool SAL_CALL
SwXMeta::hasElements() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->GetRegisteredIn() ? sal_True : sal_False;
}
@@ -1332,7 +1256,7 @@ SwXMeta::hasElements() throw (uno::RuntimeException)
uno::Reference< container::XEnumeration > SAL_CALL
SwXMeta::createEnumeration() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_pImpl->m_bIsDisposed)
{
@@ -1349,7 +1273,7 @@ SwXMeta::createEnumeration() throw (uno::RuntimeException)
xub_StrLen nMetaStart;
xub_StrLen nMetaEnd;
const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd));
- ASSERT(bSuccess, "no pam?");
+ OSL_ENSURE(bSuccess, "no pam?");
if (!bSuccess)
throw lang::DisposedException();
@@ -1366,7 +1290,6 @@ SwXMeta::createEnumeration() throw (uno::RuntimeException)
}
}
-
// MetadatableMixin
::sfx2::Metadatable* SwXMeta::GetCoreObject()
{
@@ -1388,11 +1311,9 @@ uno::Reference<frame::XModel> SwXMeta::GetModel()
return 0;
}
-
/******************************************************************
* SwXMetaField
******************************************************************/
-
inline const ::sw::MetaField * SwXMeta::Impl::GetMetaField() const
{
return static_cast< const ::sw::MetaField * >(GetRegisteredIn());
@@ -1403,7 +1324,7 @@ SwXMetaField::SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta,
TextRangeList_t const*const pPortions)
: SwXMetaField_Base(pDoc, pMeta, xParentText, pPortions)
{
- ASSERT(pMeta && dynamic_cast< ::sw::MetaField* >(pMeta),
+ OSL_ENSURE(pMeta && dynamic_cast< ::sw::MetaField* >(pMeta),
"SwXMetaField created for wrong hint!");
}
@@ -1429,8 +1350,9 @@ static char const*const g_ServicesMetaField[] =
"com.sun.star.text.TextField",
"com.sun.star.text.textfield.MetadataField",
};
+
static const size_t g_nServicesMetaField(
- sizeof(g_ServicesMetaField)/sizeof(g_ServicesMetaField[0]));
+ SAL_N_ELEMENTS(g_ServicesMetaField));
sal_Bool SAL_CALL
SwXMetaField::supportsService(const ::rtl::OUString& rServiceName)
@@ -1488,7 +1410,7 @@ SwXMetaField::getAnchor() throw (uno::RuntimeException)
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXMetaField::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xRef(
aSwMapProvider.GetPropertySet(PROPERTY_MAP_METAFIELD)
@@ -1503,14 +1425,14 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
::sw::MetaField * const pMeta(
const_cast< ::sw::MetaField * >(m_pImpl->GetMetaField()) );
if (!pMeta)
throw lang::DisposedException();
- if (rPropertyName.equalsAscii("NumberFormat"))
+ if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("NumberFormat")))
{
sal_Int32 nNumberFormat(0);
if (rValue >>= nNumberFormat)
@@ -1518,7 +1440,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
pMeta->SetNumberFormat(static_cast<sal_uInt32>(nNumberFormat));
}
}
- else if (rPropertyName.equalsAscii("IsFixedLanguage"))
+ else if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsFixedLanguage")))
{
bool b(false);
if (rValue >>= b)
@@ -1537,7 +1459,7 @@ SwXMetaField::getPropertyValue(const ::rtl::OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
::sw::MetaField const * const pMeta( m_pImpl->GetMetaField() );
if (!pMeta)
@@ -1545,12 +1467,12 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::Any any;
- if (rPropertyName.equalsAscii("NumberFormat"))
+ if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("NumberFormat")))
{
const ::rtl::OUString text( getPresentation(sal_False) );
any <<= static_cast<sal_Int32>(pMeta->GetNumberFormat(text));
}
- else if (rPropertyName.equalsAscii("IsFixedLanguage"))
+ else if (rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsFixedLanguage")))
{
any <<= pMeta->IsFixedLanguage();
}
@@ -1678,7 +1600,7 @@ getPrefixAndSuffix(
throw;
} catch (uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString::createFromAscii("getPrefixAndSuffix: exception"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getPrefixAndSuffix: exception")),
0, uno::makeAny(e));
}
}
@@ -1688,7 +1610,7 @@ getPrefixAndSuffix(
SwXMetaField::getPresentation(sal_Bool bShowCommand)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (bShowCommand)
{
@@ -1706,3 +1628,4 @@ throw (uno::RuntimeException)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index f95ac3385938..f532cd1b878c 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,7 +39,7 @@
#include <editeng/xmlcnitm.hxx>
#include <sfx2/linkmgr.hxx>
#include <sfx2/lnkbase.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <fmtclds.hxx>
#include <unotextrange.hxx>
@@ -61,20 +62,14 @@
#include <doctxm.hxx>
#include <fmtftntx.hxx>
#include <fmtclbl.hxx>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <editeng/frmdiritem.hxx>
#include <fmtcntnt.hxx>
-/* #109700# */
#include <editeng/lrspitem.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
-
-/******************************************************************
- *
- ******************************************************************/
struct SwTextSectionProperties_Impl
{
uno::Sequence<sal_Int8> m_Password;
@@ -90,15 +85,13 @@ struct SwTextSectionProperties_Impl
::std::auto_ptr<SvXMLAttrContainerItem> m_pXMLAttr;
::std::auto_ptr<SwFmtNoBalancedColumns> m_pNoBalanceItem;
::std::auto_ptr<SvxFrameDirectionItem> m_pFrameDirItem;
- ::std::auto_ptr<SvxLRSpaceItem> m_pLRSpaceItem; // #109700#
+ ::std::auto_ptr<SvxLRSpaceItem> m_pLRSpaceItem;
bool m_bDDE;
bool m_bHidden;
bool m_bCondHidden;
bool m_bProtect;
- // --> FME 2004-06-22 #114856# edit in readonly sections
bool m_bEditInReadonly;
- // <--
bool m_bUpdateType;
SwTextSectionProperties_Impl()
@@ -106,16 +99,13 @@ struct SwTextSectionProperties_Impl
, m_bHidden(false)
, m_bCondHidden(false)
, m_bProtect(false)
- // --> FME 2004-06-22 #114856# edit in readonly sections
, m_bEditInReadonly(false)
- // <--
, m_bUpdateType(true)
{
}
};
-
class SwXTextSection::Impl
: public SwClient
{
@@ -175,9 +165,6 @@ public:
};
-/*-- 10.12.98 14:42:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextSection::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -187,17 +174,11 @@ void SwXTextSection::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 20.12.2005 10:27:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwSectionFmt * SwXTextSection::GetFmt() const
{
return m_pImpl->GetSectionFmt();
}
-/*-- 20.12.2005 09:56:36---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextSection >
SwXTextSection::CreateXTextSection(
SwSectionFmt *const pFmt, const bool bIndexHeader)
@@ -221,33 +202,22 @@ SwXTextSection::CreateXTextSection(
return xSection;
}
-/*-- 10.12.98 14:47:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextSection::SwXTextSection(
SwSectionFmt *const pFmt, const bool bIndexHeader)
: m_pImpl( new SwXTextSection::Impl(*this, pFmt, bIndexHeader) )
{
}
-/*-- 10.12.98 14:47:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextSection::~SwXTextSection()
{
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXTextSection::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -255,13 +225,10 @@ throw (uno::RuntimeException)
return ::sw::UnoTunnelImpl<SwXTextSection>(rId, this);
}
-/*-- 10.12.98 14:47:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextSection > SAL_CALL
SwXTextSection::getParentSection() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt & rSectionFmt( m_pImpl->GetSectionFmtOrThrow() );
@@ -271,13 +238,10 @@ SwXTextSection::getParentSection() throw (uno::RuntimeException)
return xRet;
}
-/*-- 10.12.98 14:47:08---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Reference< text::XTextSection > > SAL_CALL
SwXTextSection::getChildSections() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt & rSectionFmt( m_pImpl->GetSectionFmtOrThrow() );
@@ -293,14 +257,11 @@ SwXTextSection::getChildSections() throw (uno::RuntimeException)
return aSeq;
}
-/* -----------------18.02.99 13:31-------------------
- *
- * --------------------------------------------------*/
void SAL_CALL
SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->m_bIsDescriptor)
{
@@ -382,15 +343,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
aSect.SetHidden(m_pImpl->m_pProps->m_bHidden);
aSect.SetProtectFlag(m_pImpl->m_pProps->m_bProtect);
- // --> FME 2004-06-22 #114856# edit in readonly sections
aSect.SetEditInReadonlyFlag(m_pImpl->m_pProps->m_bEditInReadonly);
- // <--
SfxItemSet aSet(pDoc->GetAttrPool(),
RES_COL, RES_COL,
RES_BACKGROUND, RES_BACKGROUND,
RES_FTN_AT_TXTEND, RES_FRAMEDIR,
- RES_LR_SPACE, RES_LR_SPACE, // #109700#
+ RES_LR_SPACE, RES_LR_SPACE,
RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER,
0);
if (m_pImpl->m_pProps->m_pBrushItem.get())
@@ -421,7 +380,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
{
aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem);
}
- /* #109700# */
if (m_pImpl->m_pProps->m_pLRSpaceItem.get())
{
aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem);
@@ -437,7 +395,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pRet->GetFmt()->Add(m_pImpl.get());
pRet->GetFmt()->SetXObject(static_cast< ::cppu::OWeakObject*>(this));
- // #97450# XML import must hide sections depending on their old
+ // XML import must hide sections depending on their old
// condition status
if (m_pImpl->m_pProps->m_sCondition.getLength() != 0)
{
@@ -462,21 +420,17 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->m_bIsDescriptor = false;
}
-/*-- 10.12.98 14:47:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXTextSection::getAnchor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextRange > xRet;
SwSectionFmt *const pSectFmt = m_pImpl->GetSectionFmt();
if(pSectFmt)
{
- const SwSection* pSect;
const SwNodeIndex* pIdx;
- if( 0 != ( pSect = pSectFmt->GetSection() ) &&
+ if( 0 != ( pSectFmt->GetSection() ) &&
0 != ( pIdx = pSectFmt->GetCntnt().GetCntntIdx() ) &&
pIdx->GetNode().GetNodes().IsDocNodes() )
{
@@ -492,12 +446,10 @@ SwXTextSection::getAnchor() throw (uno::RuntimeException)
}
return xRet;
}
-/*-- 10.12.98 14:47:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::dispose() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pSectFmt = m_pImpl->GetSectionFmt();
if (pSectFmt)
@@ -505,14 +457,12 @@ void SAL_CALL SwXTextSection::dispose() throw (uno::RuntimeException)
pSectFmt->GetDoc()->DelSectionFmt( pSectFmt );
}
}
-/*-- 10.12.98 14:47:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::addEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetSectionFmt())
{
@@ -520,14 +470,12 @@ throw (uno::RuntimeException)
}
m_pImpl->m_ListenerContainer.AddListener(xListener);
}
-/*-- 10.12.98 14:47:10---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::removeEventListener(
const uno::Reference< lang::XEventListener > & xListener)
throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_pImpl->GetSectionFmt() ||
!m_pImpl->m_ListenerContainer.RemoveListener(xListener))
@@ -535,22 +483,17 @@ throw (uno::RuntimeException)
throw uno::RuntimeException();
}
}
-/*-- 10.12.98 14:47:11---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXTextSection::getPropertySetInfo() throw (uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static const uno::Reference< beans::XPropertySetInfo > aRef =
m_pImpl->m_rPropSet.getPropertySetInfo();
return aRef;
}
-/* -----------------------------12.02.01 10:45--------------------------------
-
- ---------------------------------------------------------------------------*/
static void
lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways = true)
{
@@ -845,7 +788,6 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
}
break;
- // --> FME 2004-06-22 #114856# edit in readonly sections
case WID_SECT_EDIT_IN_READONLY:
{
sal_Bool bVal(sal_False);
@@ -862,7 +804,6 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
pSectionData->SetEditInReadonlyFlag(bVal);
}
}
- // <--
break;
case WID_SECT_PASSWORD:
{
@@ -956,7 +897,6 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
}
else if (RES_LR_SPACE == pEntry->nWID)
{
- // #109700#
if (!m_pProps->m_pLRSpaceItem.get())
{
m_pProps->m_pLRSpaceItem.reset(
@@ -985,7 +925,7 @@ SwXTextSection::setPropertyValues(
throw (beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// workaround for bad designed API
try
@@ -1001,16 +941,14 @@ throw (beans::PropertyVetoException, lang::IllegalArgumentException,
throw aWExc;
}
}
-/*-- 10.12.98 14:47:11---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSection::setPropertyValue(
const OUString& rPropertyName, const uno::Any& rValue)
throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< ::rtl::OUString > aPropertyNames(1);
aPropertyNames.getArray()[0] = rPropertyName;
@@ -1019,9 +957,6 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
m_pImpl->SetPropertyValues_Impl( aPropertyNames, aValues );
}
-/* -----------------------------12.02.01 10:43--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any >
SwXTextSection::Impl::GetPropertyValues_Impl(
const uno::Sequence< OUString > & rPropertyNames )
@@ -1086,7 +1021,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case WID_SECT_DDE_AUTOUPDATE:
{
// GetUpdateType() returns .._ALWAYS or .._ONCALL
- if (pSect && pSect->IsLinkType() && pSect->IsConnected()) // lijian i73247
+ if (pSect && pSect->IsLinkType() && pSect->IsConnected()) // #i73247#
{
const sal_Bool bTemp =
(pSect->GetUpdateType() == sfx2::LINKUPDATE_ALWAYS);
@@ -1153,7 +1088,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
pRet[nProperty] <<= bTemp;
}
break;
- // --> FME 2004-06-22 #114856# edit in readonly sections
case WID_SECT_EDIT_IN_READONLY:
{
const sal_Bool bTemp = (m_bIsDescriptor)
@@ -1161,7 +1095,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
pRet[nProperty] <<= bTemp;
}
break;
- // <--
case FN_PARAM_LINK_DISPLAY_NAME:
{
if (pFmt)
@@ -1210,7 +1143,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case FN_UNO_REDLINE_NODE_END:
{
if (!pFmt)
- break; // lijian i73247
+ break; // #i73247#
SwNode* pSectNode = pFmt->GetSectionNode();
if (FN_UNO_REDLINE_NODE_END == pEntry->nWID)
{
@@ -1316,7 +1249,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
pQueryItem = m_pProps->m_pFrameDirItem.get();
}
- /* -> #109700# */
else if (RES_LR_SPACE == pEntry->nWID)
{
if (!m_pProps->m_pLRSpaceItem.get())
@@ -1326,7 +1258,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
pQueryItem = m_pProps->m_pLRSpaceItem.get();
}
- /* <- #109700# */
if (pQueryItem)
{
pQueryItem->QueryValue(pRet[nProperty],
@@ -1339,15 +1270,12 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/* -----------------------------04.11.03 10:43--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SAL_CALL
SwXTextSection::getPropertyValues(
const uno::Sequence< ::rtl::OUString >& rPropertyNames)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -1370,23 +1298,19 @@ throw (uno::RuntimeException)
return aValues;
}
-/*-- 10.12.98 14:47:12---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXTextSection::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< ::rtl::OUString > aPropertyNames(1);
aPropertyNames.getArray()[0] = rPropertyName;
return m_pImpl->GetPropertyValues_Impl(aPropertyNames).getConstArray()[0];
}
-/* -----------------------------12.02.01 10:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::addPropertiesChangeListener(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -1396,9 +1320,6 @@ throw (uno::RuntimeException)
"SwXTextSection::addPropertiesChangeListener(): not implemented");
}
-/* -----------------------------12.02.01 10:30--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw (uno::RuntimeException)
@@ -1407,9 +1328,6 @@ throw (uno::RuntimeException)
"SwXTextSection::removePropertiesChangeListener(): not implemented");
}
-/* -----------------------------12.02.01 10:30--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::firePropertiesChangeEvent(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -1419,9 +1337,6 @@ void SAL_CALL SwXTextSection::firePropertiesChangeEvent(
"SwXTextSection::firePropertiesChangeEvent(): not implemented");
}
-/*-- 10.12.98 14:47:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextSection::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1466,28 +1381,23 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXTextSection::removeVetoableChangeListener(): not implemented");
}
-/*-- 08.11.00 10:47:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
beans::PropertyState SAL_CALL
SwXTextSection::getPropertyState(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aNames(1);
aNames.getArray()[0] = rPropertyName;
return getPropertyStates(aNames).getConstArray()[0];
}
-/*-- 08.11.00 10:47:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SAL_CALL
SwXTextSection::getPropertyStates(
const uno::Sequence< OUString >& rPropertyNames)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
if (!pFmt && !m_pImpl->m_bIsDescriptor)
@@ -1520,9 +1430,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
case WID_SECT_REGION :
case WID_SECT_VISIBLE:
case WID_SECT_PROTECTED:
- // --> FME 2004-06-22 #114856# edit in readonly sections
case WID_SECT_EDIT_IN_READONLY:
- // <--
case FN_PARAM_LINK_DISPLAY_NAME:
case FN_UNO_ANCHOR_TYPES:
case FN_UNO_TEXT_WRAP:
@@ -1567,14 +1475,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
return aStates;
}
-/*-- 08.11.00 10:47:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXTextSection::setPropertyToDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
if (!pFmt && !m_pImpl->m_bIsDescriptor)
@@ -1669,7 +1574,6 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
}
break;
- // --> FME 2004-06-22 #114856# edit in readonly sections
case WID_SECT_EDIT_IN_READONLY:
{
if (m_pImpl->m_bIsDescriptor)
@@ -1717,15 +1621,12 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
lcl_UpdateSection(pFmt, pSectionData, pNewAttrSet, bLinkModeChanged);
}
-/*-- 08.11.00 10:47:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXTextSection::getPropertyDefault(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
@@ -1760,9 +1661,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
}
break;
case WID_SECT_PROTECTED:
- // --> FME 2004-06-22 #114856# edit in readonly sections
case WID_SECT_EDIT_IN_READONLY:
- // <--
{
sal_Bool bTemp = sal_False;
aRet.setValue( &bTemp, ::getCppuBooleanType());
@@ -1785,12 +1684,9 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 10.12.98 14:47:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXTextSection::getName() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
::rtl::OUString sRet;
SwSectionFmt const*const pFmt = m_pImpl->GetSectionFmt();
@@ -1808,13 +1704,11 @@ OUString SAL_CALL SwXTextSection::getName() throw (uno::RuntimeException)
}
return sRet;
}
-/*-- 10.12.98 14:47:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextSection::setName(const OUString& rName)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt();
if(pFmt)
@@ -1858,26 +1752,21 @@ throw (uno::RuntimeException)
throw uno::RuntimeException();
}
}
-/* -----------------02.11.99 11:30-------------------
- --------------------------------------------------*/
OUString SAL_CALL
SwXTextSection::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXTextSection");
}
-/* -----------------02.11.99 11:30-------------------
-
- --------------------------------------------------*/
static char const*const g_ServicesTextSection[] =
{
"com.sun.star.text.TextContent",
"com.sun.star.text.TextSection",
"com.sun.star.document.LinkTarget",
};
-static const size_t g_nServicesTextSection(
- sizeof(g_ServicesTextSection)/sizeof(g_ServicesTextSection[0]));
+
+static const size_t g_nServicesTextSection(SAL_N_ELEMENTS(g_ServicesTextSection));
sal_Bool SAL_CALL SwXTextSection::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -1886,9 +1775,6 @@ throw (uno::RuntimeException)
g_nServicesTextSection, g_ServicesTextSection, rServiceName);
}
-/* -----------------02.11.99 11:30-------------------
-
- --------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXTextSection::getSupportedServiceNames() throw (uno::RuntimeException)
{
@@ -1896,7 +1782,6 @@ SwXTextSection::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextSection, g_ServicesTextSection);
}
-
// MetadatableMixin
::sfx2::Metadatable* SwXTextSection::GetCoreObject()
{
@@ -1915,3 +1800,4 @@ uno::Reference<frame::XModel> SwXTextSection::GetModel()
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index b175cbc709d4..dc407cbed2bb 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,16 +66,14 @@
#include <editeng/flstitem.hxx>
#include <vcl/metric.hxx>
#include <svtools/ctrltool.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <editeng/unofdesc.hxx>
#include <fmtornt.hxx>
#include <SwStyleNameMapper.hxx>
-// --> OD 2008-01-15 #newlistlevelattrs#
#include <com/sun/star/text/PositionAndSpaceMode.hpp>
#include <com/sun/star/text/LabelFollow.hpp>
-// <--
#include <numrule.hxx>
using ::rtl::OUString;
@@ -85,6 +84,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::style;
+using rtl::OUString;
+
struct PropValData
{
uno::Any aVal;
@@ -138,6 +139,7 @@ const SfxItemPropertySet* GetFootnoteSet()
static SfxItemPropertySet aFootnoteSet_Impl(aFootnoteMap_Impl);
return &aFootnoteSet_Impl;
}
+
const SfxItemPropertySet* GetEndnoteSet()
{
static SfxItemPropertyMapEntry aEndnoteMap_Impl[] =
@@ -155,6 +157,7 @@ const SfxItemPropertySet* GetEndnoteSet()
static SfxItemPropertySet aEndnoteSet_Impl(aEndnoteMap_Impl);
return &aEndnoteSet_Impl;
}
+
const SfxItemPropertySet* GetNumberingRulesSet()
{
static SfxItemPropertyMapEntry aNumberingRulesMap_Impl[] =
@@ -170,6 +173,7 @@ const SfxItemPropertySet* GetNumberingRulesSet()
static SfxItemPropertySet aNumberingRulesSet_Impl( aNumberingRulesMap_Impl );
return &aNumberingRulesSet_Impl;
}
+
#define WID_NUM_ON 0
#define WID_SEPARATOR_INTERVAL 1
#define WID_NUMBERING_TYPE 2
@@ -177,7 +181,6 @@ const SfxItemPropertySet* GetNumberingRulesSet()
#define WID_DISTANCE 4
#define WID_INTERVAL 5
#define WID_SEPARATOR_TEXT 6
-//#define WID_CHARACTER_STYLE 7
#define WID_COUNT_EMPTY_LINES 8
#define WID_COUNT_LINES_IN_FRAMES 9
#define WID_RESTART_AT_EACH_PAGE 10
@@ -203,9 +206,6 @@ const SfxItemPropertySet* GetLineNumberingSet()
return &aLineNumberingSet_Impl;
}
-/* -----------------05.05.98 08:30-------------------
- *
- * --------------------------------------------------*/
SwCharFmt* lcl_getCharFmt(SwDoc* pDoc, const uno::Any& aValue)
{
SwCharFmt* pRet = 0;
@@ -226,9 +226,7 @@ SwCharFmt* lcl_getCharFmt(SwDoc* pDoc, const uno::Any& aValue)
}
return pRet;
}
-/* -----------------05.05.98 08:30-------------------
- *
- * --------------------------------------------------*/
+
SwTxtFmtColl* lcl_GetParaStyle(SwDoc* pDoc, const uno::Any& aValue)
{
OUString uTmp;
@@ -244,9 +242,7 @@ SwTxtFmtColl* lcl_GetParaStyle(SwDoc* pDoc, const uno::Any& aValue)
}
return pRet;
}
-/* -----------------05.05.98 08:30-------------------
- *
- * --------------------------------------------------*/
+
SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const uno::Any& aValue)
{
SwPageDesc* pRet = 0;
@@ -273,9 +269,7 @@ SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const uno::Any& aValue)
}
return pRet;
}
-/******************************************************************************
- *
- ******************************************************************************/
+
// Numerierung
const unsigned short aSvxToUnoAdjust[] =
{
@@ -300,23 +294,16 @@ const unsigned short aUnoToSvxAdjust[] =
/******************************************************************
* SwXFootnoteProperties
******************************************************************/
-/* -----------------------------06.04.00 11:43--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXFootnoteProperties::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXFootnoteProperties");
}
-/* -----------------------------06.04.00 11:43--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXFootnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.FootnoteSettings") == rServiceName;
}
-/* -----------------------------06.04.00 11:43--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXFootnoteProperties::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -324,37 +311,29 @@ Sequence< OUString > SwXFootnoteProperties::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.FootnoteSettings");
return aRet;
}
-/*-- 14.12.98 14:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnoteProperties::SwXFootnoteProperties(SwDoc* pDc) :
pDoc(pDc),
m_pPropertySet(GetFootnoteSet())
{
}
-/*-- 14.12.98 14:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnoteProperties::~SwXFootnoteProperties()
{
}
-/*-- 14.12.98 14:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFootnoteProperties::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 14:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pDoc)
{
const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName );
@@ -472,13 +451,11 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons
else
throw uno::RuntimeException();
}
-/*-- 14.12.98 14:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(pDoc)
{
@@ -595,36 +572,28 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.12.98 14:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFootnoteProperties::addPropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFootnoteProperties::removePropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFootnoteProperties::addVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:03:22---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFootnoteProperties::removeVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -635,23 +604,16 @@ void SwXFootnoteProperties::removeVetoableChangeListener(
/******************************************************************
* SwXEndnoteProperties
******************************************************************/
-/* -----------------------------06.04.00 11:45--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXEndnoteProperties::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXEndnoteProperties");
}
-/* -----------------------------06.04.00 11:45--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXEndnoteProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.FootnoteSettings") == rServiceName;
}
-/* -----------------------------06.04.00 11:45--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXEndnoteProperties::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -659,38 +621,30 @@ Sequence< OUString > SwXEndnoteProperties::getSupportedServiceNames(void) throw(
pArray[0] = C2U("com.sun.star.text.FootnoteSettings");
return aRet;
}
-/*-- 14.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXEndnoteProperties::SwXEndnoteProperties(SwDoc* pDc) :
pDoc(pDc),
m_pPropertySet(GetEndnoteSet())
{
}
-/*-- 14.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXEndnoteProperties::~SwXEndnoteProperties()
{
}
-/*-- 14.12.98 14:27:40---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXEndnoteProperties::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 14:27:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pDoc)
{
const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName );
@@ -763,13 +717,11 @@ void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 14.12.98 14:27:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(pDoc)
{
@@ -853,60 +805,46 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 14:27:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXEndnoteProperties::addPropertyChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:27:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXEndnoteProperties::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:27:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXEndnoteProperties::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:27:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXEndnoteProperties::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
+
/******************************************************************
* SwXLineNumberingProperties
******************************************************************/
-/* -----------------------------06.04.00 11:47--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXLineNumberingProperties::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXLineNumberingProperties");
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXLineNumberingProperties::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.LineNumberingProperties") == rServiceName;
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXLineNumberingProperties::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -914,39 +852,31 @@ Sequence< OUString > SwXLineNumberingProperties::getSupportedServiceNames(void)
pArray[0] = C2U("com.sun.star.text.LineNumberingProperties");
return aRet;
}
-/*-- 14.12.98 14:33:36---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXLineNumberingProperties::SwXLineNumberingProperties(SwDoc* pDc) :
pDoc(pDc),
m_pPropertySet(GetLineNumberingSet())
{
}
-/*-- 14.12.98 14:33:37---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXLineNumberingProperties::~SwXLineNumberingProperties()
{
}
-/*-- 14.12.98 14:33:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXLineNumberingProperties::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 14:33:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLineNumberingProperties::setPropertyValue(
const OUString& rPropertyName, const Any& aValue)
throw( UnknownPropertyException, PropertyVetoException,
IllegalArgumentException, WrappedTargetException, RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pDoc)
{
const SfxItemPropertySimpleEntry* pEntry = m_pPropertySet->getPropertyMap()->getByName( rPropertyName );
@@ -1060,13 +990,11 @@ void SwXLineNumberingProperties::setPropertyValue(
else
throw uno::RuntimeException();
}
-/*-- 14.12.98 14:33:38---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
throw( UnknownPropertyException, WrappedTargetException, RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
Any aRet;
if(pDoc)
{
@@ -1166,35 +1094,28 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.12.98 14:33:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLineNumberingProperties::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:33:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLineNumberingProperties::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:33:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLineNumberingProperties::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 14:33:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
+
/******************************************************************
* SwXNumberingRules
******************************************************************/
@@ -1204,17 +1125,13 @@ const String& SwXNumberingRules::GetInvalidStyle()
{
return sInvalidStyle;
}
-/* -----------------------------10.03.00 17:05--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 17:05--------------------------------
- ---------------------------------------------------------------------------*/
// return implementation specific data
sal_Int64 SwXNumberingRules::getSomething( const uno::Sequence< sal_Int8 > & rId ) throw(uno::RuntimeException)
{
@@ -1227,23 +1144,16 @@ sal_Int64 SwXNumberingRules::getSomething( const uno::Sequence< sal_Int8 > & rId
return 0;
}
-/* -----------------------------06.04.00 11:47--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXNumberingRules::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXNumberingRules");
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXNumberingRules::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.NumberingRules") == rServiceName;
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXNumberingRules::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1252,9 +1162,6 @@ Sequence< OUString > SwXNumberingRules::getSupportedServiceNames(void) throw( Ru
return aRet;
}
-/*-- 14.12.98 14:57:57---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) :
pDoc(0),
pDocShell(0),
@@ -1284,9 +1191,7 @@ SwXNumberingRules::SwXNumberingRules(const SwNumRule& rRule) :
sNewBulletFontNames[i] = SwXNumberingRules::GetInvalidStyle();
}
}
-/* -----------------22.02.99 16:35-------------------
- *
- * --------------------------------------------------*/
+
SwXNumberingRules::SwXNumberingRules(SwDocShell& rDocSh) :
pDoc(0),
pDocShell(&rDocSh),
@@ -1296,9 +1201,7 @@ SwXNumberingRules::SwXNumberingRules(SwDocShell& rDocSh) :
{
pDocShell->GetDoc()->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/* -----------------------------24.08.00 11:36--------------------------------
- ---------------------------------------------------------------------------*/
SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
pDoc(&rDoc),
pDocShell(0),
@@ -1311,35 +1214,29 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nIndex =
#endif
- // --> OD 2008-02-11 #newlistlevelattrs#
rDoc.MakeNumRule( sCreatedNumRuleName, 0, sal_False,
// --> OD 2008-06-06 #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
// <--
- // <--
#if OSL_DEBUG_LEVEL > 1
(void)nIndex;
#endif
}
-/*-- 14.12.98 14:57:57---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXNumberingRules::~SwXNumberingRules()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pDoc && sCreatedNumRuleName.Len())
pDoc->DelNumRule( sCreatedNumRuleName );
if( pNumRule && bOwnNumRuleCreated )
delete pNumRule;
}
-/*-- 14.12.98 14:57:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElement)
throw( lang::IllegalArgumentException, lang::IndexOutOfBoundsException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(nIndex < 0 || MAXLEVEL <= nIndex)
throw lang::IndexOutOfBoundsException();
@@ -1353,12 +1250,8 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen
rProperties, nIndex);
else if(pDocShell)
{
- // --> OD 2008-04-21 #i87650# - correction of cws swwarnings:
- // Do not set member <pNumRule>
-// pNumRule = pDocShell->GetDoc()->GetOutlineNumRule();
-// SwNumRule aNumRule(*pNumRule);
+ // #i87650# - correction of cws swwarnings:
SwNumRule aNumRule( *(pDocShell->GetDoc()->GetOutlineNumRule()) );
- // <--
SwXNumberingRules::SetNumberingRuleByIndex( aNumRule,
rProperties, nIndex);
//hier noch die Zeichenformate bei Bedarf setzen
@@ -1410,21 +1303,17 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen
throw uno::RuntimeException();
}
-/*-- 14.12.98 14:57:58---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXNumberingRules::getCount(void) throw( uno::RuntimeException )
{
return MAXLEVEL;
}
-/*-- 14.12.98 14:57:58---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXNumberingRules::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(nIndex < 0 || MAXLEVEL <= nIndex)
throw lang::IndexOutOfBoundsException();
@@ -1449,28 +1338,22 @@ uno::Any SwXNumberingRules::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aVal;
}
-/*-- 14.12.98 14:57:59---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXNumberingRules::getElementType(void)
throw( uno::RuntimeException )
{
return ::getCppuType((uno::Sequence<beans::PropertyValue>*)0);
}
-/*-- 14.12.98 14:57:59---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXNumberingRules::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 14.12.98 14:57:59---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
const SwNumRule& rNumRule, sal_Int32 nIndex) const
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
const SwNumFmt& rFmt = rNumRule.Get( (sal_uInt16)nIndex );
@@ -1522,7 +1405,6 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
pData = new PropValData((void*)&nINT16, "StartWith", ::getCppuType((const sal_Int16*)0));
aPropertyValues.Insert(pData, aPropertyValues.Count());
- // --> OD 2008-01-23 #newlistlevelattrs#
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
//leftmargin
@@ -1540,9 +1422,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
pData = new PropValData((void*)&nINT32, SW_PROP_NAME_STR(UNO_NAME_FIRST_LINE_OFFSET), ::getCppuType((const sal_Int32*)0));
aPropertyValues.Insert(pData, aPropertyValues.Count());
}
- // <--
- // --> OD 2008-01-15 #newlistlevelattrs#
// PositionAndSpaceMode
nINT16 = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION;
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
@@ -1592,7 +1472,6 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
::getCppuType((const sal_Int32*)0));
aPropertyValues.Insert(pData, aPropertyValues.Count());
}
- // <--
//numberingtype
nINT16 = rFmt.GetNumberingType();
@@ -1659,11 +1538,8 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
aPropertyValues.Insert(pData, aPropertyValues.Count());
}
Size aSize = rFmt.GetGraphicSize();
- // --> OD 2010-05-04 #i101131# - applying patch from CMC
+ // #i101131#
// adjust conversion due to type mismatch between <Size> and <awt::Size>
-// aSize.Width() = TWIP_TO_MM100( aSize.Width() );
-// aSize.Height() = TWIP_TO_MM100( aSize.Height() );
-// pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height()));
pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
// <--
@@ -1728,12 +1604,10 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
aPropertyValues.DeleteAndDestroy(0, aPropertyValues.Count());
return aSeq;
}
-/*-- 14.12.98 14:57:59---------------------------------------------------
- -----------------------------------------------------------------------*/
PropValData* lcl_FindProperty(const char* cName, PropValDataArr& rPropertyValues)
{
- OUString sCmp = C2U(cName);
+ OUString sCmp = rtl::OUString::createFromAscii(cName);
for(sal_uInt16 i = 0; i < rPropertyValues.Count(); i++)
{
PropValData* pTemp = rPropertyValues.GetObject(i);
@@ -1742,14 +1616,13 @@ PropValData* lcl_FindProperty(const char* cName, PropValDataArr& rPropertyVal
}
return 0;
}
-//-----------------------------------------------------------------------
void SwXNumberingRules::SetNumberingRuleByIndex(
SwNumRule& rNumRule,
const uno::Sequence<beans::PropertyValue>& rProperties, sal_Int32 nIndex)
throw( uno::RuntimeException, lang::IllegalArgumentException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
// the order of the names is important!
@@ -1764,13 +1637,11 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN), //6
SW_PROP_NAME_STR(UNO_NAME_SYMBOL_TEXT_DISTANCE), //7
SW_PROP_NAME_STR(UNO_NAME_FIRST_LINE_OFFSET), //8
- // --> OD 2008-01-15 #newlistlevelattrs#
SW_PROP_NAME_STR(UNO_NAME_POSITION_AND_SPACE_MODE), //9
SW_PROP_NAME_STR(UNO_NAME_LABEL_FOLLOWED_BY), //10
SW_PROP_NAME_STR(UNO_NAME_LISTTAB_STOP_POSITION), //11
SW_PROP_NAME_STR(UNO_NAME_FIRST_LINE_INDENT), //12
SW_PROP_NAME_STR(UNO_NAME_INDENT_AT), //13
- // <--
"NumberingType", //14
"BulletId", //15
SW_PROP_NAME_STR(UNO_NAME_BULLET_FONT), //16
@@ -1782,10 +1653,8 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SW_PROP_NAME_STR(UNO_NAME_VERT_ORIENT), //22
SW_PROP_NAME_STR(UNO_NAME_HEADING_STYLE_NAME) //23
};
- // --> OD 2008-01-15 #newlistlevelattrs#
const sal_uInt16 nPropNameCount = 24;
const sal_uInt16 nNotInChapter = 15;
- // <--
const beans::PropertyValue* pPropArray = rProperties.getConstArray();
PropValDataArr aPropertyValues;
@@ -1909,10 +1778,9 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
}
}
aFmt.SetCharFmt( pCharFmt );
- // os 2005-08-22 #i51842#
+ // #i51842#
// If the character format has been found it's name should not be in the
// char style names array
- //sNewCharStyleNames[(sal_uInt16)nIndex] = sCharFmtName;
sNewCharStyleNames[(sal_uInt16)nIndex].Erase();
}
else
@@ -1953,7 +1821,6 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
aFmt.SetFirstLineOffset((short)nValue);
}
break;
- // --> OD 2008-01-15 #newlistlevelattrs#
case 9: // UNO_NAME_POSITION_AND_SPACE_MODE
{
sal_Int16 nValue = 0;
@@ -2025,7 +1892,6 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
aFmt.SetIndentAt( nValue );
}
break;
- // <--
case 14: //"NumberingType"
{
sal_Int16 nSet = 0;
@@ -2050,7 +1916,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
awt::FontDescriptor* pDesc = (awt::FontDescriptor*)pData->aVal.getValue();
if(pDesc)
{
- // --> OD 2008-09-11 #i93725#
+ // #i93725#
// do not accept "empty" font
if ( pDesc->Name.getLength() > 0 )
{
@@ -2179,12 +2045,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SwTxtFmtColl &rTxtColl = *((*pColls)[k]);
if(rTxtColl.IsDefault())
continue;
- //if(rTxtColl.GetOutlineLevel() == nIndex && //#outline level,removed by zhaojianwei
- // rTxtColl.GetName() != sStyleName)
- // rTxtColl..SetOutlineLevel(NO_NUMBERING);
- //else if(rTxtColl.GetName() == sStyleName)
- // rTxtColl.SetOutlineLevel(sal_Int8(nIndex));
- if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && //add by zhaojianwei
+ if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() &&
rTxtColl.GetAssignedOutlineStyleLevel() == nIndex &&
rTxtColl.GetName() != sStyleName )
{
@@ -2193,7 +2054,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
else if ( rTxtColl.GetName() == sStyleName )
{
rTxtColl.AssignToListLevelOfOutlineStyle( nIndex );
- } //<-end,,zhaojianwei,
+ }
}
}
break;
@@ -2245,18 +2106,14 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
rNumRule.Set( (sal_uInt16)nIndex, aFmt );
}
-/*-- 19.07.00 07:49:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XPropertySetInfo > SwXNumberingRules::getPropertySetInfo()
throw(RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
return aRef;
}
-/*-- 19.07.00 07:49:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
throw(UnknownPropertyException, PropertyVetoException,
IllegalArgumentException, WrappedTargetException, RuntimeException)
@@ -2310,13 +2167,11 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
pDocRule ? pDocRule->SetRuleType(eNumRuleType) :
pCreatedRule ? pCreatedRule->SetRuleType(eNumRuleType) : pNumRule->SetRuleType(eNumRuleType);
}
- // --> OD 2008-04-23 #refactorlists#
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DEFAULT_LIST_ID)))
{
delete pDocRule;
throw IllegalArgumentException();
}
- // <--
else
throw UnknownPropertyException();
@@ -2330,9 +2185,7 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
pCreatedRule->Validate();
}
}
-/*-- 19.07.00 07:49:18---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
@@ -2367,53 +2220,41 @@ Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
sal_Bool bVal = pRule->IsOutlineRule();
aRet.setValue(&bVal, ::getBooleanCppuType());
}
- // --> OD 2008-04-23 #refactorlists#
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DEFAULT_LIST_ID)))
{
- ASSERT( pRule->GetDefaultListId().Len() != 0,
+ OSL_ENSURE( pRule->GetDefaultListId().Len() != 0,
"<SwXNumberingRules::getPropertyValue(..)> - no default list id found. Serious defect -> please inform OD." );
aRet <<= OUString(pRule->GetDefaultListId());
}
- // <--
else
throw UnknownPropertyException();
return aRet;
}
-/*-- 19.07.00 07:49:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::addPropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 19.07.00 07:49:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::removePropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 19.07.00 07:49:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::addVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 19.07.00 07:49:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::removeVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/* -----------------------------17.10.00 14:23--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXNumberingRules::getName() throw( RuntimeException )
{
String aString;
@@ -2422,7 +2263,7 @@ OUString SwXNumberingRules::getName() throw( RuntimeException )
SwStyleNameMapper::FillProgName(pNumRule->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, sal_True );
return OUString ( aString );
}
- // --> OD 2005-10-25 #126347# - consider chapter numbering <SwXNumberingRules>
+ // consider chapter numbering <SwXNumberingRules>
else if ( pDocShell )
{
SwStyleNameMapper::FillProgName( pDocShell->GetDoc()->GetOutlineNumRule()->GetName(),
@@ -2433,18 +2274,14 @@ OUString SwXNumberingRules::getName() throw( RuntimeException )
else
return sCreatedNumRuleName;
}
-/* -----------------------------17.10.00 14:23--------------------------------
- ---------------------------------------------------------------------------*/
void SwXNumberingRules::setName(const OUString& /*rName*/) throw( RuntimeException )
{
RuntimeException aExcept;
aExcept.Message = C2U("readonly");
throw aExcept;
}
-/*-- 14.12.98 14:58:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXNumberingRules::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -2456,25 +2293,19 @@ void SwXNumberingRules::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pDoc = 0;
}
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXChapterNumbering::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXChapterNumbering");
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXChapterNumbering::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.ChapterNumbering") ||
sServiceName.EqualsAscii("com.sun.star.text.NumberingRules");
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXChapterNumbering::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(2);
@@ -2483,16 +2314,12 @@ Sequence< OUString > SwXChapterNumbering::getSupportedServiceNames(void) throw(
pArray[1] = C2U("com.sun.star.text.NumberingRules");
return aRet;
}
-/* -----------------22.02.99 16:33-------------------
- *
- * --------------------------------------------------*/
+
SwXChapterNumbering::SwXChapterNumbering(SwDocShell& rDocSh) :
SwXNumberingRules(rDocSh)
{
}
-/* -----------------22.02.99 16:33-------------------
- *
- * --------------------------------------------------*/
+
SwXChapterNumbering::~SwXChapterNumbering()
{
}
@@ -2500,23 +2327,16 @@ SwXChapterNumbering::~SwXChapterNumbering()
/******************************************************************
* SwXTextColumns
******************************************************************/
-/* -----------------------------06.04.00 11:47--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextColumns::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextColumns");
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextColumns::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextColumns") == rServiceName;
}
-/* -----------------------------06.04.00 11:47--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextColumns::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -2524,9 +2344,7 @@ Sequence< OUString > SwXTextColumns::getSupportedServiceNames(void) throw( Runti
pArray[0] = C2U("com.sun.star.text.TextColumns");
return aRet;
}
-/* -----------------------------24.10.00 16:45--------------------------------
- ---------------------------------------------------------------------------*/
SwXTextColumns::SwXTextColumns(sal_uInt16 nColCount) :
nReference(0),
bIsAutomaticWidth(sal_True),
@@ -2541,9 +2359,7 @@ SwXTextColumns::SwXTextColumns(sal_uInt16 nColCount) :
if(nColCount)
setColumnCount(nColCount);
}
-/*-- 16.12.98 14:06:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) :
nReference(0),
aTextColumns(rFmtCol.GetNumCols()),
@@ -2582,35 +2398,27 @@ SwXTextColumns::SwXTextColumns(const SwFmtCol& rFmtCol) :
case COLADJ_NONE: nSepLineVertAlign = style::VerticalAlignment_MIDDLE;
}
}
-/*-- 16.12.98 14:06:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextColumns::~SwXTextColumns()
{
}
-/*-- 16.12.98 14:06:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextColumns::getReferenceValue(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return nReference;
}
-/*-- 16.12.98 14:06:55---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SwXTextColumns::getColumnCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return static_cast< sal_Int16>( aTextColumns.getLength() );
}
-/*-- 16.12.98 14:06:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::setColumnCount(sal_Int16 nColumns) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(nColumns <= 0)
throw uno::RuntimeException();
bIsAutomaticWidth = sal_True;
@@ -2628,21 +2436,17 @@ void SwXTextColumns::setColumnCount(sal_Int16 nColumns) throw( uno::RuntimeExcep
}
pCols[nColumns - 1].Width += nDiff;
}
-/*-- 16.12.98 14:06:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< TextColumn > SwXTextColumns::getColumns(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return aTextColumns;
}
-/*-- 16.12.98 14:06:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::setColumns(const uno::Sequence< TextColumn >& rColumns)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nReferenceTemp = 0;
const TextColumn* prCols = rColumns.getConstArray();
for(long i = 0; i < rColumns.getLength(); i++)
@@ -2653,17 +2457,13 @@ void SwXTextColumns::setColumns(const uno::Sequence< TextColumn >& rColumns)
nReference = !nReferenceTemp ? USHRT_MAX : nReferenceTemp;
aTextColumns = rColumns;
}
-/*-- 25.10.00 10:15:39---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XPropertySetInfo > SwXTextColumns::getPropertySetInfo( ) throw(RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo();
return aRef;
}
-/*-- 25.10.00 10:15:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any& aValue )
throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException,
WrappedTargetException, RuntimeException)
@@ -2734,9 +2534,7 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any&
break;
}
}
-/*-- 25.10.00 10:15:40---------------------------------------------------
- -----------------------------------------------------------------------*/
Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
@@ -2771,49 +2569,37 @@ Any SwXTextColumns::getPropertyValue( const OUString& rPropertyName )
}
return aRet;
}
-/*-- 25.10.00 10:15:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::addPropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 25.10.00 10:15:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::removePropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 25.10.00 10:15:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::addVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/*-- 25.10.00 10:15:40---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextColumns::removeVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}
-/* -----------------------------25.10.00 11:04--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextColumns::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextColumns::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2826,3 +2612,4 @@ sal_Int64 SAL_CALL SwXTextColumns::getSomething( const uno::Sequence< sal_Int8 >
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 0283773062ec..5d531b17d899 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include <unobaseclass.hxx>
#include <unomid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "editeng/unolingu.hxx"
#include <com/sun/star/util/SearchOptions.hpp>
@@ -46,13 +47,6 @@
using namespace ::com::sun::star;
using ::rtl::OUString;
-/******************************************************************************
- *
- ******************************************************************************/
-
-/* -----------------23.06.99 12:19-------------------
-
- --------------------------------------------------*/
class SwSearchProperties_Impl
{
beans::PropertyValue** pValueArr; //
@@ -69,9 +63,7 @@ public:
void FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSearch) const;
sal_Bool HasAttributes() const;
};
-/* -----------------23.06.99 13:08-------------------
- --------------------------------------------------*/
SwSearchProperties_Impl::SwSearchProperties_Impl() :
nArrLen(0),
aPropertyEntries( aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap()->getPropertyEntries())
@@ -81,18 +73,14 @@ SwSearchProperties_Impl::SwSearchProperties_Impl() :
for(sal_uInt32 i = 0; i < nArrLen; i++)
pValueArr[i] = 0;
}
-/* -----------------23.06.99 13:08-------------------
- --------------------------------------------------*/
SwSearchProperties_Impl::~SwSearchProperties_Impl()
{
for(sal_uInt32 i = 0; i < nArrLen; i++)
delete pValueArr[i];
delete[] pValueArr;
}
-/* -----------------23.06.99 13:09-------------------
- --------------------------------------------------*/
void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs)
throw( beans::UnknownPropertyException, lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -121,9 +109,7 @@ void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::Prope
pValueArr[nIndex] = new beans::PropertyValue(pProps[i]);
}
}
-/* -----------------23.06.99 13:08-------------------
- --------------------------------------------------*/
const uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const
{
sal_uInt32 nPropCount = 0;
@@ -144,9 +130,7 @@ const uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperti
}
return aRet;
}
-/* -----------------23.06.99 13:06-------------------
- --------------------------------------------------*/
void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSearch) const
{
//
@@ -480,9 +464,7 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea
delete pCasemapItem ;
delete pBrushItem ;
}
-/* -----------------23.06.99 14:18-------------------
- --------------------------------------------------*/
sal_Bool SwSearchProperties_Impl::HasAttributes() const
{
for(sal_uInt32 i = 0; i < nArrLen; i++)
@@ -491,9 +473,6 @@ sal_Bool SwSearchProperties_Impl::HasAttributes() const
return sal_False;
}
-/*-- 14.12.98 13:07:10 ---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextSearch::SwXTextSearch() :
pSearchProperties( new SwSearchProperties_Impl),
pReplaceProperties( new SwSearchProperties_Impl),
@@ -512,25 +491,19 @@ SwXTextSearch::SwXTextSearch() :
bIsValueSearch(sal_True)
{
}
-/*-- 14.12.98 13:07:12 ---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSearch::~SwXTextSearch()
{
delete pSearchProperties;
delete pReplaceProperties;
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -542,55 +515,43 @@ sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 14.12.98 13:07:12---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextSearch::getSearchString(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return sSearchText;
}
-/*-- 14.12.98 13:07:12---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setSearchString(const OUString& rString)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sSearchText = String(rString);
}
-/*-- 14.12.98 13:07:12---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextSearch::getReplaceString(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return sReplaceText;
}
-/*-- 14.12.98 13:07:12---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setReplaceString(const OUString& rReplaceString) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sReplaceText = String(rReplaceString);
}
-/*-- 14.12.98 13:07:13---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextSearch::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 13:07:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName);
if(pEntry)
{
@@ -618,19 +579,17 @@ void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::A
else
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
-/*-- 14.12.98 13:07:13---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSearch::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName);
sal_Bool bSet = sal_False;
- sal_Int16 nSet = 0;
if(pEntry)
{
+ sal_Int16 nSet = 0;
switch(pEntry->nWID)
{
case WID_SEARCH_ALL : bSet = bAll; goto SET_BOOL;
@@ -657,127 +616,93 @@ SET_UINT16:
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
return aRet;
}
-/*-- 14.12.98 13:07:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 13:07:13---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 13:07:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 13:07:14---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 13:07:14---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSearch::getValueSearch(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return bIsValueSearch;
}
-/*-- 14.12.98 13:07:15---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setValueSearch(sal_Bool ValueSearch_) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
bIsValueSearch = ValueSearch_;
}
-/*-- 14.12.98 13:07:15---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXTextSearch::getSearchAttributes(void) throw( uno::RuntimeException )
{
return pSearchProperties->GetProperties();
}
-/*-- 14.12.98 13:07:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setSearchAttributes(const uno::Sequence< beans::PropertyValue >& rSearchAttribs)
throw( beans::UnknownPropertyException, lang::IllegalArgumentException, uno::RuntimeException )
{
pSearchProperties->SetProperties(rSearchAttribs);
}
-/*-- 14.12.98 13:07:16---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXTextSearch::getReplaceAttributes(void)
throw( uno::RuntimeException )
{
return pReplaceProperties->GetProperties();
}
-/*-- 14.12.98 13:07:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextSearch::setReplaceAttributes(const uno::Sequence< beans::PropertyValue >& rReplaceAttribs)
throw( beans::UnknownPropertyException, lang::IllegalArgumentException, uno::RuntimeException )
{
pReplaceProperties->SetProperties(rReplaceAttribs);
}
-/* -----------------23.06.99 14:13-------------------
- --------------------------------------------------*/
void SwXTextSearch::FillSearchItemSet(SfxItemSet& rSet) const
{
pSearchProperties->FillItemSet(rSet, bIsValueSearch);
}
-/* -----------------23.06.99 14:14-------------------
- --------------------------------------------------*/
void SwXTextSearch::FillReplaceItemSet(SfxItemSet& rSet) const
{
pReplaceProperties->FillItemSet(rSet, bIsValueSearch);
}
-/* -----------------23.06.99 14:17-------------------
- --------------------------------------------------*/
sal_Bool SwXTextSearch::HasSearchAttributes() const
{
return pSearchProperties->HasAttributes();
}
-/* -----------------23.06.99 14:17-------------------
- --------------------------------------------------*/
sal_Bool SwXTextSearch::HasReplaceAttributes() const
{
return pReplaceProperties->HasAttributes();
}
-/* -----------------------------19.04.00 14:43--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextSearch::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextSearch");
}
-/* -----------------------------19.04.00 14:43--------------------------------
- ---------------------------------------------------------------------------*/
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;
}
-/* -----------------------------19.04.00 14:43--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(2);
@@ -818,5 +743,4 @@ void SwXTextSearch::FillSearchOptions( util::SearchOptions& rSearchOpt ) const
// aSrchParam.SetSrchInSelection(TypeConversion::toBOOL(aVal));
}
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index a039160d8360..95ca4eca6cf6 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <svx/svxids.hrc>
#include <hintids.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <svl/smplhint.hxx>
#include <svtools/ctrltool.hxx>
@@ -115,10 +116,6 @@ const IStyleAccess::SwAutoStyleFamily aAutoStyleByIndex[] =
using namespace ::com::sun::star;
using ::rtl::OUString;
-/******************************************************************************
- *
- ******************************************************************************/
-
//convert FN_... to RES_ in header and footer itemset
sal_uInt16 lcl_ConvertFNToRES(sal_uInt16 nFNId)
{
@@ -194,27 +191,19 @@ public:
SwDoc* getDoc() const { return pDoc; }
};
-
/******************************************************************
* SwXStyleFamilies
******************************************************************/
-/* -----------------------------06.04.00 11:24--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXStyleFamilies::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXStyleFamilies");
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXStyleFamilies::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.style.StyleFamilies") == rServiceName;
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXStyleFamilies::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -222,9 +211,7 @@ uno::Sequence< OUString > SwXStyleFamilies::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.style.StyleFamilies");
return aRet;
}
-/*-- 16.12.98 15:13:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyleFamilies::SwXStyleFamilies(SwDocShell& rDocShell) :
SwUnoCollection(rDocShell.GetDoc()),
pDocShell(&rDocShell),
@@ -236,9 +223,7 @@ SwXStyleFamilies::SwXStyleFamilies(SwDocShell& rDocShell) :
{
}
-/*-- 16.12.98 15:13:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyleFamilies::~SwXStyleFamilies()
{
delete pxCharStyles;
@@ -247,16 +232,14 @@ SwXStyleFamilies::~SwXStyleFamilies()
delete pxPageStyles;
delete pxNumberingStyles;
}
-/*-- 21.12.98 12:05:22---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXStyleFamilies::getByName(const OUString& Name)
throw(
container::NoSuchElementException,
lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// der Index kommt aus const unsigned short aStyleByIndex[] =
uno::Any aRet;
if(!IsValid())
@@ -275,9 +258,7 @@ uno::Any SAL_CALL SwXStyleFamilies::getByName(const OUString& Name)
throw container::NoSuchElementException();
return aRet;
}
-/*-- 21.12.98 12:05:22---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXStyleFamilies::getElementNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aNames(STYLE_FAMILY_COUNT);
@@ -289,9 +270,7 @@ uno::Sequence< OUString > SwXStyleFamilies::getElementNames(void) throw( uno::Ru
pNames[4] = C2U("NumberingStyles");
return aNames;
}
-/*-- 21.12.98 12:05:22---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyleFamilies::hasByName(const OUString& Name) throw( uno::RuntimeException )
{
if( Name.compareToAscii("CharacterStyles") == 0 ||
@@ -303,20 +282,16 @@ sal_Bool SwXStyleFamilies::hasByName(const OUString& Name) throw( uno::RuntimeEx
else
return sal_False;
}
-/*-- 16.12.98 15:13:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXStyleFamilies::getCount(void) throw( uno::RuntimeException )
{
return STYLE_FAMILY_COUNT;
}
-/*-- 16.12.98 15:13:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXStyleFamilies::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(nIndex < 0 || nIndex >= STYLE_FAMILY_COUNT)
throw lang::IndexOutOfBoundsException();
@@ -383,30 +358,24 @@ uno::Any SwXStyleFamilies::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 16.12.98 15:13:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXStyleFamilies::getElementType(void)
throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<container::XNameContainer>*)0);
}
-/*-- 16.12.98 15:13:28---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyleFamilies::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 16.12.98 15:13:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL,
const uno::Sequence< beans::PropertyValue >& aOptions)
throw( io::IOException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bLoadStyleText = sal_True;
sal_Bool bLoadStylePage = sal_True;
sal_Bool bLoadStyleOverwrite = sal_True;
@@ -449,50 +418,41 @@ void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL,
else
throw uno::RuntimeException();
}
-/*-- 16.12.98 15:13:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXStyleFamilies::getStyleLoaderOptions(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< beans::PropertyValue > aSeq(5);
beans::PropertyValue* pArray = aSeq.getArray();
uno::Any aVal;
sal_Bool bTemp = sal_True;
aVal.setValue(&bTemp, ::getCppuBooleanType());
- pArray[0] = beans::PropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LOAD_TEXT_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
+ pArray[0] = beans::PropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LOAD_TEXT_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
aVal.setValue(&bTemp, ::getCppuBooleanType());
- pArray[1] = beans::PropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LOAD_FRAME_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
+ pArray[1] = beans::PropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LOAD_FRAME_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
aVal.setValue(&bTemp, ::getCppuBooleanType());
- pArray[2] = beans::PropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LOAD_PAGE_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
+ pArray[2] = beans::PropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LOAD_PAGE_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
aVal.setValue(&bTemp, ::getCppuBooleanType());
- pArray[3] = beans::PropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LOAD_NUMBERING_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
+ pArray[3] = beans::PropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LOAD_NUMBERING_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
aVal.setValue(&bTemp, ::getCppuBooleanType());
- pArray[4] = beans::PropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_OVERWRITE_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
+ pArray[4] = beans::PropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_OVERWRITE_STYLES)), -1, aVal, beans::PropertyState_DIRECT_VALUE);
return aSeq;
}
/******************************************************************
* SwXStyleFamily
******************************************************************/
-/* -----------------------------06.04.00 11:24--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXStyleFamily::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXStyleFamily");
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXStyleFamily::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.style.StyleFamily") == rServiceName;
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXStyleFamily::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -500,41 +460,20 @@ uno::Sequence< OUString > SwXStyleFamily::getSupportedServiceNames(void) throw(
pArray[0] = C2U("com.sun.star.style.StyleFamily");
return aRet;
}
-/*-- 16.12.98 16:03:56---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyleFamily::SwXStyleFamily(SwDocShell* pDocSh, sal_uInt16 nFamily) :
eFamily((SfxStyleFamily)nFamily),
pBasePool(pDocSh->GetStyleSheetPool()),
pDocShell(pDocSh)
{
-/* switch( nFamily )
- {
- case SFX_STYLE_FAMILY_CHAR:
- _pPropMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_CHAR_STYLE);
- break;
- case SFX_STYLE_FAMILY_PARA:
- _pPropMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PARA_STYLE);
- break;
- case SFX_STYLE_FAMILY_PAGE:
- _pPropMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_PAGE_STYLE);
- break;
- case SFX_STYLE_FAMILY_FRAME:
- _pPropMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_FRAME_STYLE);
- break;
- case SFX_STYLE_FAMILY_PSEUDO:
- _pPropMap = aSwMapProvider.GetPropertyMap(PROPERTY_MAP_NUM_STYLE);
- break;
- }*/
StartListening(*pBasePool);
}
-/*-- 16.12.98 16:03:56---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyleFamily::~SwXStyleFamily()
{
}
+
sal_Int32 lcl_GetCountOrName ( const SwDoc &rDoc, SfxStyleFamily eFamily, String *pString, sal_uInt16 nIndex = USHRT_MAX )
{
sal_Int32 nCount = 0;
@@ -629,8 +568,6 @@ sal_Int32 lcl_GetCountOrName ( const SwDoc &rDoc, SfxStyleFamily eFamily, String
{
const SwPageDesc& rDesc = rDoc.GetPageDesc(i);
- /*if(rDesc.IsDefault() || rDesc.IsAuto())
- continue;*/
if ( IsPoolUserFmt ( rDesc.GetPoolFmtId() ) )
{
if ( nIndex == nCount )
@@ -673,21 +610,17 @@ sal_Int32 lcl_GetCountOrName ( const SwDoc &rDoc, SfxStyleFamily eFamily, String
}
return nCount;
}
-/*-- 16.12.98 16:03:57---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXStyleFamily::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return lcl_GetCountOrName ( *pDocShell->GetDoc(), eFamily, NULL );
}
-/*-- 16.12.98 16:03:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXStyleFamily::getByIndex(sal_Int32 nTempIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if ( nTempIndex >= 0 && nTempIndex < USHRT_MAX )
{
@@ -820,13 +753,11 @@ uno::Any SwXStyleFamily::getByIndex(sal_Int32 nTempIndex)
return aRet;
}
-/*-- 16.12.98 16:03:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXStyleFamily::getByName(const OUString& rName)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
String sStyleName;
SwStyleNameMapper::FillUIName(rName, sStyleName, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True );
@@ -855,12 +786,10 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName)
return aRet;
}
-/*-- 16.12.98 16:03:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXStyleFamily::getElementNames(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aRet;
if(pBasePool)
{
@@ -880,12 +809,10 @@ uno::Sequence< OUString > SwXStyleFamily::getElementNames(void) throw( uno::Runt
throw uno::RuntimeException();
return aRet;
}
-/*-- 16.12.98 16:03:57---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyleFamily::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(pBasePool)
{
@@ -900,30 +827,24 @@ sal_Bool SwXStyleFamily::hasByName(const OUString& rName) throw( uno::RuntimeExc
return bRet;
}
-/*-- 16.12.98 16:03:58---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXStyleFamily::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<style::XStyle>*)0);
}
-/*-- 16.12.98 16:03:58---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyleFamily::hasElements(void) throw( uno::RuntimeException )
{
if(!pBasePool)
throw uno::RuntimeException();
return sal_True;
}
-/*-- 16.12.98 16:03:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement)
throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pBasePool)
{
String sStyleName;
@@ -989,13 +910,11 @@ void SwXStyleFamily::insertByName(const OUString& rName, const uno::Any& rElemen
else
throw uno::RuntimeException();
}
-/*-- 16.12.98 16:03:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyleFamily::replaceByName(const OUString& rName, const uno::Any& rElement)
throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily);
@@ -1024,12 +943,10 @@ void SwXStyleFamily::replaceByName(const OUString& rName, const uno::Any& rEleme
else
throw uno::RuntimeException();
}
-/*-- 16.12.98 16:03:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyleFamily::removeByName(const OUString& rName) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
@@ -1063,7 +980,7 @@ uno::Any SAL_CALL SwXStyleFamily::getPropertyValue( const ::rtl::OUString& sProp
if ( sPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DisplayName") ) )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_uInt32 nResId = 0;
switch ( eFamily )
{
@@ -1114,10 +1031,6 @@ void SAL_CALL SwXStyleFamily::removeVetoableChangeListener( const ::rtl::OUStrin
OSL_ENSURE( 0, "###unexpected!" );
}
-
-/*-- 16.12.98 16:03:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXStyleFamily::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
@@ -1128,9 +1041,7 @@ void SwXStyleFamily::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
EndListening(rBC);
}
}
-/*-- 16.12.98 16:03:59---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyle* SwXStyleFamily::_FindStyle(const String& rStyleName)const
{
sal_uInt16 nLCount = pBasePool->GetListenerCount();
@@ -1146,9 +1057,7 @@ SwXStyle* SwXStyleFamily::_FindStyle(const String& rStyleName)const
}
return 0;
}
-/******************************************************************
- *
- ******************************************************************/
+
class SwStyleProperties_Impl
{
const PropertyEntryVector_t aPropertyEntries;
@@ -1168,22 +1077,18 @@ public:
const PropertyEntryVector_t& GetPropertyVector() const {return aPropertyEntries; }
};
-//--------------------------------------------------------------------
-//--------------------------------------------------------------------
+
SwStyleProperties_Impl::SwStyleProperties_Impl(const SfxItemPropertyMap* pMap) :
-// _pMap(pMap),
aPropertyEntries( pMap->getPropertyEntries() ),
nArrLen(0)
{
nArrLen = aPropertyEntries.size();
- //const SfxItemPropertyMap* pTmp = _pMap;
pAnyArr = new uno::Any* [nArrLen];
for ( sal_uInt32 i =0 ; i < nArrLen; i++ )
pAnyArr[i] = 0;
}
-//--------------------------------------------------------------------
-//--------------------------------------------------------------------
+
SwStyleProperties_Impl::~SwStyleProperties_Impl()
{
for ( sal_uInt16 i =0 ; i < nArrLen; i++ )
@@ -1191,8 +1096,6 @@ SwStyleProperties_Impl::~SwStyleProperties_Impl()
delete[] pAnyArr;
}
-//--------------------------------------------------------------------
-//--------------------------------------------------------------------
sal_Bool SwStyleProperties_Impl::SetProperty(const ::rtl::OUString& rName, uno::Any aVal)
{
sal_uInt16 nPos = 0;
@@ -1232,6 +1135,7 @@ sal_Bool SwStyleProperties_Impl::ClearProperty( const OUString& rName )
}
return bRet;
}
+
void SwStyleProperties_Impl::ClearAllProperties( )
{
for ( sal_uInt16 i = 0; i < nArrLen; i++ )
@@ -1240,8 +1144,7 @@ void SwStyleProperties_Impl::ClearAllProperties( )
pAnyArr[ i ] = 0;
}
}
-//--------------------------------------------------------------------
-//--------------------------------------------------------------------
+
sal_Bool SwStyleProperties_Impl::GetProperty(const ::rtl::OUString& rName, uno::Any*& rpAny )
{
sal_Bool bRet = sal_False;
@@ -1267,20 +1170,12 @@ void SwStyleProperties_Impl::GetProperty( const OUString &rPropertyName, const u
rAny = rxPropertySet->getPropertyValue( rPropertyName );
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXStyle::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXStyle::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -1294,16 +1189,12 @@ sal_Int64 SAL_CALL SwXStyle::getSomething( const uno::Sequence< sal_Int8 >& rId
}
TYPEINIT1(SwXStyle, SfxListener);
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXStyle::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXStyle");
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXStyle::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = C2U("com.sun.star.style.Style") == rServiceName;
@@ -1323,9 +1214,7 @@ sal_Bool SwXStyle::supportsService(const OUString& rServiceName) throw( uno::Run
return bRet;
}
-/* -----------------------------06.04.00 11:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXStyle::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
long nCount = 1;
@@ -1368,9 +1257,7 @@ uno::Sequence< OUString > SwXStyle::getSupportedServiceNames(void) throw( uno::R
}
return aRet;
}
-/*-- 17.12.98 08:26:49---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, sal_Bool bConditional) :
m_pDoc( pDoc ),
pBasePool(0),
@@ -1398,8 +1285,6 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, sal_Bool bConditional) :
aAny = xFamilies->getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "CharacterStyles" ) ) );
// Get the Frame family (and keep it for later)
aAny >>= mxStyleFamily;
- //aAny = mxStyleFamily->getByName ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Standard" ) ) );
- //aAny >>= mxStyleData;
}
break;
case SFX_STYLE_FAMILY_PARA:
@@ -1439,7 +1324,6 @@ SwXStyle::SwXStyle( SwDoc *pDoc, SfxStyleFamily eFam, sal_Bool bConditional) :
pPropImpl = new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(nMapId)->getPropertyMap());
}
-
SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
SwDoc* pDoc, const String& rStyleName) :
m_pDoc(pDoc),
@@ -1466,18 +1350,14 @@ SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
}
}
}
-/*-- 17.12.98 08:26:50---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXStyle::~SwXStyle()
{
if(pBasePool)
EndListening(*pBasePool);
delete pPropImpl;
}
-/*-- 17.12.98 08:26:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -1488,9 +1368,10 @@ void SwXStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
mxStyleFamily.clear();
}
}
+
OUString SwXStyle::getName(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String aString;
if(pBasePool)
{
@@ -1505,12 +1386,10 @@ OUString SwXStyle::getName(void) throw( uno::RuntimeException )
aString = sStyleName;
return OUString (aString);
}
-/*-- 17.12.98 08:26:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
@@ -1530,12 +1409,10 @@ void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException )
else
sStyleName = String(rName);
}
-/*-- 17.12.98 08:26:51---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyle::isUserDefined(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(pBasePool)
{
@@ -1549,12 +1426,10 @@ sal_Bool SwXStyle::isUserDefined(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 08:26:51---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXStyle::isInUse(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if(pBasePool)
{
@@ -1567,12 +1442,10 @@ sal_Bool SwXStyle::isInUse(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return bRet;
}
-/*-- 17.12.98 08:26:52---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXStyle::getParentStyle(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String aString;
if(pBasePool)
{
@@ -1588,13 +1461,11 @@ OUString SwXStyle::getParentStyle(void) throw( uno::RuntimeException )
SwStyleNameMapper::FillProgName(aString, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True );
return OUString ( aString );
}
-/*-- 17.12.98 08:26:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::setParentStyle(const OUString& rParentStyle)
throw( container::NoSuchElementException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String sParentStyle;
SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True );
if(pBasePool)
@@ -1638,9 +1509,6 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle)
else
throw uno::RuntimeException();
}
-/*-- 17.12.98 08:26:52---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily eFamily, sal_Bool bIsConditional )
{
@@ -1710,9 +1578,7 @@ uno::Reference< beans::XPropertySetInfo > SwXStyle::getPropertySetInfo(void)
{
return lcl_getPropertySetInfo( eFamily, bIsConditional );
}
-/* -----------------23.04.99 13:28-------------------
- *
- * --------------------------------------------------*/
+
void SwXStyle::ApplyDescriptorProperties()
{
bIsDescriptor = sal_False;
@@ -1731,9 +1597,6 @@ void SwXStyle::ApplyDescriptorProperties()
}
}
-/*-- 18.04.01 13:07:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
struct SwStyleBase_Impl
{
SwDoc& rDoc;
@@ -1767,9 +1630,7 @@ struct SwStyleBase_Impl
const SwPageDesc& GetOldPageDesc();
};
-/* -----------------------------25.04.01 12:44--------------------------------
- ---------------------------------------------------------------------------*/
const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
{
if(!pOldPageDesc)
@@ -1813,10 +1674,6 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
return *pOldPageDesc;
}
-/* -----------------------------19.04.01 09:44--------------------------------
-
- ---------------------------------------------------------------------------*/
-
void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
const SfxItemPropertySet& rPropSet,
const uno::Any& rValue,
@@ -1950,23 +1807,14 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
throw lang::IllegalArgumentException();
}
break;
- // case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
- //{
- // sal_Int8 nLevel = 0;
- // if( rValue >>= nLevel )
- // rBase.mxNewBase->GetCollection()->SetOutlineLevel( nLevel );
- // else
- // rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
- //}
- //break;
- case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
+ case RES_PARATR_OUTLINELEVEL:
{
sal_Int16 nLevel = 0;
rValue >>= nLevel;
if( 0 <= nLevel && nLevel <= MAXLEVEL)
rBase.mxNewBase->GetCollection()->SetAttrOutlineLevel( nLevel );
}
- break; //<-end,zhaojianwei
+ break;
case FN_UNO_FOLLOW_STYLE:
{
OUString sTmp;
@@ -1999,7 +1847,6 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SwStyleNameMapper::FillUIName(uDescName, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
if(!pNewDesc->GetPageDesc() || pNewDesc->GetPageDesc()->GetName() != sDescName)
{
- //sal_uInt16 nCount = pDoc->GetPageDescCnt();
sal_Bool bPut = sal_False;
if(sDescName.Len())
{
@@ -2060,7 +1907,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
// check for correct context and style name
//
sal_Int16 nIdx = GetCommandContextIndex( pSeq[i].Name );
- //
+
pBasePool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
sal_Bool bStyleFound = sal_False;
const SfxStyleSheetBase* pBase = pBasePool->First();
@@ -2070,7 +1917,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
bStyleFound = sal_True;
pBase = pBasePool->Next();
}
- //
+
if (nIdx == -1 || !bStyleFound)
{
bFailed = sal_True;
@@ -2162,7 +2009,6 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
throw lang::IllegalArgumentException();
}
goto put_itemset;
- //break;
case RES_PARATR_DROP:
{
if( MID_DROPCAP_CHAR_STYLE_NAME == rEntry.nMemberId)
@@ -2204,12 +2050,11 @@ put_itemset:
aSet.SetParent(&rStyleSet);
rPropSet.setPropertyValue(rEntry, rValue, aSet);
rStyleSet.Put(aSet);
- // --> OD 2006-10-18 #i70223#
+ // #i70223#
if ( SFX_STYLE_FAMILY_PARA == eFamily &&
rEntry.nWID == RES_PARATR_NUMRULE &&
rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() &&
- //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
- rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei
+ rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() )
{
OUString sNewNumberingRuleName;
@@ -2218,17 +2063,13 @@ put_itemset:
if ( sNewNumberingRuleName.getLength() == 0 ||
sTmp != pDoc->GetOutlineNumRule()->GetName() )
{
- // delete assignment to list level of outline style.
- //rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
- rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,adde by zhaojianwei
+ rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
}
}
}
}
}
-/* -----------------------------18.04.01 13:29--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXStyle::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
@@ -2302,7 +2143,7 @@ void SwXStyle::setPropertyValues(
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// workaround for bad designed API
try
@@ -2319,7 +2160,6 @@ void SwXStyle::setPropertyValues(
}
}
-
uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
const SfxItemPropertySet& rPropSet,
SwStyleBase_Impl& rBase,
@@ -2374,21 +2214,13 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
aRet.setValue(&xRules, ::getCppuType((uno::Reference<container::XIndexReplace>*)0));
}
break;
- //case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
- //{
- // DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
- // sal_uInt8 nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
- // if( nLevel != NO_NUMBERING )
- // aRet <<= static_cast<sal_Int8>( nLevel );
- //}
- //break;
- case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
+ case RES_PARATR_OUTLINELEVEL:
{
DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
aRet <<= static_cast<sal_Int16>( nLevel );
}
- break; //<-end,zhaojianwei
+ break;
case FN_UNO_FOLLOW_STYLE:
{
String aString;
@@ -2434,7 +2266,6 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
DBG_ASSERT(COND_COMMAND_COUNT == 28,
"invalid size of comman count?");
- //SfxItemSet& rStyleSet = rBase.GetItemSet();
uno::Sequence< beans::NamedValue > aSeq(COND_COMMAND_COUNT);
beans::NamedValue *pSeq = aSeq.getArray();
@@ -2514,9 +2345,7 @@ query_itemset:
throw uno::RuntimeException();
return aRet;
}
-/* -----------------------------19.04.01 09:26--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
const uno::Sequence< OUString > & rPropertyNames )
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -2611,13 +2440,11 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
}
return aRet;
}
-/* -----------------------------04.11.03 09:26--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXStyle::getPropertyValues(
const uno::Sequence< OUString >& rPropertyNames ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -2636,34 +2463,27 @@ uno::Sequence< uno::Any > SwXStyle::getPropertyValues(
return aValues;
}
-/*-- 18.04.01 13:07:29---------------------------------------------------
- -----------------------------------------------------------------------*/
+
void SwXStyle::addPropertiesChangeListener(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{
}
-/*-- 18.04.01 13:07:30---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{
}
-/*-- 18.04.01 13:07:30---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::firePropertiesChangeEvent(
const uno::Sequence< OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw(uno::RuntimeException)
{
}
-/*-- 17.12.98 08:26:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
throw( beans::UnknownPropertyException,
beans::PropertyVetoException,
@@ -2671,52 +2491,42 @@ void SwXStyle::setPropertyValue(const OUString& rPropertyName, const uno::Any& r
lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
const uno::Sequence<uno::Any> aValues(&rValue, 1);
SetPropertyValues_Impl( aProperties, aValues );
}
-/*-- 17.12.98 08:26:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXStyle::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
return GetPropertyValues_Impl(aProperties).getConstArray()[0];
}
-/*-- 17.12.98 08:26:53---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::addPropertyChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 17.12.98 08:26:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::removePropertyChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 17.12.98 08:26:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::addVetoableChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 17.12.98 08:26:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -2724,13 +2534,10 @@ void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
DBG_WARNING("not implemented");
}
-/*-- 08.03.99 10:50:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aNames(1);
OUString* pNames = aNames.getArray();
@@ -2738,14 +2545,12 @@ beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames);
return aStates.getConstArray()[0];
}
-/*-- 08.03.99 10:50:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
const uno::Sequence< OUString >& rPropertyNames)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
if(pBasePool)
@@ -2783,14 +2588,6 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
{
pStates[i] = beans::PropertyState_DIRECT_VALUE;
}
- // else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pEntry->nWID ) //#outline level,removed by zahojianwei
- // {
- // pStates[i] =
- // ( xStyle->GetCollection()->GetOutlineLevel()
- // == NO_NUMBERING )
- // ? beans::PropertyState_DEFAULT_VALUE
- // : beans::PropertyState_DIRECT_VALUE;
- // } //<-end,zhaojianwei
else if(SFX_STYLE_FAMILY_PAGE == eFamily &&
(rPropName.EqualsAscii("Header", 0, 6)
|| rPropName.EqualsAscii("Footer", 0, 6)))
@@ -2842,9 +2639,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
throw uno::RuntimeException();
return aRet;
}
-/*-- 08.03.99 10:50:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXStyle::setPropertyToDefault(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, uno::RuntimeException )
{
@@ -2855,7 +2650,7 @@ void SwXStyle::setPropertyToDefault(const OUString& rPropertyName)
void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFmt *pTargetFmt = 0;
if(pBasePool)
@@ -2914,14 +2709,10 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY )
throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
- //if( pEntry->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL ) //#outline level, removed by zhaojianwei
- // static_cast<SwTxtFmtColl*>(pTargetFmt)->SetOutlineLevel( NO_NUMBERING );
- //else
- // pTargetFmt->ResetFmtAttr( pEntry->nWID );
- if( pEntry->nWID == RES_PARATR_OUTLINELEVEL ) //add by zhaojianwei
+ if( pEntry->nWID == RES_PARATR_OUTLINELEVEL )
static_cast<SwTxtFmtColl*>(pTargetFmt)->DeleteAssignmentToListLevelOfOutlineStyle();
else
- pTargetFmt->ResetFmtAttr( pEntry->nWID ); //<-end,zhaojianwei
+ pTargetFmt->ResetFmtAttr( pEntry->nWID );
}
}
else if ( bIsDescriptor )
@@ -2934,7 +2725,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(pBasePool)
{
pBasePool->SetSearchMask(eFamily);
@@ -2955,13 +2746,8 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
case SFX_STYLE_FAMILY_PARA :
{
pTargetFmt = xStyle->GetCollection();
- // --> OD 2007-07-25 #132402# - make code robust
if ( xStyle->GetCollection() )
- {
- // xStyle->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
- xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,add by zhaojianwei
- }
- // <--
+ xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
}
break;
case SFX_STYLE_FAMILY_FRAME:
@@ -3011,13 +2797,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
aFrmSz.SetSize( aPhysSize );
}
else
- {
- // --> OD 2008-07-25 #i91928#
-// aFrmSz.SetWidth( LONG_MAX );
-// aFrmSz.SetHeight( LONG_MAX );
aFrmSz.SetSize( SvxPaperInfo::GetDefaultPaperSize() );
- // <--
- }
}
else
@@ -3033,11 +2813,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
pTargetFmt->SetFmtAttr( aFrmSz );
}
else
- {
- // --> OD 2007-01-25 #i73790# - method renamed
pTargetFmt->ResetAllFmtAttr();
- // <--
- }
if( USHRT_MAX != nPgDscPos )
m_pDoc->ChgPageDesc( nPgDscPos,
@@ -3058,7 +2834,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nCount = aPropertyNames.getLength();
uno::Sequence < uno::Any > aRet ( nCount );
if ( nCount )
@@ -3111,18 +2887,14 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Seq
}
return aRet;
}
-/*-- 08.03.99 10:50:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXStyle::getPropertyDefault(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
return getPropertyDefaults ( aSequence ).getConstArray()[0];
}
-/* -----------------21.01.99 13:08-------------------
- *
- * --------------------------------------------------*/
+
void SwXStyle::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
@@ -3145,9 +2917,7 @@ void SwXStyle::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
}
}
-/* -----------------------------15.08.00 11:35--------------------------------
- ---------------------------------------------------------------------------*/
void SwXStyle::Invalidate()
{
sStyleName.Erase();
@@ -3157,40 +2927,29 @@ void SwXStyle::Invalidate()
mxStyleFamily.clear();
}
-
/******************************************************************
* SwXPageStyle
******************************************************************/
-/*-- 17.12.98 08:43:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXPageStyle::SwXPageStyle(SfxStyleSheetBasePool& rPool,
SwDocShell* pDocSh, SfxStyleFamily eFam,
- const String& rStyleName)://, const SfxItemPropertyMap* _pMap) :
- SwXStyle(rPool, eFam, pDocSh->GetDoc(), rStyleName),//, _pMap),
+ const String& rStyleName):
+ SwXStyle(rPool, eFam, pDocSh->GetDoc(), rStyleName),
pDocShell(pDocSh)
{
}
-/* -----------------23.08.99 15:52-------------------
- --------------------------------------------------*/
SwXPageStyle::SwXPageStyle(SwDocShell* pDocSh) :
SwXStyle(pDocSh->GetDoc(), SFX_STYLE_FAMILY_PAGE),
pDocShell(pDocSh)
{
}
-/*-- 17.12.98 08:43:35---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXPageStyle::~SwXPageStyle()
{
}
-/* -----------------------------18.04.01 13:50--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
const uno::Sequence< OUString >& rPropertyNames,
const uno::Sequence< uno::Any >& rValues )
@@ -3255,7 +3014,6 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
case FN_UNO_FOOTER_HEIGHT:
case FN_UNO_FOOTER_EAT_SPACING:
{
- sal_Bool bSetItem = sal_False;
sal_Bool bFooter = sal_False;
sal_uInt16 nItemType = TYPE_BOOL;
sal_uInt16 nRes = 0;
@@ -3331,7 +3089,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
case TYPE_BOX: pNewItem = new SvxBoxItem(nRes); break;
}
}
- bSetItem = pNewItem->PutValue(pValues[nProp], pEntry->nMemberId);
+ pNewItem->PutValue(pValues[nProp], pEntry->nMemberId);
rSetSet.Put(*pNewItem);
aBaseImpl.GetItemSet().Put(*pNewSetItem);
delete pNewItem;
@@ -3413,7 +3171,7 @@ void SwXPageStyle::setPropertyValues(
const uno::Sequence< uno::Any >& rValues )
throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// workaround for bad designed API
try
@@ -3429,9 +3187,7 @@ void SwXPageStyle::setPropertyValues(
throw aWExc;
}
}
-/* -----------------------------04.11.03 13:50--------------------------------
- ---------------------------------------------------------------------------*/
static uno::Reference<text::XText>
lcl_makeHeaderFooter(
const sal_uInt16 nRes, const bool bHeader, SwFrmFmt const*const pFrmFmt)
@@ -3488,7 +3244,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
}
sal_uInt16 nRes = 0;
bool bHeader = false;
- sal_Bool bAll = sal_False, bLeft = sal_False, bRight = sal_False;
+ sal_Bool bLeft = sal_False;
switch(pEntry->nWID)
{
case FN_UNO_HEADER_ON:
@@ -3588,20 +3344,19 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
}
break;
case FN_UNO_HEADER :
- bAll = sal_True; goto Header;
+ goto Header;
case FN_UNO_HEADER_LEFT :
bLeft = sal_True; goto Header;
case FN_UNO_HEADER_RIGHT :
- bRight = sal_True; goto Header;
+ goto Header;
Header:
bHeader = true;
nRes = RES_HEADER; goto MakeObject;
case FN_UNO_FOOTER :
- bAll = sal_True; goto Footer;
+ goto Footer;
case FN_UNO_FOOTER_LEFT :
bLeft = sal_True; goto Footer;
case FN_UNO_FOOTER_RIGHT :
- bRight = sal_True;
Footer:
nRes = RES_FOOTER;
MakeObject:
@@ -3656,14 +3411,12 @@ MakeObject:
}
return aRet;
}
-/* -----------------------------18.04.01 13:50--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXPageStyle::getPropertyValues(
const uno::Sequence< OUString >& rPropertyNames )
throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -3682,19 +3435,15 @@ uno::Sequence< uno::Any > SwXPageStyle::getPropertyValues(
return aValues;
}
-/*-- 17.12.98 08:43:36---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXPageStyle::getPropertyValue(const OUString& rPropertyName) throw(
beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
return GetPropertyValues_Impl(aProperties).getConstArray()[0];
}
-/*-- 17.12.98 08:43:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXPageStyle::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
throw( beans::UnknownPropertyException,
beans::PropertyVetoException,
@@ -3702,7 +3451,7 @@ void SwXPageStyle::setPropertyValue(const OUString& rPropertyName, const uno::An
lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
const uno::Sequence<uno::Any> aValues(&rValue, 1);
SetPropertyValues_Impl( aProperties, aValues );
@@ -3712,15 +3461,11 @@ SwXFrameStyle::SwXFrameStyle ( SwDoc *pDoc )
: SwXStyle ( pDoc, SFX_STYLE_FAMILY_FRAME, sal_False)
{
}
-/* -----------------------------15.12.00 15:45--------------------------------
- ---------------------------------------------------------------------------*/
SwXFrameStyle::~SwXFrameStyle()
{
}
-/* -----------------------------15.12.00 14:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXFrameStyle::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTypes = SwXStyle::getTypes();
@@ -3729,9 +3474,7 @@ uno::Sequence< uno::Type > SwXFrameStyle::getTypes( ) throw(uno::RuntimeExcepti
aTypes.getArray()[nLen] = ::getCppuType((uno::Reference<XEventsSupplier>*)0);
return aTypes;
}
-/* -----------------------------15.12.00 14:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXFrameStyle::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
{
uno::Any aRet;
@@ -3741,41 +3484,31 @@ uno::Any SwXFrameStyle::queryInterface( const uno::Type& rType ) throw(uno::Runt
aRet = SwXStyle::queryInterface(rType);
return aRet;
}
-/* -----------------------------15.12.00 14:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< container::XNameReplace > SwXFrameStyle::getEvents( ) throw(uno::RuntimeException)
{
return new SwFrameStyleEventDescriptor( *this );
}
-/*-- 19.05.2006 11:23:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoStyles::SwXAutoStyles(SwDocShell& rDocShell) :
SwUnoCollection(rDocShell.GetDoc()), pDocShell( &rDocShell )
{
}
-/*-- 19.05.2006 11:23:56---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoStyles::~SwXAutoStyles()
{
}
-/*-- 19.05.2006 11:23:57---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXAutoStyles::getCount(void) throw( uno::RuntimeException )
{
return AUTOSTYLE_FAMILY_COUNT;
}
-/*-- 19.05.2006 11:23:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoStyles::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(nIndex < 0 || nIndex >= AUTOSTYLE_FAMILY_COUNT)
throw lang::IndexOutOfBoundsException();
@@ -3816,23 +3549,17 @@ uno::Any SwXAutoStyles::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 19.05.2006 11:23:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXAutoStyles::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((const uno::Reference<style::XAutoStyleFamily>*)0);
}
-/*-- 19.05.2006 11:23:58---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoStyles::hasElements( ) throw(uno::RuntimeException)
{
return sal_True;
}
-/*-- 19.05.2006 11:23:58---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoStyles::getByName(const rtl::OUString& Name)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -3847,9 +3574,7 @@ uno::Any SwXAutoStyles::getByName(const rtl::OUString& Name)
throw container::NoSuchElementException();
return aRet;
}
-/*-- 19.05.2006 11:23:59---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< rtl::OUString > SwXAutoStyles::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -3860,9 +3585,7 @@ uno::Sequence< rtl::OUString > SwXAutoStyles::getElementNames(void)
pNames[2] = C2U("ParagraphStyles");
return aNames;
}
-/*-- 19.05.2006 11:24:00---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoStyles::hasByName(const rtl::OUString& Name)
throw( uno::RuntimeException )
{
@@ -3874,18 +3597,13 @@ sal_Bool SwXAutoStyles::hasByName(const rtl::OUString& Name)
return sal_False;
}
-/*-- 19.05.2006 11:24:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoStyleFamily::SwXAutoStyleFamily(SwDocShell* pDocSh, IStyleAccess::SwAutoStyleFamily nFamily) :
pDocShell( pDocSh ), eFamily(nFamily)
{
// Register ourselves as a listener to the document (via the page descriptor)
pDocSh->GetDoc()->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 19.05.2006 11:24:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoStyleFamily::~SwXAutoStyleFamily()
{
}
@@ -3897,9 +3615,6 @@ void SwXAutoStyleFamily::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pDocShell = 0;
}
-/*-- 31.05.2006 11:24:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
const uno::Sequence< beans::PropertyValue >& Values )
throw (uno::RuntimeException)
@@ -3943,11 +3658,11 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
}
catch (beans::UnknownPropertyException &)
{
- ASSERT( false, "Unknown property" );
+ OSL_ENSURE( false, "Unknown property" );
}
catch (lang::IllegalArgumentException &)
{
- ASSERT( false, "Illegal argument" );
+ OSL_ENSURE( false, "Illegal argument" );
}
}
@@ -3955,9 +3670,7 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
uno::Reference<style::XAutoStyle> xRet = new SwXAutoStyle(pDocShell->GetDoc(), pSet, eFamily);
return xRet;
}
-/*-- 31.05.2006 11:24:02---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXAutoStyleFamily::createEnumeration( )
throw (uno::RuntimeException)
{
@@ -3966,24 +3679,17 @@ uno::Reference< container::XEnumeration > SwXAutoStyleFamily::createEnumeration(
return uno::Reference< container::XEnumeration >
(new SwXAutoStylesEnumerator( pDocShell->GetDoc(), eFamily ));
}
-/*-- 19.05.2006 11:24:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXAutoStyleFamily::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((const uno::Reference<style::XAutoStyle>*)0);
}
-/*-- 19.05.2006 11:24:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXAutoStyleFamily::hasElements( ) throw(uno::RuntimeException)
{
return sal_False;
}
-/*-- 31.05.2006 11:24:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAutoStyleFamily eFam )
: pDoc( pInitDoc ), eFamily( eFam )
{
@@ -4018,18 +3724,13 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut
aIter = mAutoStyles.begin();
}
-/*-- 31.05.2006 11:24:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoStylesEnumerator::SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam )
: pImpl( new SwAutoStylesEnumImpl( pDoc, eFam ) )
{
// Register ourselves as a listener to the document (via the page descriptor)
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 31.05.2006 11:24:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoStylesEnumerator::~SwXAutoStylesEnumerator()
{
delete pImpl;
@@ -4045,10 +3746,6 @@ void SwXAutoStylesEnumerator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-
-/*-- 31.05.2006 11:24:05---------------------------------------------------
-
- -----------------------------------------------------------------------*/
::sal_Bool SwXAutoStylesEnumerator::hasMoreElements( )
throw (uno::RuntimeException)
{
@@ -4056,9 +3753,7 @@ void SwXAutoStylesEnumerator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
throw uno::RuntimeException();
return pImpl->hasMoreElements();
}
-/*-- 31.05.2006 11:24:05---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXAutoStylesEnumerator::nextElement( )
throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -4074,9 +3769,7 @@ uno::Any SwXAutoStylesEnumerator::nextElement( )
}
return aRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXAutoStyle::SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam )
: pSet( pInitSet ), eFamily( eFam )
{
@@ -4084,9 +3777,6 @@ SwXAutoStyle::SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAc
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXAutoStyle::~SwXAutoStyle()
{
}
@@ -4098,9 +3788,6 @@ void SwXAutoStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pSet.reset();
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
throw (uno::RuntimeException)
{
@@ -4147,9 +3834,6 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
return xRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertyValue( const OUString& /*rPropertyName*/, const uno::Any& /*rValue*/ )
throw( beans::UnknownPropertyException,
beans::PropertyVetoException,
@@ -4159,22 +3843,16 @@ void SwXAutoStyle::setPropertyValue( const OUString& /*rPropertyName*/, const un
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SwXAutoStyle::getPropertyValue( const OUString& rPropertyName )
throw( beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Sequence<OUString> aProperties(&rPropertyName, 1);
return GetPropertyValues_Impl(aProperties).getConstArray()[0];
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::addPropertyChangeListener( const OUString& /*aPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw( beans::UnknownPropertyException,
@@ -4183,9 +3861,6 @@ void SwXAutoStyle::addPropertyChangeListener( const OUString& /*aPropertyName*/,
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::removePropertyChangeListener( const OUString& /*aPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
throw( beans::UnknownPropertyException,
@@ -4194,9 +3869,6 @@ void SwXAutoStyle::removePropertyChangeListener( const OUString& /*aPropertyName
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::addVetoableChangeListener( const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw( beans::UnknownPropertyException,
@@ -4205,9 +3877,6 @@ void SwXAutoStyle::addVetoableChangeListener( const OUString& /*PropertyName*/,
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::removeVetoableChangeListener( const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw( beans::UnknownPropertyException,
@@ -4216,9 +3885,6 @@ void SwXAutoStyle::removeVetoableChangeListener( const OUString& /*PropertyName*
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertyValues(
const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
const uno::Sequence< uno::Any >& /*aValues*/ )
@@ -4227,9 +3893,6 @@ void SwXAutoStyle::setPropertyValues(
{
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl(
const uno::Sequence< OUString > & rPropertyNames )
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -4275,14 +3938,11 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl(
return aRet;
}
-/*-- 19.05.2006 11:24:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues (
const uno::Sequence< ::rtl::OUString >& rPropertyNames )
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< uno::Any > aValues;
// workaround for bad designed API
@@ -4302,9 +3962,6 @@ uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues (
return aValues;
}
-/*-- 19.05.2006 11:24:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::addPropertiesChangeListener(
const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -4312,18 +3969,12 @@ void SwXAutoStyle::addPropertiesChangeListener(
{
}
-/*-- 19.05.2006 11:24:10---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::removePropertiesChangeListener(
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::firePropertiesChangeEvent(
const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/,
const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ )
@@ -4331,14 +3982,11 @@ void SwXAutoStyle::firePropertiesChangeEvent(
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
beans::PropertyState SwXAutoStyle::getPropertyState( const OUString& rPropertyName )
throw( beans::UnknownPropertyException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< OUString > aNames(1);
OUString* pNames = aNames.getArray();
@@ -4347,18 +3995,12 @@ beans::PropertyState SwXAutoStyle::getPropertyState( const OUString& rPropertyNa
return aStates.getConstArray()[0];
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertyToDefault( const OUString& /*PropertyName*/ )
throw( beans::UnknownPropertyException,
uno::RuntimeException )
{
}
-/*-- 19.05.2006 11:24:11---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SwXAutoStyle::getPropertyDefault( const OUString& rPropertyName )
throw( beans::UnknownPropertyException,
lang::WrappedTargetException,
@@ -4368,16 +4010,13 @@ uno::Any SwXAutoStyle::getPropertyDefault( const OUString& rPropertyName )
return getPropertyDefaults ( aSequence ).getConstArray()[0];
}
-/*-- 19.05.2006 11:24:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates(
const uno::Sequence< ::rtl::OUString >& rPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
if( !pSet.get() )
throw uno::RuntimeException();
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
beans::PropertyState* pStates = aRet.getArray();
const OUString* pNames = rPropertyNames.getConstArray();
@@ -4406,26 +4045,17 @@ uno::Sequence< beans::PropertyState > SwXAutoStyle::getPropertyStates(
return aRet;
}
-/*-- 19.05.2006 11:24:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXAutoStyle::setPropertiesToDefault(
const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/ )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
}
-/*-- 19.05.2006 11:24:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Any > SwXAutoStyle::getPropertyDefaults(
const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/ )
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
@@ -4435,14 +4065,11 @@ uno::Sequence< uno::Any > SwXAutoStyle::getPropertyDefaults(
return aRet;
}
-/*-- 19.05.2006 11:24:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::RuntimeException)
{
if( !pSet.get() )
throw uno::RuntimeException();
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
std::vector< beans::PropertyValue > aPropertyVector;
sal_Int8 nPropSetId = 0;
@@ -4458,22 +4085,6 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
const SfxItemPropertySet* pPropSet = aSwMapProvider.GetPropertySet(nPropSetId);
const SfxItemPropertyMap *pMap = pPropSet->getPropertyMap();
PropertyEntryVector_t aPropVector = pMap->getPropertyEntries();
-// struct compareWhichIds
-// {
-// bool operator()(const sal_uInt16 w1, const sal_uInt16 w2) const
-// {
-// return w1 < w2;
-// }
-// };
-// typedef std::map<const sal_uInt16, SfxItemPropertyNamedEntry, compareWhichIds> PropertyMap_t;
-// PropertyMap_t aPropMap;
-// aPropMap.reserve( aPropVector.size() );
-// PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin();
-// while( aIt != aPropertyEntries.end() )
-// {
-// aPropMap[aIt->nWID] = *aIt;
-// ++aIt;
-// }
SfxItemSet& rSet = *pSet.get();
SfxItemIter aIter(rSet);
@@ -4483,14 +4094,6 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
{
const sal_uInt16 nWID = pItem->Which();
-// PropertyMap_t::const_iterator aMapIt = aPropMap[nWID];
-// if( aMapIt != aPropMap.getEnd() )
-// {
-// beans::PropertyValue aPropertyValue;
-// aPropertyValue.Name = aIt->sName;
-// pItem->QueryValue( aPropertyValue.Value, aIt->nMemberId );
-// aPropertyVector.push_back( aPropertyValue );
-// }
// TODO: Optimize - and fix! the old iteration filled each WhichId
// only once but there are more properties than WhichIds
PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
@@ -4505,20 +4108,6 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
}
++aIt;
}
-/* int i = 0;
- while ( pMap[i].nWID != 0 )
- {
- if ( pMap[i].nWID == nWID )
- {
- beans::PropertyValue aPropertyValue;
- String sString( OUString::createFromAscii( pMap[i].pName ) );
- aPropertyValue.Name = sString;
- pItem->QueryValue( aPropertyValue.Value, pMap[i].nMemberId );
- aPropertyVector.push_back( aPropertyValue );
- break;
- }
- ++i;
- }*/
pItem = aIter.NextItem();
}
@@ -4533,3 +4122,5 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties() throw (uno::
return aRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 6160f196d987..2f03fcc92c28 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,6 +70,7 @@
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/XTextSection.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/TableBorderDistances.hpp>
@@ -81,7 +83,6 @@
#include <com/sun/star/chart2/data/XDataSequence.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
#include <com/sun/star/table/CellContentType.hpp>
-#include <unotbl.hxx>
#include <unotextrange.hxx>
#include <unotextcursor.hxx>
#include <unoparagraph.hxx>
@@ -94,31 +95,26 @@
#include <editeng/keepitem.hxx>
#include <fmtlsplt.hxx>
#include <swundo.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <SwStyleNameMapper.hxx>
#include <frmatr.hxx>
#include <crsskip.hxx>
#include <unochart.hxx>
#include <sortopt.hxx>
#include <rtl/math.hxx>
-
+#include <editeng/frmdiritem.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
-
-//-----------------------------------------------------------------------------
// from swtable.cxx
extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
#define UNO_TABLE_COLUMN_SUM 10000
-/* -----------------17.07.98 15:47-------------------
- *
- * --------------------------------------------------*/
table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
{
- table::BorderLine aLine;
+ table::BorderLine2 aLine;
if(pLine)
{
aLine.Color = pLine->GetColor().GetColor() ;
@@ -130,9 +126,7 @@ table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
aLine.Color = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance = 0;
return aLine;
}
-/* -----------------17.07.98 15:52-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine)
{
rSvxLine.SetColor( Color(rLine.Color));
@@ -142,9 +136,7 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi
sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0;
return bRet;
}
-/* -----------------11.12.98 14:22-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue)
throw (lang::IllegalArgumentException)
{
@@ -176,10 +168,10 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
case FN_TABLE_WIDTH:
case FN_TABLE_RELATIVE_WIDTH:
{
- sal_Int32 nWidth = 0;
SwFmtFrmSize aSz( pFmt->GetFrmSize() );
if(FN_TABLE_WIDTH == pEntry->nWID)
{
+ sal_Int32 nWidth = 0;
aValue >>= nWidth;
aSz.SetWidthPercent(0);
aSz.SetWidth ( MM100_TO_TWIP ( nWidth ) );
@@ -226,9 +218,6 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
}
}
-/* -----------------27.04.98 08:50-------------------
- *
- * --------------------------------------------------*/
uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry )
{
uno::Any aRet;
@@ -326,10 +315,6 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
}
return aRet;
}
-/* -----------------19.10.05 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the position for the cell with the specified name
// (note that the indices rColumn and rRow are 0 based here)
@@ -389,7 +374,6 @@ void lcl_GetCellPosition( const String &rCellName,
#endif
}
-
// arguments: must be non-empty strings with valid cell names
//
// returns: -1 if first cell < second cell
@@ -412,7 +396,6 @@ int lcl_CompareCellsByRowFirst( const String &rCellName1, const String &rCellNam
return +1;
}
-
// arguments: must be non-empty strings with valid cell names
//
// returns: -1 if first cell < second cell
@@ -435,7 +418,6 @@ int lcl_CompareCellsByColFirst( const String &rCellName1, const String &rCellNam
return +1;
}
-
// arguments: must be non-empty strings with valid cell names
//
// returns: -1 if first cell range < second cell range
@@ -464,11 +446,6 @@ int lcl_CompareCellRanges(
return +1;
}
-
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the cell name for the cell at the specified position
// (note that the indices nColumn and nRow are 0 based here)
String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
@@ -503,7 +480,6 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
@param i_bTopLeft if true, find top left box, otherwise find bottom
right box
*/
-
const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const bool i_bTopLeft)
{
bool bFirst = true;
@@ -530,9 +506,6 @@ const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const
return pBox;
}
-/* -----------------21.11.05 14:46-------------------
-
- --------------------------------------------------*/
// start cell should be in the upper-left corner of the range and
// end cell in the lower-right.
// I.e. from the four possible representation
@@ -569,10 +542,6 @@ void SwRangeDescriptor::Normalize()
}
}
-
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
{
SwXCell* pXCell = 0;
@@ -585,9 +554,7 @@ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
}
return pXCell;
}
-/* -----------------20.07.98 12:35-------------------
- *
- * --------------------------------------------------*/
+
void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
{
for( sal_uInt16 i = 0; i < rLines.Count(); i++ )
@@ -607,9 +574,7 @@ void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
}
}
}
-/* -----------------02.10.98 15:55-------------------
- *
- * --------------------------------------------------*/
+
void lcl_FormatTable(SwFrmFmt* pTblFmt)
{
SwClientIter aIter( *pTblFmt );
@@ -625,9 +590,7 @@ void lcl_FormatTable(SwFrmFmt* pTblFmt)
}
}
}
-/* -----------------20.07.98 13:15-------------------
- *
- * --------------------------------------------------*/
+
void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
{
if(bExpand)
@@ -639,9 +602,7 @@ void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
pCrsr->DeleteMark();
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow)
{
SwTabCols aCols;
@@ -670,9 +631,7 @@ void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal
rRet.setValue(&aColSeq, ::getCppuType((uno::Sequence< text::TableColumnSeparator>*)0));
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow, SwDoc* pDoc)
{
SwTabCols aOldCols;
@@ -716,15 +675,14 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo
}
}
}
-/* -----------------30.04.02 08:00-------------------
- *
- * --------------------------------------------------*/
+
inline rtl::OUString lcl_getString( SwXCell &rCell )
{
// getString is a member function of the base class...
return rCell.getString();
}
-/* -----------------30.04.02 08:00-------------------
+
+/* --------------------------------------------------
* non UNO function call to set string in SwXCell
* --------------------------------------------------*/
void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
@@ -742,7 +700,8 @@ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
}
rCell.SwXText::setString(rTxt);
}
-/* -----------------30.04.02 08:00-------------------
+
+/* --------------------------------------------------
* non UNO function call to get value from SwXCell
* --------------------------------------------------*/
double lcl_getValue( SwXCell &rCell )
@@ -754,7 +713,8 @@ double lcl_getValue( SwXCell &rCell )
::rtl::math::setNan( &fRet );
return fRet;
}
-/* -----------------30.04.02 08:00-------------------
+
+/* --------------------------------------------------
* non UNO function call to set value in SwXCell
* --------------------------------------------------*/
void lcl_setValue( SwXCell &rCell, double nVal )
@@ -790,13 +750,12 @@ void lcl_setValue( SwXCell &rCell, double nVal )
pDoc->UpdateTblFlds( &aTblUpdate );
}
}
+
/******************************************************************
* SwXCell
******************************************************************/
TYPEINIT1(SwXCell, SwClient);
-/*-- 11.12.98 10:56:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -806,9 +765,7 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
nFndPos(nPos)
{
}
-/* -----------------------------09.08.00 15:59--------------------------------
- ---------------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -819,24 +776,17 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
{
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXCell::~SwXCell()
{
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -849,9 +799,7 @@ sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
else
return SwXText::getSomething(rId);
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeException)
{
static uno::Sequence< uno::Type > aRetTypes;
@@ -873,12 +821,10 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce
}
return aRetTypes;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -888,23 +834,17 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::R
}
return aId;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::acquire( ) throw()
{
SwXCellBaseClass::acquire();
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::release( ) throw()
{
SwXCellBaseClass::release();
}
-/* -----------------------------18.05.00 10:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -913,9 +853,7 @@ uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
aRet = SwXText::queryInterface(aType);
return aRet;
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXCell::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -931,9 +869,7 @@ SwXCell::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwXCell::IsValid() const
{
// FIXME: this is now a const method, to make SwXText::IsValid invisible
@@ -955,12 +891,10 @@ bool SwXCell::IsValid() const
}
return 0 != pBox;
}
-/*-- 11.12.98 10:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sRet;
if(IsValid())
{
@@ -971,12 +905,10 @@ OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
}
return sRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
// Der Text mu? zunaechst (vielleicht) geloescht werden
@@ -1004,31 +936,25 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException
pMyDoc->UpdateTblFlds( &aTblUpdate );
}
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
double SwXCell::getValue(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
double const fRet = lcl_getValue( *this );
// #i112652# a table cell may contain NaN as a value, do not filter that
return fRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setValue(double rValue) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
lcl_setValue( *this, rValue );
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
table::CellContentType nRes = table::CellContentType_EMPTY;
sal_uInt32 nNdPos = pBox->IsFormulaOrValueBox();
@@ -1039,34 +965,27 @@ table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
case RES_BOXATR_VALUE : nRes = table::CellContentType_VALUE; break;
case RES_BOXATR_FORMULA : nRes = table::CellContentType_FORMULA; break;
default :
- DBG_ERROR( "unexpected case" );
+ OSL_FAIL( "unexpected case" );
}
return nRes;
}
-/* -----------------27.04.99 12:06-------------------
- *
- * --------------------------------------------------*/
+
void SwXCell::setString(const OUString& aString) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
lcl_setString( *this, aString );
}
-/*-- 11.12.98 10:56:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString sContent = getString();
return sContent.equals(ViewShell::GetShellRes()->aCalc_Error);
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextCursor > aRef;
if(pStartNode || IsValid())
{
@@ -1087,13 +1006,11 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno::Reference< text::XTextRange > & xTextPosition)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextCursor > aRef;
SwUnoInternalPaM aPam(*GetDoc());
if ((pStartNode || IsValid())
@@ -1116,53 +1033,74 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCell::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(IsValid())
{
- const SfxItemPropertySimpleEntry* pEntry =
- m_pPropSet->getPropertyMap()->getByName(rPropertyName);
- if( !pEntry )
+ // Hack to support hidden property to transfer textDirection
+ if ( rPropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FRMDirection") ) ) )
{
- beans::UnknownPropertyException aEx;
- aEx.Message = rPropertyName;
- throw( aEx );
- }
- if( pEntry->nWID == FN_UNO_CELL_ROW_SPAN )
- {
- sal_Int32 nRowSpan = 0;
- if( aValue >>= nRowSpan )
- pBox->setRowSpan( nRowSpan );
+ SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
+ sal_Int16 nNum = 0;
+ aValue >>= nNum;
+ OSL_TRACE("FRMDirection val %d", nNum );
+ switch (nNum)
+ {
+ case 0:
+ eDir = FRMDIR_HORI_LEFT_TOP;
+ break;
+ case 1:
+ eDir = FRMDIR_HORI_RIGHT_TOP;
+ break;
+ case 2:
+ eDir = FRMDIR_VERT_TOP_RIGHT;
+ break;
+ default:
+ OSL_ENSURE( false, "unknown direction code, maybe its a bitfield");
+ }
+ SvxFrameDirectionItem aItem( eDir, RES_FRAMEDIR);
+ pBox->GetFrmFmt()->SetFmtAttr(aItem);
}
else
{
- SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
- SwAttrSet aSet(pBoxFmt->GetAttrSet());
- m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet);
- pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt);
+ const SfxItemPropertySimpleEntry* pEntry =
+ m_pPropSet->getPropertyMap()->getByName(rPropertyName);
+ if( !pEntry )
+ {
+ beans::UnknownPropertyException aEx;
+ aEx.Message = rPropertyName;
+ throw( aEx );
+ }
+ if( pEntry->nWID == FN_UNO_CELL_ROW_SPAN )
+ {
+ sal_Int32 nRowSpan = 0;
+ if( aValue >>= nRowSpan )
+ pBox->setRowSpan( nRowSpan );
+ }
+ else
+ {
+ SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt();
+ SwAttrSet aSet(pBoxFmt->GetAttrSet());
+ m_pPropSet->setPropertyValue(rPropertyName, aValue, aSet);
+ pBoxFmt->GetDoc()->SetAttr(aSet, *pBoxFmt);
+ }
}
}
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
if(IsValid())
{
@@ -1214,40 +1152,30 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< container::XEnumeration > aRef;
if(IsValid())
{
@@ -1273,31 +1201,23 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro
}
return aRef;
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXCell::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<text::XTextRange>*)0);
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXCell::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------12.06.98 07:54-------------------
- *
- * --------------------------------------------------*/
+
SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTable )
{
SwXCell* pRet = 0;
@@ -1330,7 +1250,8 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab
}
return pRet;
}
-/* -----------------12.06.98 07:37-------------------
+
+/* --------------------------------------------------
* exitstiert die Box in der angegebenen Tabelle?
* --------------------------------------------------*/
SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
@@ -1348,24 +1269,18 @@ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
nFndPos = USHRT_MAX;
return 0;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCell");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.CellProperties");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1377,23 +1292,16 @@ uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::Ru
/******************************************************************
* SwXTextTableRow
******************************************************************/
-/* -----------------------------19.04.00 15:20--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableRow");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableRow") == rServiceName;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1402,9 +1310,7 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw(
return aRet;
}
TYPEINIT1(SwXTextTableRow, SwClient);
-/*-- 11.12.98 12:04:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
SwClient(pFmt),
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)),
@@ -1412,29 +1318,23 @@ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
{
}
-/*-- 11.12.98 12:04:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::~SwXTextTableRow()
{
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableRow::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -1490,12 +1390,10 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
}
}
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -1539,44 +1437,32 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
}
return aRet;
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/*-- 11.12.98 12:04:50---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
{
SwTableLine* pRet = 0;
@@ -1593,21 +1479,16 @@ SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
/******************************************************************
* SwXTextTableCursor
******************************************************************/
-/* -----------------------------19.04.00 15:21--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableCursor");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableCursor") == rServiceName;
}
-// -----------------------------------------------------------------------------
+
IMPLEMENT_FORWARD_XINTERFACE2(SwXTextTableCursor,SwXTextTableCursor_Base,OTextCursorHelper)
const SwPaM* SwXTextTableCursor::GetPaM() const { return GetCrsr(); }
SwPaM* SwXTextTableCursor::GetPaM() { return GetCrsr(); }
@@ -1615,9 +1496,7 @@ const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrmFmt()->Ge
SwDoc* SwXTextTableCursor::GetDoc() { return GetFrmFmt()->GetDoc(); }
const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1626,9 +1505,6 @@ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) thr
return aRet;
}
-/*-- 11.12.98 12:16:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwClient(pFmt),
aCrsrDepend(this, 0),
@@ -1643,9 +1519,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* pTableSelection) :
SwClient(&rTableFmt),
aCrsrDepend(this, 0),
@@ -1666,22 +1540,18 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor*
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::~SwXTextTableCursor()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
delete pUnoCrsr;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
OUString aRet;
SwUnoCrsr* pUnoCrsr = GetCrsr();
@@ -1718,13 +1588,11 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
}
return aRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool Expand)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1736,12 +1604,10 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool E
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1752,12 +1618,10 @@ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1768,12 +1632,10 @@ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( un
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1784,12 +1646,10 @@ sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1800,12 +1660,10 @@ sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
@@ -1814,12 +1672,10 @@ void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException
pTblCrsr->MoveTable(fnTableCurr, fnTableStart);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
@@ -1828,12 +1684,10 @@ void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
pTblCrsr->MoveTable(fnTableCurr, fnTableEnd);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -1859,12 +1713,10 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (Count <= 0)
throw uno::RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( "Illegal first argument: needs to be > 0" ) ), static_cast < cppu::OWeakObject * > ( this ) );
sal_Bool bRet = sal_False;
@@ -1885,17 +1737,13 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) th
}
return bRet;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException,
@@ -1904,7 +1752,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
@@ -1961,13 +1809,11 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
@@ -2023,48 +1869,38 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
+
/******************************************************************
* SwXTextTable
******************************************************************/
/****************************************************************************
Tabellenbeschreibung
****************************************************************************/
-
class SwTableProperties_Impl
{
SwUnoCursorHelper::SwAnyMapHelper aAnyMap;
@@ -2078,36 +1914,24 @@ public:
void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc);
};
-/* -----------------22.06.98 09:43-------------------
- *
- * --------------------------------------------------*/
SwTableProperties_Impl::SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
SwTableProperties_Impl::~SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::SetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWhichId, nMemberId, rVal );
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwTableProperties_Impl::GetProperty(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const uno::Any*& rpAny )
{
return aAnyMap.FillValue( nWhichId, nMemberId, rpAny );
}
-/* -----------------13.01.99 15:42-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
{
SfxItemSet aSet(rDoc.GetAttrPool(),
@@ -2205,17 +2029,14 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
aSet.Put(aKeep);
}
- sal_Bool bFullAlign = sal_True;
const uno::Any* pHOrient;
if(GetProperty(RES_HORI_ORIENT, MID_HORIORIENT_ORIENT, pHOrient))
{
SwFmtHoriOrient aOrient ( rFrmFmt.GetHoriOrient() );
((SfxPoolItem&)aOrient).PutValue(*pHOrient, MID_HORIORIENT_ORIENT|CONVERT_TWIPS);
- bFullAlign = (aOrient.GetHoriOrient() == text::HoriOrientation::FULL);
aSet.Put(aOrient);
}
-
const uno::Any* pSzRel = 0;
GetProperty(FN_TABLE_IS_RELATIVE_WIDTH, 0xff, pSzRel );
const uno::Any* pRelWidth = 0;
@@ -2286,17 +2107,12 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() );
}
}
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2308,14 +2124,9 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 11.12.98 12:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXTextTable, SwClient)
-/*-- 11.12.98 12:42:43---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable() :
aLstnrCntnr( (text::XTextTable*)this),
aChartLstnrCntnr( (text::XTextTable*)this),
@@ -2329,9 +2140,7 @@ SwXTextTable::SwXTextTable() :
{
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (text::XTextTable*)this),
@@ -2346,16 +2155,12 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
{
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::~SwXTextTable()
{
delete pTableProps;
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeException )
{
if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX )
@@ -2366,12 +2171,10 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
nColumns = (sal_uInt16)nC;
}
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XTableRows > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
@@ -2385,12 +2188,10 @@ uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::Run
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XTableColumns > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
@@ -2404,12 +2205,10 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& CellName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCell > xRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2426,12 +2225,10 @@ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& Cell
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -2453,13 +2250,11 @@ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeEx
}
return uno::Sequence< OUString >();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(const OUString& CellName)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< text::XTextTableCursor > xRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2476,9 +2271,7 @@ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(c
throw uno::RuntimeException();
return xRet;
}
-/* -----------------18.02.99 13:36-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2571,34 +2364,28 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
else
throw lang::IllegalArgumentException();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
attachToRange( xTextRange );
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(!pFmt)
throw uno::RuntimeException();
uno::Reference< text::XTextRange > xRet = new SwXTextRange(*pFmt);
return xRet;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::dispose(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -2611,30 +2398,24 @@ void SwXTextTable::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCell > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
// Sheet interessiert nicht
@@ -2649,14 +2430,12 @@ uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColum
return aRef;
}
-/* -----------------11.12.98 13:26-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable,
const String& rTLName, const String& rBRName,
SwRangeDescriptor& rDesc)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCellRange > aRef;
String sTLName(rTLName);
String sBRName(rBRName);
@@ -2688,14 +2467,12 @@ uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt
}
return aRef;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop,
sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCellRange > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt && nRight < USHRT_MAX && nBottom < USHRT_MAX &&
@@ -2723,13 +2500,11 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_In
throw lang::IndexOutOfBoundsException();
return aRef;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUString& aRange)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCellRange > aRef;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -2760,15 +2535,13 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUSt
throw uno::RuntimeException();
return aRef;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw (uno::RuntimeException)
{
// see SwXTextTable::getData(...) also
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
if(!nRowCount || !nColCount)
@@ -2822,16 +2595,14 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextTable::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
{
// see SwXTextTable::setData(...) also
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
@@ -2892,13 +2663,11 @@ void SAL_CALL SwXTextTable::setDataArray(
}
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
if(!nRowCount || !nColCount)
@@ -2936,13 +2705,11 @@ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
sal_Bool bChanged = sal_False;
@@ -2986,12 +2753,10 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
aChartLstnrCntnr.ChartDataChanged();
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
if(!nRowCount)
{
@@ -3021,19 +2786,17 @@ uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::Run
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
else
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -3059,19 +2822,17 @@ void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
}
else
{
- DBG_ERROR("Wohin mit den Labels?");
+ OSL_FAIL("Wohin mit den Labels?");
}
}
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nColCount = getColumnCount();
if(!nColCount)
{
@@ -3101,19 +2862,17 @@ uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
else
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColumnDesc) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nColCount = getColumnCount();
if(!nColCount)
{
@@ -3141,15 +2900,13 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3158,9 +2915,7 @@ void SwXTextTable::addChartDataChangeEventListener(
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3168,41 +2923,33 @@ void SwXTextTable::removeChartDataChangeEventListener(
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:33-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextTable::isNotANumber(double nNumber) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return ( nNumber == DBL_MIN );
}
-/* -----------------08.03.99 15:34-------------------
- *
- * --------------------------------------------------*/
+
double SwXTextTable::getNotANumber(void) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return DBL_MIN;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSortOptions aSortOpt;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt &&
@@ -3220,12 +2967,10 @@ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor
pFmt->GetDoc()->SortTbl(aBoxes, aSortOpt);
}
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -3255,23 +3000,19 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:42:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(!aValue.hasValue())
throw lang::IllegalArgumentException();
@@ -3475,12 +3216,10 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFmt = GetFrmFmt();
const SfxItemPropertySimpleEntry* pEntry =
@@ -3690,40 +3429,30 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String sRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(!pFmt && !bIsDescriptor)
@@ -3736,18 +3465,16 @@ OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
sRet = m_sTableName;
return sRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
String sNewTblName(rName);
if((!pFmt && !bIsDescriptor) ||
- !sNewTblName.Len() ||
- STRING_NOTFOUND != sNewTblName.Search('.') ||
- STRING_NOTFOUND != sNewTblName.Search(' ') )
+ !sNewTblName.Len() ||
+ STRING_NOTFOUND != sNewTblName.Search('.') ||
+ STRING_NOTFOUND != sNewTblName.Search(' ') )
throw uno::RuntimeException();
if(pFmt)
@@ -3796,12 +3523,10 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
else
m_sTableName = sNewTblName;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getRowCount(void)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRet = 0;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -3814,12 +3539,10 @@ sal_uInt16 SwXTextTable::getRowCount(void)
}
return nRet;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getColumnCount(void)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
sal_Int16 nRet = 0;
if(pFmt)
@@ -3834,9 +3557,7 @@ sal_uInt16 SwXTextTable::getColumnCount(void)
}
return nRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT &&
@@ -3852,16 +3573,12 @@ void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
OUString SAL_CALL SwXTextTable::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTable");
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
@@ -3870,9 +3587,7 @@ sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno:
sServiceName.EqualsAscii("com.sun.star.text.TextContent") ||
sServiceName.EqualsAscii("com.sun.star.text.TextSortable"));
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(4);
@@ -3884,20 +3599,12 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un
return aRet;
}
-/******************************************************************
- *
- ******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -3909,20 +3616,14 @@ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/* -----------------28.04.98 10:29-------------------
- *
- * --------------------------------------------------*/
+
TYPEINIT1(SwXCellRange, SwClient);
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCellRange");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return
@@ -3934,9 +3635,7 @@ sal_Bool SwXCellRange::supportsService(const OUString& rServiceName) throw( uno:
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesAsian" ) ) ||
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesComplex" ) );
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(7);
@@ -3951,9 +3650,6 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un
return aRet;
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
SwRangeDescriptor& rDesc)
:
@@ -3968,21 +3664,17 @@ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
{
aRgDesc.Normalize();
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCellRange::~SwXCellRange()
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
delete pTblCrsr;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCell > aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -4000,14 +3692,12 @@ uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColum
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< table::XCellRange > aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt && getColumnCount() > nRight && getRowCount() > nBottom &&
@@ -4058,13 +3748,11 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUString& rRange)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
String sRange(rRange);
String sTLName(sRange.GetToken(0, ':'));
String sBRName(sRange.GetToken(1, ':'));
@@ -4078,23 +3766,19 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUSt
return getCellRangeByPosition(aDesc.nLeft - aRgDesc.nLeft, aDesc.nTop - aRgDesc.nTop,
aDesc.nRight - aRgDesc.nLeft, aDesc.nBottom - aRgDesc.nTop);
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCellRange::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue) throw( beans::UnknownPropertyException,
beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -4167,6 +3851,14 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
pDoc->SetBoxAttr( *pCrsr, aNumberFormat);
}
break;
+ case RES_VERT_ORIENT:
+ {
+ sal_Int16 nAlign = -1;
+ aValue >>= nAlign;
+ if( nAlign >= text::VertOrientation::NONE && nAlign <= text::VertOrientation::BOTTOM)
+ pDoc->SetBoxAlign( *pCrsr, nAlign );
+ }
+ break;
case FN_UNO_RANGE_ROW_LABEL:
{
sal_Bool bTmp = *(sal_Bool*)aValue.getValue();
@@ -4207,12 +3899,10 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -4246,6 +3936,15 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
rBoxItem.QueryValue(aRet, pEntry->nMemberId);
}
break;
+ case RES_VERT_ORIENT:
+ {
+ SwFmtVertOrient aVertOrient;
+ if( pTblCrsr->GetDoc()->GetBoxAttr( *pTblCrsr, aVertOrient ) )
+ {
+ aVertOrient.QueryValue( aRet, pEntry->nMemberId );
+ }
+ }
+ break;
case RES_BOXATR_FORMAT:
//GetAttr fuer Tabellenselektion am Doc fehlt noch
DBG_WARNING("not implemented");
@@ -4291,39 +3990,27 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
}
return aRet;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-----------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
void SwXCellRange::GetDataSequence(
uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used
uno::Sequence< OUString > *pTxtSeq, //-> as output sequence
@@ -4333,7 +4020,7 @@ void SwXCellRange::GetDataSequence(
// from 0 even if the cell is formatted to text
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// compare to SwXCellRange::getDataArray (note different return types though)
@@ -4356,7 +4043,7 @@ void SwXCellRange::GetDataSequence(
pDblSeq->realloc( nSize );
else
{
- DBG_ERROR( "argument missing" );
+ OSL_FAIL( "argument missing" );
return;
}
uno::Any *pAnyData = pAnySeq ? pAnySeq->getArray() : 0;
@@ -4453,7 +4140,7 @@ void SwXCellRange::GetDataSequence(
pDblData[nDtaCnt++] = fVal;
}
else {
- DBG_ERROR( "output sequence missing" );
+ OSL_FAIL( "output sequence missing" );
}
}
}
@@ -4468,16 +4155,13 @@ void SwXCellRange::GetDataSequence(
pDblSeq->realloc( nDtaCnt );
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
throw (uno::RuntimeException)
{
// see SwXCellRange::getData also
// also see SwXCellRange::GetDataSequence
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
//
@@ -4532,16 +4216,14 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
}
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
{
// see SwXCellRange::setData also
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
if(!nRowCount || !nColCount)
@@ -4600,12 +4282,10 @@ void SAL_CALL SwXCellRange::setDataArray(
}
}
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
//
@@ -4641,13 +4321,11 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
}
return aRowSeq;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
sal_Int16 nColCount = getColumnCount();
if(!nRowCount || !nColCount)
@@ -4686,13 +4364,11 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nRowCount = getRowCount();
if(!nRowCount)
{
@@ -4721,20 +4397,18 @@ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
else
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
@@ -4760,17 +4434,15 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
}
else
{
- DBG_ERROR("Wohin mit den Labels?");
+ OSL_FAIL("Wohin mit den Labels?");
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nColCount = getColumnCount();
if(!nColCount)
{
@@ -4799,20 +4471,18 @@ uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
else
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& ColumnDesc)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int16 nColCount = getColumnCount();
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
@@ -4835,60 +4505,48 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column
}
else
{
- DBG_ERROR("Wo kommen die Labels her?");
+ OSL_FAIL("Wo kommen die Labels her?");
}
}
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return sal_False;
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return 0.;
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXCellRange::createSortDescriptor(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwSortOptions aSortOpt;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt &&
@@ -4900,23 +4558,17 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD
pFmt->GetDoc()->SortTbl(pTableCrsr->GetBoxes(), aSortOpt);
}
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getColumnCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nRight - aRgDesc.nLeft + 1);
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getRowCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nBottom - aRgDesc.nTop + 1);
}
-/* -----------------------------05.06.01 09:19--------------------------------
- ---------------------------------------------------------------------------*/
const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
{
const SwUnoCrsr* pRet = 0;
@@ -4926,9 +4578,6 @@ const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
return pRet;
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
@@ -4946,26 +4595,20 @@ void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
+
/******************************************************************
* SwXTableRows
******************************************************************/
-/* -----------------------------19.04.00 15:22--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableRows");
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableRows") == rServiceName;
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -4974,24 +4617,19 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( un
return aRet;
}
TYPEINIT1(SwXTableRows, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableRows::SwXTableRows(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableRows::~SwXTableRows()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nRet = 0;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt)
@@ -5003,13 +4641,11 @@ sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Any aRet;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt || nIndex < 0 )
@@ -5042,31 +4678,25 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
}
return aRet;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableRows::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt)
throw uno::RuntimeException();
//es gibt keine Tabelle ohne Zeilen
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (nCount == 0)
return;
SwFrmFmt* pFrmFmt = GetFrmFmt();
@@ -5117,12 +4747,10 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (nCount == 0)
return;
SwFrmFmt* pFrmFmt = GetFrmFmt();
@@ -5179,9 +4807,7 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -5190,23 +4816,16 @@ void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
/******************************************************************
* SwXTableColumns
******************************************************************/
-/* -----------------------------19.04.00 15:23--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableColumns");
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableColumns") == rServiceName;
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -5214,25 +4833,21 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw(
pArray[0] = C2U("com.sun.star.text.TableColumns");
return aRet;
}
+
TYPEINIT1(SwXTableColumns, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableColumns::SwXTableColumns(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableColumns::~SwXTableColumns()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
sal_Int32 nRet = 0;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt)
@@ -5249,13 +4864,11 @@ sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< uno::XInterface > xRet;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt)
@@ -5276,31 +4889,24 @@ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
}
return uno::Any(&xRet, ::getCppuType((const uno::Reference<uno::XInterface>*)0));
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableColumns::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((uno::Reference<uno::XInterface>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt* pFrmFmt = GetFrmFmt();
if(!pFrmFmt)
throw uno::RuntimeException();
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (nCount == 0)
return;
SwFrmFmt* pFrmFmt = GetFrmFmt();
@@ -5350,12 +4956,10 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (nCount == 0)
return;
SwFrmFmt* pFrmFmt = GetFrmFmt();
@@ -5412,16 +5016,12 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------------------22.09.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
void SwChartEventListenerContainer::ChartDataChanged()
{
if(pListenerArr)
@@ -5451,5 +5051,4 @@ void SwChartEventListenerContainer::ChartDataChanged()
}
}
-///////////////////////////////////////////////////////////////////////////
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 875d0e23235d..429d73145b9a 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,7 @@
#include <rtl/uuid.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
@@ -86,7 +87,6 @@ const sal_Char cInvalidObject[] = "this object is invalid";
/******************************************************************
* SwXText
******************************************************************/
-
class SwXText::Impl
{
@@ -132,24 +132,15 @@ public:
};
-/* -----------------------------15.03.2002 12:39------------------------------
-
- ---------------------------------------------------------------------------*/
SwXText::SwXText(SwDoc *const pDoc, const enum CursorType eType)
: m_pImpl( new SwXText::Impl(*this, pDoc, eType) )
{
}
-/*-- 09.12.98 12:43:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXText::~SwXText()
{
}
-/*-- 09.12.98 12:44:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
const SwDoc * SwXText::GetDoc() const
{
return m_pImpl->m_pDoc;
@@ -185,7 +176,7 @@ SwXText::PrepareForAttach(uno::Reference< text::XTextRange > &, const SwPaM &)
bool SwXText::CheckForOwnMemberMeta(const SwPaM &, const bool)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- ASSERT(CURSOR_META != m_pImpl->m_eType, "should not be called!");
+ OSL_ENSURE(CURSOR_META != m_pImpl->m_eType, "should not be called!");
return false;
}
@@ -209,9 +200,6 @@ SwXText::CreateCursor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 09.12.98 12:43:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXText::queryInterface(const uno::Type& rType) throw (uno::RuntimeException)
{
@@ -282,9 +270,7 @@ SwXText::queryInterface(const uno::Type& rType) throw (uno::RuntimeException)
}
return aRet;
}
-/* -----------------------------15.03.00 17:42--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXText::getTypes() throw (uno::RuntimeException)
{
@@ -312,7 +298,7 @@ SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange,
const OUString& rString, sal_Bool bAbsorb)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xTextRange.is())
{
@@ -411,16 +397,13 @@ throw (uno::RuntimeException)
}
}
-/*-- 09.12.98 12:43:16---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::insertControlCharacter(
const uno::Reference< text::XTextRange > & xTextRange,
sal_Int16 nControlCharacter, sal_Bool bAbsorb)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xTextRange.is())
{
@@ -527,9 +510,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
-/*-- 09.12.98 12:43:17---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::insertTextContent(
const uno::Reference< text::XTextRange > & xRange,
@@ -537,7 +517,7 @@ SwXText::insertTextContent(
sal_Bool bAbsorb)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xRange.is())
{
@@ -644,16 +624,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
xContent->attach(xTempRange);
}
-/* -----------------------------10.07.00 15:40--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL
SwXText::insertTextContentBefore(
const uno::Reference< text::XTextContent>& xNewContent,
const uno::Reference< text::XTextContent>& xSuccessor)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
{
@@ -708,16 +685,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pPara->attachToText(*this, *pTxtNode);
}
-/* -----------------------------10.07.00 15:40--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL
SwXText::insertTextContentAfter(
const uno::Reference< text::XTextContent>& xNewContent,
const uno::Reference< text::XTextContent>& xPredecessor)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
{
@@ -769,15 +743,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
pPara->attachToText(*this, *pTxtNode);
}
-/* -----------------------------10.07.00 15:40--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL
SwXText::removeTextContentBefore(
const uno::Reference< text::XTextContent>& xSuccessor)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
{
@@ -825,15 +796,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
-/* -----------------------------10.07.00 15:40--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL
SwXText::removeTextContentAfter(
const uno::Reference< text::XTextContent>& xPredecessor)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!GetDoc())
{
@@ -882,9 +850,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
}
-/*-- 09.12.98 12:43:19---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::removeTextContent(
const uno::Reference< text::XTextContent > & xContent)
@@ -900,25 +865,19 @@ throw (container::NoSuchElementException, uno::RuntimeException)
xContent->dispose();
}
-/*-- 09.12.98 12:43:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SAL_CALL
SwXText::getText() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Reference< text::XText > xRet(this);
return xRet;
}
-/*-- 09.12.98 12:43:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXText::getStart() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Reference< text::XTextCursor > xRef = CreateCursor();
if(!xRef.is())
@@ -931,13 +890,11 @@ SwXText::getStart() throw (uno::RuntimeException)
const uno::Reference< text::XTextRange > xRet(xRef, uno::UNO_QUERY);
return xRet;
}
-/*-- 09.12.98 12:43:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXText::getEnd() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Reference< text::XTextCursor > xRef = CreateCursor();
if(!xRef.is())
@@ -951,12 +908,9 @@ SwXText::getEnd() throw (uno::RuntimeException)
return xRet;
}
-/*-- 09.12.98 12:43:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SAL_CALL SwXText::getString() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Reference< text::XTextCursor > xRet = CreateCursor();
if(!xRet.is())
@@ -968,13 +922,11 @@ OUString SAL_CALL SwXText::getString() throw (uno::RuntimeException)
xRet->gotoEnd(sal_True);
return xRet->getString();
}
-/*-- 09.12.98 12:43:30---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!GetDoc())
{
@@ -1126,16 +1078,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return nCompare;
}
-/*-- 28.03.00 10:37:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int16 SAL_CALL
SwXText::compareRegionStarts(
const uno::Reference<text::XTextRange>& xRange1,
const uno::Reference<text::XTextRange>& xRange2)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xRange1.is() || !xRange2.is())
{
@@ -1146,16 +1095,14 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return m_pImpl->ComparePositions(xStart1, xStart2);
}
-/*-- 28.03.00 10:37:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SAL_CALL
SwXText::compareRegionEnds(
const uno::Reference<text::XTextRange>& xRange1,
const uno::Reference<text::XTextRange>& xRange2)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!xRange1.is() || !xRange2.is())
{
@@ -1167,22 +1114,16 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
return m_pImpl->ComparePositions(xEnd1, xEnd2);
}
-/*-- 15.03.2002 12:30:40---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SAL_CALL
SwXText::getPropertySetInfo() throw(uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
static uno::Reference< beans::XPropertySetInfo > xInfo =
m_pImpl->m_rPropSet.getPropertySetInfo();
return xInfo;
}
-/*-- 15.03.2002 12:30:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::setPropertyValue(const ::rtl::OUString& /*aPropertyName*/,
const uno::Any& /*aValue*/)
@@ -1192,16 +1133,14 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
{
throw lang::IllegalArgumentException();
}
-/*-- 15.03.2002 12:30:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXText::getPropertyValue(
const ::rtl::OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
{
@@ -1251,9 +1190,6 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
return aRet;
}
-/*-- 15.03.2002 12:30:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::addPropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1264,9 +1200,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXText::addPropertyChangeListener(): not implemented");
}
-/*-- 15.03.2002 12:30:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::removePropertyChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1277,9 +1211,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXText::removePropertyChangeListener(): not implemented");
}
-/*-- 15.03.2002 12:30:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::addVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1290,9 +1222,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_ENSURE(false,
"SwXText::addVetoableChangeListener(): not implemented");
}
-/*-- 15.03.2002 12:30:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL
SwXText::removeVetoableChangeListener(
const ::rtl::OUString& /*rPropertyName*/,
@@ -1304,17 +1234,12 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
"SwXText::removeVetoableChangeListener(): not implemented");
}
-/* -----------------------------08.01.01 09:07--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXText::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------08.01.01 09:07--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXText::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1322,34 +1247,26 @@ throw (uno::RuntimeException)
return ::sw::UnoTunnelImpl<SwXText>(rId, this);
}
-/*-- 23.06.2006 08:56:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXText::appendParagraph(
const uno::Sequence< beans::PropertyValue > & rProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->finishOrAppendParagraph(false, rProperties);
}
-/*-- 23.06.2006 08:56:22---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SAL_CALL
SwXText::finishParagraph(
const uno::Sequence< beans::PropertyValue > & rProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
return m_pImpl->finishOrAppendParagraph(true, rProperties);
}
-/*-- 08.05.2006 13:26:26---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange >
SwXText::Impl::finishOrAppendParagraph(
const bool bFinish,
@@ -1462,7 +1379,7 @@ SwXText::appendTextPortion(
rCharacterAndParagraphProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
{
@@ -1567,7 +1484,7 @@ SwXText::appendTextContent(
rCharacterAndParagraphProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!IsValid())
{
@@ -1628,7 +1545,7 @@ SwXText::convertToTextFrame(
const uno::Sequence< beans::PropertyValue >& rFrameProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
{
@@ -1733,11 +1650,20 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
SfxItemSet aFrameItemSet(m_pImpl->m_pDoc->GetAttrPool(),
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
0 );
-
+ // If there is no content in the frame the shape is in
+ // it gets deleted in the DelFullPara call below,
+ // In this case insert a tmp text node ( we delete it later )
+ if ( aStartPam.Start()->nNode == pEndPam->Start()->nNode
+ && aStartPam.End()->nNode == pEndPam->End()->nNode )
+ {
+ SwPosition aEnd(*aStartPam.End());
+ bParaAfterInserted = GetDoc()->AppendTxtNode( aEnd );
+ pEndPam->DeleteMark();
+ *pEndPam->GetPoint() = aEnd;
+ }
aStartPam.SetMark();
*aStartPam.End() = *pEndPam->End();
pEndPam.reset(0);
-
SwXTextFrame *const pNewFrame = new SwXTextFrame(m_pImpl->m_pDoc);
const uno::Reference< text::XTextFrame > xNewFrame = pNewFrame;
pNewFrame->SetSelection( aStartPam );
@@ -1835,7 +1761,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
/*-- 11.05.2006 15:46:26---------------------------------------------------
Move previously imported paragraphs into a new text table.
-
-----------------------------------------------------------------------*/
struct VerticallyMergedCell
{
@@ -1851,7 +1776,9 @@ struct VerticallyMergedCell
aCells.push_back( rxCell );
}
};
+
#define COL_POS_FUZZY 2
+
static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 )
{
return abs( nPos1 - nPos2 ) < COL_POS_FUZZY;
@@ -1861,10 +1788,7 @@ void SwXText::copyText(
const uno::Reference< text::XTextCopy >& xSource )
throw ( uno::RuntimeException )
{
- uno::Reference< lang::XUnoTunnel > xTTunnel( xSource, uno::UNO_QUERY_THROW );
- SwXText* pText = 0;
- pText = reinterpret_cast< SwXText* >(
- sal::static_int_cast< sal_IntPtr >( xTTunnel->getSomething( SwXText::getUnoTunnelId()) ));
+ SolarMutexGuard aGuard;
uno::Reference< text::XText > xText( xSource, uno::UNO_QUERY_THROW );
uno::Reference< text::XTextCursor > xCursor = xText->createTextCursor( );
@@ -2110,7 +2034,6 @@ lcl_DebugCellProperties(
//--<
#endif
-
static void
lcl_ApplyCellProperties(
const sal_Int32 nCell,
@@ -2125,7 +2048,7 @@ lcl_ApplyCellProperties(
{
const OUString & rName = rCellProperties[nProperty].Name;
const uno::Any & rValue = rCellProperties[nProperty].Value;
- if (rName.equalsAscii("VerticalMerge"))
+ if (rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("VerticalMerge")))
{
// determine left border position
// add the cell to a queue of merged cells
@@ -2238,7 +2161,7 @@ lcl_MergeCells(::std::vector<VerticallyMergedCell> & rMergedCells)
while (aCellIter != aMergedIter->aCells.end())
{
(*aCellIter)->setPropertyValue(
- C2U(SW_PROP_NAME_STR(UNO_NAME_ROW_SPAN)),
+ rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ROW_SPAN)),
uno::makeAny(nCellCount));
if (bFirstCell)
{
@@ -2264,7 +2187,7 @@ SwXText::convertToTable(
const uno::Sequence< beans::PropertyValue >& rTableProperties)
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
{
@@ -2395,30 +2318,23 @@ SwXBodyText::SwXBodyText(SwDoc *const pDoc)
{
}
-/*-- 10.12.98 11:17:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXBodyText::~SwXBodyText()
{
-
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXBodyText::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXBodyText");
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesBodyText[] =
{
"com.sun.star.text.Text",
};
+
static const size_t g_nServicesBodyText(
- sizeof(g_ServicesBodyText)/sizeof(g_ServicesBodyText[0]));
+ SAL_N_ELEMENTS(g_ServicesBodyText));
sal_Bool SAL_CALL SwXBodyText::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -2434,9 +2350,6 @@ SwXBodyText::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesBodyText, g_ServicesBodyText);
}
-/*-- 10.12.98 11:17:27---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXBodyText::queryAggregation(const uno::Type& rType)
throw (uno::RuntimeException)
@@ -2465,9 +2378,6 @@ throw (uno::RuntimeException)
return aRet;
}
-/*-- 10.12.98 11:17:28---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXBodyText::getTypes() throw (uno::RuntimeException)
{
@@ -2475,13 +2385,11 @@ SwXBodyText::getTypes() throw (uno::RuntimeException)
const uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes();
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
-/* -----------------------------21.03.00 15:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL
SwXBodyText::getImplementationId() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -2491,9 +2399,7 @@ SwXBodyText::getImplementationId() throw (uno::RuntimeException)
}
return aId;
}
-/*-- 10.12.98 11:17:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXBodyText::queryInterface(const uno::Type& rType)
throw (uno::RuntimeException)
@@ -2503,9 +2409,7 @@ throw (uno::RuntimeException)
? SwXBodyText_Base::queryInterface(rType)
: ret;
}
-/* -----------------------------05.01.00 11:07--------------------------------
- ---------------------------------------------------------------------------*/
SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables)
{
if(!IsValid())
@@ -2534,13 +2438,10 @@ SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables)
return new SwXTextCursor(*GetDoc(), this, CURSOR_BODY, *aPam.GetPoint());
}
-/*-- 10.12.98 11:17:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXBodyText::createTextCursor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
const uno::Reference< text::XTextCursor > xRef(
static_cast<text::XWordCursor*>(CreateTextCursor(false)) );
@@ -2552,15 +2453,13 @@ SwXBodyText::createTextCursor() throw (uno::RuntimeException)
}
return xRef;
}
-/*-- 10.12.98 11:17:29---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXBodyText::createTextCursorByRange(
const uno::Reference< text::XTextRange > & xTextPosition)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if(!IsValid())
{
@@ -2597,14 +2496,11 @@ throw (uno::RuntimeException)
return aRef;
}
-/*-- 10.12.98 11:17:30---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXBodyText::createEnumeration()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!IsValid())
{
@@ -2623,21 +2519,16 @@ throw (uno::RuntimeException)
return xRet;
}
-/* -----------------18.12.98 13:36-------------------
- *
- * --------------------------------------------------*/
uno::Type SAL_CALL
SwXBodyText::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/* -----------------18.12.98 13:36-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SAL_CALL
SwXBodyText::hasElements() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
if (!IsValid())
{
@@ -2652,7 +2543,6 @@ SwXBodyText::hasElements() throw (uno::RuntimeException)
/******************************************************************
* SwXHeadFootText
******************************************************************/
-
class SwXHeadFootText::Impl
: public SwClient
{
@@ -2687,9 +2577,6 @@ public:
};
-/*-- 11.12.98 10:14:51---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXHeadFootText::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -2718,9 +2605,6 @@ SwXHeadFootText::CreateXHeadFootText(
return xText;
}
-/*-- 11.12.98 10:14:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXHeadFootText::SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader)
: SwXText(rHeadFootFmt.GetDoc(),
(bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER)
@@ -2728,31 +2612,22 @@ SwXHeadFootText::SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader)
{
}
-/*-- 11.12.98 10:14:48---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXHeadFootText::~SwXHeadFootText()
{
}
-/* -----------------------------06.04.00 16:40--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXHeadFootText::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXHeadFootText");
}
-/* -----------------------------06.04.00 16:40--------------------------------
-
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesHeadFootText[] =
{
"com.sun.star.text.Text",
};
-static const size_t g_nServicesHeadFootText(
- sizeof(g_ServicesHeadFootText)/sizeof(g_ServicesHeadFootText[0]));
+
+static const size_t g_nServicesHeadFootText(SAL_N_ELEMENTS(g_ServicesHeadFootText));
sal_Bool SAL_CALL SwXHeadFootText::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException)
@@ -2768,9 +2643,6 @@ SwXHeadFootText::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesHeadFootText, g_ServicesHeadFootText);
}
-/*-- 11.12.98 10:14:49---------------------------------------------------
-
- -----------------------------------------------------------------------*/
const SwStartNode *SwXHeadFootText::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -2791,9 +2663,7 @@ SwXHeadFootText::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/* -----------------------------21.03.00 15:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXHeadFootText::getTypes() throw (uno::RuntimeException)
{
@@ -2802,13 +2672,10 @@ SwXHeadFootText::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
-/* -----------------------------21.03.00 15:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL
SwXHeadFootText::getImplementationId() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
static uno::Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
@@ -2818,9 +2685,7 @@ SwXHeadFootText::getImplementationId() throw (uno::RuntimeException)
}
return aId;
}
-/* -----------------------------21.03.00 15:46--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL
SwXHeadFootText::queryInterface(const uno::Type& rType)
throw (uno::RuntimeException)
@@ -2831,13 +2696,10 @@ throw (uno::RuntimeException)
: ret;
}
-/*-- 11.12.98 10:14:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXHeadFootText::createTextCursor() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() );
@@ -2880,15 +2742,12 @@ SwXHeadFootText::createTextCursor() throw (uno::RuntimeException)
return xRet;
}
-/*-- 11.12.98 10:14:50---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SAL_CALL
SwXHeadFootText::createTextCursorByRange(
const uno::Reference< text::XTextRange > & xTextPosition)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() );
@@ -2919,14 +2778,11 @@ throw (uno::RuntimeException)
return xRet;
}
-/* -----------------19.03.99 15:44-------------------
- *
- * --------------------------------------------------*/
uno::Reference< container::XEnumeration > SAL_CALL
SwXHeadFootText::createEnumeration()
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() );
@@ -2943,19 +2799,15 @@ throw (uno::RuntimeException)
return aRef;
}
-/* -----------------19.03.99 15:50-------------------
- *
- * --------------------------------------------------*/
uno::Type SAL_CALL
SwXHeadFootText::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/* -----------------19.03.99 15:50-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SAL_CALL SwXHeadFootText::hasElements() throw (uno::RuntimeException)
{
return sal_True;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index 3181d7aadb66..c41db578dd15 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <unotextmarkup.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <SwSmartTagMgr.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
@@ -58,7 +59,7 @@ SwXTextMarkup::~SwXTextMarkup()
uno::Reference< container::XStringKeyMap > SAL_CALL SwXTextMarkup::getMarkupInfoContainer() throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
uno::Reference< container::XStringKeyMap > xProp = new SwXStringKeyMap;
return xProp;
@@ -72,7 +73,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
throw (uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// paragraph already dead or modified?
if ( !mpTxtNode || nLength <= 0 )
@@ -100,7 +101,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
if( pGrammarContact )
{
pWList = pGrammarContact->getGrammarCheck( *mpTxtNode, true );
- ASSERT( pWList, "GrammarContact _has_ to deliver a wrong list" )
+ OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
}
else
{
@@ -126,7 +127,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup(
}
else
{
- ASSERT( false, "Unknown mark-up type" )
+ OSL_ENSURE( false, "Unknown mark-up type" );
return;
}
@@ -240,7 +241,7 @@ void lcl_commitGrammarMarkUp(
::sal_Int32 nLength,
const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
{
- ASSERT( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE, "Wrong mark-up type" )
+ OSL_ENSURE( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE, "Wrong mark-up type" );
const ModelToViewHelper::ModelPosition aStartPos =
ModelToViewHelper::ConvertToModelPosition( pConversionMap, nStart );
const ModelToViewHelper::ModelPosition aEndPos =
@@ -331,7 +332,7 @@ void SAL_CALL SwXTextMarkup::commitMultiTextMarkup(
const uno::Sequence< text::TextMarkupDescriptor > &rMarkups )
throw (lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
// paragraph already dead or modified?
if ( !mpTxtNode )
@@ -372,7 +373,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
if( pGrammarContact )
{
pWList = pGrammarContact->getGrammarCheck( *mpTxtNode, true );
- ASSERT( pWList, "GrammarContact _has_ to deliver a wrong list" )
+ OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
}
else
{
@@ -429,7 +430,7 @@ void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ )
pRegisteredIn->Remove( this );
// <--
- vos::OGuard aGuard(Application::GetSolarMutex());
+ SolarMutexGuard aGuard;
mpTxtNode = 0;
}
@@ -484,3 +485,4 @@ uno::Any SAL_CALL SwXStringKeyMap::getValueByIndex(::sal_Int32 nIndex) throw (un
return uno::Any();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index cd652d0e3428..d5c8b49ff77a 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <pagepreviewlayout.hxx>
-#ifndef _PREVWPAGE_HXX
#include <prevwpage.hxx>
-#endif
#include <algorithm>
#include <vcl/window.hxx>
@@ -40,18 +39,14 @@
#include <viewimp.hxx>
#include <viewopt.hxx>
#include <swregion.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-// OD 19.02.2003 #107369# - method <SwAlignRect(..)>
#include <frmtool.hxx>
-// OD 24.09.2003 #i19975#
#include <svx/zoomitem.hxx>
#include <printdata.hxx>
#include <IDocumentDeviceAccess.hxx>
-// OD 20.02.2003 #107369# - method to update statics for paint
+// method to update statics for paint
// Note: method defined in '/sw/source/core/layout/paintfrm.cxx'
extern void SwCalcPixStatics( OutputDevice *pOut );
@@ -67,7 +62,6 @@ SwPagePreviewLayout::SwPagePreviewLayout( ViewShell& _rParentViewShell,
{
_Clear();
- // OD 2004-03-05 #i18143#
mbBookPreview = false;
mbBookPreviewModeToggled = false;
@@ -103,7 +97,6 @@ void SwPagePreviewLayout::_Clear()
mnSelectedPageNum = 0;
_ClearPrevwPageData();
- // OD 07.11.2003 #i22014#
mbInPaint = false;
mbNewLayoutDuringPaint = false;
}
@@ -131,12 +124,6 @@ void SwPagePreviewLayout::_ClearPrevwPageData()
maPrevwPages.clear();
}
-/** calculate page preview layout sizes
-
- OD 18.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
{
// calculate maximal page size; calculate also number of pages
@@ -175,7 +162,6 @@ void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
// document height
// determine number of rows needed for <nPages> in preview layout
- // OD 19.02.2003 #107369# - use method <GetRowOfPage(..)>.
sal_uInt16 nDocRows = GetRowOfPage( mnPages );
aDocSize.Height() = nDocRows * maMaxPageSize.Height() +
(nDocRows+1) * mnYFree;
@@ -186,14 +172,12 @@ void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
/** init page preview layout
- OD 11.12.2002 #103492#
initialize the page preview settings for a given layout.
side effects:
(1) If parameter <_bCalcScale> is true, mapping mode with calculated
scaling is set at the output device and the zoom at the view options of
the given view shell is set with the calculated scaling.
- @author OD
*/
bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
const sal_uInt16 _nRows,
@@ -204,13 +188,13 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
// check environment and parameters
{
bool bColsRowsValid = (_nCols != 0) && (_nRows != 0);
- ASSERT( bColsRowsValid, "preview layout parameters not correct - preview layout can *not* be initialized" );
+ OSL_ENSURE( bColsRowsValid, "preview layout parameters not correct - preview layout can *not* be initialized" );
if ( !bColsRowsValid )
return false;
bool bPxWinSizeValid = (_rPxWinSize.Width() >= 0) &&
(_rPxWinSize.Height() >= 0);
- ASSERT( bPxWinSizeValid, "no window size - preview layout can *not* be initialized" );
+ OSL_ENSURE( bPxWinSizeValid, "no window size - preview layout can *not* be initialized" );
if ( !bPxWinSizeValid )
return false;
}
@@ -252,7 +236,6 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
aMapMode.SetScaleX( aYScale );
// set created mapping mode with calculated scaling at output device.
mrParentViewShell.GetOut()->SetMapMode( aMapMode );
- // OD 20.02.2003 #107369# - update statics for paint.
::SwCalcPixStatics( mrParentViewShell.GetOut() );
}
@@ -264,37 +247,25 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
return true;
}
-/** apply new zoom at given view shell
-
- OD 11.12.2002 #103492# - implementation of <_ApplyNewZoomAtViewShell>
-
- @author OD
-*/
void SwPagePreviewLayout::_ApplyNewZoomAtViewShell( sal_uInt8 _aNewZoom )
{
SwViewOption aNewViewOptions = *(mrParentViewShell.GetViewOptions());
if ( aNewViewOptions.GetZoom() != _aNewZoom )
{
aNewViewOptions.SetZoom( _aNewZoom );
- // OD 24.09.2003 #i19975# - consider zoom type.
+ //#i19975# - consider zoom type.
enum SvxZoomType eZoomType = SVX_ZOOM_PERCENT;
aNewViewOptions.SetZoomType( eZoomType );
mrParentViewShell.ApplyViewOptions( aNewViewOptions );
}
}
-/** method to adjust page preview layout to document changes
-
- OD 18.12.2002 #103492#
-
- @author OD
-*/
bool SwPagePreviewLayout::ReInit()
{
// check environment and parameters
{
bool bLayoutSettingsValid = mbLayoutInfoValid && mbLayoutSizesValid;
- ASSERT( bLayoutSettingsValid,
+ OSL_ENSURE( bLayoutSettingsValid,
"no valid preview layout info/sizes - no re-init of page preview layout");
if ( !bLayoutSettingsValid )
return false;
@@ -309,13 +280,8 @@ bool SwPagePreviewLayout::ReInit()
// =============================================================================
// methods to prepare paint of page preview
// =============================================================================
-/** prepare paint of page preview
-
- OD 12.12.2002 #103492#
- OD 21.03.2003 #108282# - delete parameter _onStartPageVirtNum
- @author OD, _nProposedStartPageNum, _onStartPageNum are absolute
-*/
+// _nProposedStartPageNum, _onStartPageNum are absolute
bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
const Point _aProposedStartPos,
const Size& _rPxWinSize,
@@ -328,13 +294,13 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
// check environment and parameters
{
bool bLayoutSettingsValid = mbLayoutInfoValid && mbLayoutSizesValid;
- ASSERT( bLayoutSettingsValid,
+ OSL_ENSURE( bLayoutSettingsValid,
"no valid preview layout info/sizes - no prepare of preview paint");
if ( !bLayoutSettingsValid )
return false;
bool bStartPageRangeValid = nProposedStartPageNum <= mnPages;
- ASSERT( bStartPageRangeValid,
+ OSL_ENSURE( bStartPageRangeValid,
"proposed start page not existing - no prepare of preview paint");
if ( !bStartPageRangeValid )
return false;
@@ -343,13 +309,13 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
_aProposedStartPos.X() >= 0 && _aProposedStartPos.Y() >= 0 &&
_aProposedStartPos.X() <= maPreviewDocRect.Right() &&
_aProposedStartPos.Y() <= maPreviewDocRect.Bottom();
- ASSERT( bStartPosRangeValid,
+ OSL_ENSURE( bStartPosRangeValid,
"proposed start position out of range - no prepare of preview paint");
if ( !bStartPosRangeValid )
return false;
bool bWinSizeValid = _rPxWinSize.Width() != 0 && _rPxWinSize.Height() != 0;
- ASSERT ( bWinSizeValid, "no window size - no prepare of preview paint");
+ OSL_ENSURE( bWinSizeValid, "no window size - no prepare of preview paint");
if ( !bWinSizeValid )
return false;
@@ -373,8 +339,7 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
// determine start page
if ( _bStartWithPageAtFirstCol )
{
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is
- // controlled by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
if ( mbBookPreview &&
( nProposedStartPageNum == 1 || nRowOfProposed == 1 )
)
@@ -413,16 +378,14 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
sal_uInt16 nRowOfProposed =
static_cast<sal_uInt16>(_aProposedStartPos.Y() / mnRowHeight) + 1;
// determine start page == page at proposed start position
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is
- // controlled by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
if ( mbBookPreview &&
( nRowOfProposed == 1 && nColOfProposed == 1 )
)
mnPaintPhyStartPageNum = 1;
else
{
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is
- // controlled by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
mnPaintPhyStartPageNum = (nRowOfProposed-1) * mnCols + nColOfProposed;
if ( mbBookPreview )
--mnPaintPhyStartPageNum;
@@ -453,8 +416,7 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
_CalcDocPrevwPaintRect();
_orDocPreviewPaintRect = maPaintedPrevwDocRect;
- // OD 20.01.2003 #103492# - shift visible preview document area to the left,
- // if on the right is an area left blank.
+ // shift visible preview document area to the left,if on the right is an area left blank.
if ( !mbDoesLayoutColsFitIntoWindow &&
maPaintedPrevwDocRect.GetWidth() < maWinSize.Width() )
{
@@ -464,9 +426,7 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
_rPxWinSize, _onStartPageNum,
_orDocPreviewPaintRect, _bStartWithPageAtFirstCol );
}
-
- // OD 20.01.2003 #103492# - shift visible preview document area to the top,
- // if on the botton is an area left blank.
+ // shift visible preview document area to the left,if on the right is an area left blank.
if ( mbBookPreviewModeToggled &&
maPaintedPrevwDocRect.Bottom() == maPreviewDocRect.Bottom() &&
maPaintedPrevwDocRect.GetHeight() < maWinSize.Height() )
@@ -496,7 +456,7 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
// accessible pages with needed data.
_CalcPreviewPages();
- // OD 07.11.2003 #i22014# - indicate new layout, if print preview is in paint
+ // indicate new layout, if print preview is in paint
if ( mbInPaint )
{
mbNewLayoutDuringPaint = true;
@@ -511,12 +471,6 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
return true;
}
-/** calculate additional paint offset
-
- OD 12.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::_CalcAdditionalPaintOffset()
{
if ( mnPrevwLayoutWidth <= maWinSize.Width() &&
@@ -544,12 +498,6 @@ void SwPagePreviewLayout::_CalcAdditionalPaintOffset()
}
}
-/** calculate painted preview document rectangle
-
- OD 12.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
{
Point aTopLeftPos = maPaintPreviewDocOffset;
@@ -557,14 +505,12 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
Size aSize;
if ( mbDoesLayoutColsFitIntoWindow )
- //aSize.Width() = mnPrevwLayoutWidth;
aSize.Width() = Min( mnPrevwLayoutWidth,
maPreviewDocRect.GetWidth() - aTopLeftPos.X() );
else
aSize.Width() = Min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(),
maWinSize.Width() - maAdditionalPaintOffset.X() );
if ( mbDoesLayoutRowsFitIntoWindow )
- //aSize.Height() = mnPrevwLayoutHeight;
aSize.Height() = Min( mnPrevwLayoutHeight,
maPreviewDocRect.GetHeight() - aTopLeftPos.Y() );
else
@@ -573,12 +519,6 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
maPaintedPrevwDocRect.SetSize( aSize );
}
-/** calculate preview pages
-
- OD 12.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::_CalcPreviewPages()
{
_ClearPrevwPageData();
@@ -633,8 +573,7 @@ void SwPagePreviewLayout::_CalcPreviewPages()
}
if ( aCurrPaintOffset.X() < maWinSize.Width() )
{
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is
- // controlled by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
if ( mbBookPreview && pPage->GetPhyPageNum() == 1 && mnCols != 1 && nCurrCol == 1
)
{
@@ -675,12 +614,6 @@ void SwPagePreviewLayout::_CalcPreviewPages()
}
}
-/** determines preview data for a given page and a given preview offset
-
- OD 13.12.2002 #103492#
-
- @author OD
-*/
bool SwPagePreviewLayout::_CalcPreviewDataForPage( const SwPageFrm& _rPage,
const Point& _rPrevwOffset,
PrevwPage* _opPrevwPage )
@@ -719,12 +652,6 @@ bool SwPagePreviewLayout::_CalcPreviewDataForPage( const SwPageFrm& _rPage,
return true;
}
-/** enable/disable book preview
-
- OD 2004-03-04 #i18143#
-
- @author OD
-*/
bool SwPagePreviewLayout::SetBookPreviewMode( const bool _bEnableBookPreview,
sal_uInt16& _onStartPageNum,
Rectangle& _orDocPreviewPaintRect )
@@ -762,12 +689,7 @@ bool SwPagePreviewLayout::SetBookPreviewMode( const bool _bEnableBookPreview,
// methods to determine new data for changing the current shown part of the
// document preview.
// =============================================================================
-/** calculate start position for new scale
-
- OD 12.12.2002 #103492#
- @author OD
-*/
Point SwPagePreviewLayout::GetPreviewStartPosForNewScale(
const Fraction& _aNewScale,
const Fraction& _aOldScale,
@@ -827,8 +749,6 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale(
/** determines, if page with given page number is visible in preview
- OD 12.12.2002 #103492#
-
@author OD, _nPageNum is absolut!
*/
bool SwPagePreviewLayout::IsPageVisible( const sal_uInt16 _nPageNum ) const
@@ -839,8 +759,6 @@ bool SwPagePreviewLayout::IsPageVisible( const sal_uInt16 _nPageNum ) const
/** calculate data to bring new selected page into view.
- OD 12.12.2002 #103492#
-
@author OD, IN/OUT parameters are absolute page numbers!!!
*/
bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
@@ -854,7 +772,7 @@ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
sal_uInt16 nTmpRelSelPageNum = ConvertAbsoluteToRelativePageNum( mnSelectedPageNum );
sal_uInt16 nNewRelSelectedPageNum = nTmpRelSelPageNum;
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
+ // leaving left-top-corner blank is controlled
// by <mbBookPreview>.
if ( mbBookPreview )
{
@@ -896,7 +814,7 @@ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
{
if ( _nHoriMove != 0 && _nVertMove != 0 )
{
- ASSERT( false, "missing implementation for moving preview selected page horizontal AND vertical");
+ OSL_ENSURE( false, "missing implementation for moving preview selected page horizontal AND vertical");
return false;
}
@@ -905,13 +823,13 @@ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
sal_Int16 nTotalRows = GetRowOfPage( mnPages );
if ( (_nHoriMove > 0 || _nVertMove > 0) &&
mbDoesLayoutRowsFitIntoWindow &&
- mbDoesLayoutColsFitIntoWindow && // OD 20.02.2003 #107369# - add condition
+ mbDoesLayoutColsFitIntoWindow &&
nCurrRow > nTotalRows - mnRows )
{
// new proposed start page = left-top-corner of last possible
// preview page.
nNewStartPage = (nTotalRows - mnRows) * mnCols + 1;
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
+ // leaving left-top-corner blank is controlled
// by <mbBookPreview>.
if ( mbBookPreview )
{
@@ -937,8 +855,6 @@ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove(
/** checks, if given position is inside a shown document page
- OD 17.12.2002 #103492#
-
@author OD
*/
struct PrevwPosInsidePagePred
@@ -1001,8 +917,6 @@ bool SwPagePreviewLayout::IsPrevwPosInDocPrevwPage( const Point _aPrevwPos,
/** determine window page scroll amount
- OD 17.12.2002 #103492#
-
@author OD
*/
SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount(
@@ -1016,14 +930,14 @@ SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount(
else
nScrollAmount = _nWinPagesToScroll * maPaintedPrevwDocRect.GetHeight();
- // OD 19.02.2003 #107369# - check, if preview layout size values are valid.
+ // check, if preview layout size values are valid.
// If not, the checks for an adjustment of the scroll amount aren't useful.
if ( mbLayoutSizesValid )
{
if ( (maPaintedPrevwDocRect.Top() + nScrollAmount) <= 0 )
nScrollAmount = -maPaintedPrevwDocRect.Top();
- // OD 14.02.2003 #107369# - correct scroll amount
+ // correct scroll amount
if ( nScrollAmount > 0 &&
maPaintedPrevwDocRect.Bottom() == maPreviewDocRect.Bottom()
)
@@ -1045,12 +959,7 @@ SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount(
// =============================================================================
// methods to paint page preview layout
// =============================================================================
-/** paint prepared preview
-
- OD 12.12.2002 #103492#
- @author OD
-*/
bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
{
// check environment and parameters
@@ -1059,13 +968,13 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
!mrParentViewShell.GetOut()->GetConnectMetaFile() )
return false;
- ASSERT( mbPaintInfoValid,
+ OSL_ENSURE( mbPaintInfoValid,
"invalid preview settings - no paint of preview" );
if ( !mbPaintInfoValid )
return false;
}
- // OD 17.11.2003 #i22014# - no paint, if <superfluous> flag is set at layout
+ // #i22014# no paint if <superfluous> flag is set at layout
if ( mrLayoutRootFrm.IsSuperfluous() )
{
return true;
@@ -1073,7 +982,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
// environment and parameter ok
- // OD 07.11.2003 #i22014#
+ // #i22014#
if ( mbInPaint )
{
return false;
@@ -1116,8 +1025,6 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
const Font& rEmptyPgFont = SwPageFrm::GetEmptyPageFont();
- Color aEmptyPgShadowBorderColor = SwViewOption::GetFontColor();
-
for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin();
aPageIter != maPrevwPages.end();
++aPageIter )
@@ -1136,8 +1043,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
const Color aRetouche( mrParentViewShell.Imp()->GetRetoucheColor() );
if( pOutputDev->GetFillColor() != aRetouche )
pOutputDev->SetFillColor( aRetouche );
- pOutputDev->SetLineColor(); // OD 20.02.2003 #107369# - no line color
- // OD 20.02.2003 #107369# - use aligned page rectangle
+ pOutputDev->SetLineColor(); // no line color
+ // use aligned page rectangle
{
SwRect aTmpPageRect( aPageRect );
::SwAlignRect( aTmpPageRect, &mrParentViewShell);
@@ -1154,9 +1061,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
TEXT_DRAW_CLIP );
pOutputDev->SetFont( aOldFont );
// paint shadow and border for empty page
- // OD 19.02.2003 #107369# - use new method to paint page border and
- // shadow
- SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, true );
+ // use new method to paint page border and shadow
+ SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, false, true );
}
else
{
@@ -1164,20 +1070,17 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
aPxPaintRect.Intersection( aPxOutRect );
Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect );
mrParentViewShell.Paint( aPaintRect );
- // --> OD 2007-08-15 #i80691#
- // paint page border and shadow
+ // #i80691# paint page border and shadow
{
SwRect aPageBorderRect;
SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect, true );
const Region aDLRegion(aPageBorderRect.SVRect());
mrParentViewShell.DLPrePaint2(aDLRegion);
- SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, true );
+ SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, false, true );
mrParentViewShell.DLPostPaint2(true);
}
- // <--
}
- // OD 07.11.2003 #i22014# - stop painting, because new print
- // preview layout is created during paint.
+ // #i22014# stop painting, because new print preview layout is created during paint.
if ( mbNewLayoutDuringPaint )
{
break;
@@ -1191,8 +1094,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
}
}
- // OD 17.11.2003 #i22014# - no update of accessible preview, if a new
- // print preview layout is created during paint.
+ // #i22014# no update of accessible preview, if a new print preview layout is created during paint.
if ( !mbNewLayoutDuringPaint )
{
// update at accessiblilty interface
@@ -1206,19 +1108,12 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const
pOutputDev->SetMapMode( aSavedMapMode );
mrParentViewShell.aVisArea.Clear();
- // OD 07.11.2003 #i22014#
mbInPaint = false;
mbNewLayoutDuringPaint = false;
return true;
}
-/** repaint pages on page preview
-
- OD 18.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
{
// check environment and parameters
@@ -1227,7 +1122,7 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
!mrParentViewShell.GetOut()->GetConnectMetaFile() )
return;
- ASSERT( mbPaintInfoValid,
+ OSL_ENSURE( mbPaintInfoValid,
"invalid preview settings - no paint of preview" );
if ( !mbPaintInfoValid )
return;
@@ -1264,12 +1159,6 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
}
}
-/** paint selection mark at page
-
- OD 17.12.2002 #103492#
-
- @author OD
-*/
void SwPagePreviewLayout::_PaintSelectMarkAtPage(
const PrevwPage* _aSelectedPrevwPage ) const
{
@@ -1295,20 +1184,20 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
// calculate page rectangle in pixel coordinates
SwRect aPageRect( _aSelectedPrevwPage->aLogicPos,
_aSelectedPrevwPage->aPageSize );
- // OD 19.02.2003 #107369# - use aligned page rectangle, as it is used for
+ // use aligned page rectangle, as it is used for
// page border and shadow paint - see <SwPageFrm::PaintBorderAndShadow(..)>
::SwAlignRect( aPageRect, &mrParentViewShell);
Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
// draw two rectangle
- // OD 19.02.2003 #107369# - adjust position of select mark rectangle
+ // adjust position of select mark rectangle
Rectangle aRect( aPxPageRect.Left(), aPxPageRect.Top(),
aPxPageRect.Right(), aPxPageRect.Bottom() );
aRect = pOutputDev->PixelToLogic( aRect );
- pOutputDev->SetFillColor(); // OD 20.02.2003 #107369# - no fill color
+ pOutputDev->SetFillColor(); // no fill color
pOutputDev->SetLineColor( aSelPgLineColor );
pOutputDev->DrawRect( aRect );
- // OD 19.02.2003 #107369# - adjust position of select mark rectangle
+ // adjust position of select mark rectangle
aRect = Rectangle( aPxPageRect.Left()+1, aPxPageRect.Top()+1,
aPxPageRect.Right()-1, aPxPageRect.Bottom()-1 );
aRect = pOutputDev->PixelToLogic( aRect );
@@ -1322,14 +1211,8 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
pOutputDev->SetMapMode( aSavedMapMode );
}
-/** paint to mark new selected page
-
- OD 17.12.2002 #103492#
- Perform paint for current selected page in order to unmark it.
- Set new selected page and perform paint to mark this page.
-
- @author OD, _nSelectedPage, mnSelectedPage are absolut
-*/
+// Perform paint for current selected page in order to unmark it.
+// Set new selected page and perform paint to mark this page.
void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
{
sal_uInt16 nOldSelectedPageNum = mnSelectedPageNum;
@@ -1339,7 +1222,7 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
const PrevwPage* pOldSelectedPrevwPage = _GetPrevwPageByPageNum( nOldSelectedPageNum );
if ( pOldSelectedPrevwPage && pOldSelectedPrevwPage->bVisible )
{
- // OD 20.02.2003 #107369# - invalidate only areas of selection mark.
+ // invalidate only areas of selection mark.
SwRect aPageRect( pOldSelectedPrevwPage->aPrevwWinPos,
pOldSelectedPrevwPage->aPageSize );
::SwAlignRect( aPageRect, &mrParentViewShell);
@@ -1373,12 +1256,7 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
// =============================================================================
// helper methods
// =============================================================================
-/** get preview page by physical page number
- OD 17.12.2002 #103492#
-
- @author OD
-*/
struct EqualsPageNumPred
{
const sal_uInt16 mnPageNum;
@@ -1401,16 +1279,9 @@ const PrevwPage* SwPagePreviewLayout::_GetPrevwPageByPageNum( const sal_uInt16 _
return (*aFoundPrevwPageIter);
}
-/** determine row the page with the given number is in
-
- OD 17.01.2003 #103492#
-
- @author OD, _nPageNum is relative
-*/
sal_uInt16 SwPagePreviewLayout::GetRowOfPage( sal_uInt16 _nPageNum ) const
{
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
- // by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
if ( mbBookPreview )
{
// Note: increase given physical page number by one, because left-top-corner
@@ -1424,17 +1295,9 @@ sal_uInt16 SwPagePreviewLayout::GetRowOfPage( sal_uInt16 _nPageNum ) const
return nRow;
}
-
-/** determine column the page with the given number is in
-
- OD 17.01.2003 #103492#
-
- @author OD, _nPageNum is relative
-*/
sal_uInt16 SwPagePreviewLayout::GetColOfPage( sal_uInt16 _nPageNum ) const
{
- // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
- // by <mbBookPreview>.
+ // leaving left-top-corner blank is controlled by <mbBookPreview>.
if ( mbBookPreview )
{
// Note: increase given physical page number by one, because left-top-corner
@@ -1451,16 +1314,10 @@ sal_uInt16 SwPagePreviewLayout::GetColOfPage( sal_uInt16 _nPageNum ) const
Size SwPagePreviewLayout::GetPrevwDocSize() const
{
- ASSERT( PreviewLayoutValid(), "PagePreviewLayout not valid" );
+ OSL_ENSURE( PreviewLayoutValid(), "PagePreviewLayout not valid" );
return maPreviewDocRect.GetSize();
}
-/** get size of a preview page by its physical page number
-
- OD 15.01.2003 #103492#
-
- @author OD
-*/
Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) const
{
const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum );
@@ -1474,12 +1331,6 @@ Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) cons
}
}
-/** get virtual page number by its physical page number
-
- OD 21.03.2003 #108282#
-
- @author OD
-*/
sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum( sal_uInt16 _nPageNum ) const
{
const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum );
@@ -1493,10 +1344,6 @@ sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum( sal_uInt16 _nPageNum )
}
}
-/** Convert absolute to relative page numbers (see PrintEmptyPages)
-
- @author FME
-*/
sal_uInt16 SwPagePreviewLayout::ConvertAbsoluteToRelativePageNum( sal_uInt16 _nAbsPageNum ) const
{
if ( mbBookPreview || mbPrintEmptyPages || !_nAbsPageNum )
@@ -1519,10 +1366,6 @@ sal_uInt16 SwPagePreviewLayout::ConvertAbsoluteToRelativePageNum( sal_uInt16 _nA
return nRet;
}
-/** Convert relative to absolute page numbers (see PrintEmptyPages)
-
- @author FME
-*/
sal_uInt16 SwPagePreviewLayout::ConvertRelativeToAbsolutePageNum( sal_uInt16 _nRelPageNum ) const
{
if ( mbBookPreview || mbPrintEmptyPages || !_nRelPageNum )
@@ -1545,3 +1388,5 @@ sal_uInt16 SwPagePreviewLayout::ConvertRelativeToAbsolutePageNum( sal_uInt16 _nR
return pRet->GetPhyPageNum();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 4be694cc3baa..19193935cb76 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/**************************************************************************
*
*
@@ -7,9 +8,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: vprint.cxx,v $
- * $Revision: 1.46 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -101,8 +99,8 @@ void SwRenderData::DeletePostItData()
{
if (HasPostItData())
{
- m_pPostItDoc->setPrinter( 0, false, false ); //damit am echten DOC der Drucker bleibt
- delete m_pPostItShell; //Nimmt das PostItDoc mit ins Grab.
+ m_pPostItDoc->setPrinter( 0, false, false ); // So that the printer remains at the real DOC
+ delete m_pPostItShell;
delete m_pPostItFields;
m_pPostItDoc = 0;
m_pPostItShell = 0;
@@ -540,3 +538,4 @@ bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< bea
//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index c9581d26251f..d787806203de 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,11 +39,9 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
-/// OD 29.08.2002 #102450#
-/// include <svx/svdoutl.hxx>
#include <svx/svdoutl.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include <svx/fmglob.hxx>
#endif
@@ -61,123 +60,45 @@
#include <IDocumentDrawModelAccess.hxx>
-/*************************************************************************
-|*
-|* SwSaveHdl
-|*
-|* Ersterstellung MA 14. Feb. 95
-|* Letzte Aenderung MA 02. Jun. 98
-|*
-|*************************************************************************/
-//SwSaveHdl::SwSaveHdl( SwViewImp *pI ) :
-// pImp( pI ),
-// bXorVis( sal_False )
-//{
- //if ( pImp->HasDrawView() )
- //{
- // bXorVis = pImp->GetDrawView()->IsShownXorVisible( pImp->GetShell()->GetOut());
- // if ( bXorVis )
- // pImp->GetDrawView()->HideShownXor( pImp->GetShell()->GetOut() );
- //}
-//}
-
-
-//SwSaveHdl::~SwSaveHdl()
-//{
- //if ( bXorVis )
- // pImp->GetDrawView()->ShowShownXor( pImp->GetShell()->GetOut() );
-//}
-
-
-/*************************************************************************
-|*
-|* SwViewImp::StartAction(), EndAction()
-|*
-|* Ersterstellung MA 14. Feb. 95
-|* Letzte Aenderung MA 14. Sep. 98
-|*
-|*************************************************************************/
-
-
void SwViewImp::StartAction()
{
if ( HasDrawView() )
{
SET_CURR_SHELL( GetShell() );
if ( pSh->ISA(SwFEShell) )
- ((SwFEShell*)pSh)->HideChainMarker(); //Kann sich geaendert haben
- //bResetXorVisibility = GetDrawView()->IsShownXorVisible( GetShell()->GetOut());
- //GetDrawView()->HideShownXor( GetShell()->GetOut() );
+ ((SwFEShell*)pSh)->HideChainMarker();
}
}
-
-
void SwViewImp::EndAction()
{
if ( HasDrawView() )
{
SET_CURR_SHELL( GetShell() );
- //if ( bResetXorVisibility )
- // GetDrawView()->ShowShownXor( GetShell()->GetOut() );
if ( pSh->ISA(SwFEShell) )
- ((SwFEShell*)pSh)->SetChainMarker(); //Kann sich geaendert haben
+ ((SwFEShell*)pSh)->SetChainMarker(); // May have changed
}
}
-/*************************************************************************
-|*
-|* SwViewImp::LockPaint(), UnlockPaint()
-|*
-|* Ersterstellung MA 11. Jun. 96
-|* Letzte Aenderung MA 11. Jun. 96
-|*
-|*************************************************************************/
-
-
void SwViewImp::LockPaint()
{
if ( HasDrawView() )
{
- //HMHbShowHdlPaint = GetDrawView()->IsMarkHdlShown();
- //HMHif ( bShowHdlPaint )
- //HMH GetDrawView()->HideMarkHdl();
bResetHdlHiddenPaint = !GetDrawView()->areMarkHandlesHidden();
GetDrawView()->hideMarkHandles();
}
else
{
- //HMHbShowHdlPaint = sal_False;
bResetHdlHiddenPaint = sal_False;
}
}
-
-
void SwViewImp::UnlockPaint()
{
if ( bResetHdlHiddenPaint )
GetDrawView()->showMarkHandles();
- //HMHif ( bShowHdlPaint )
- //HMH GetDrawView()->ShowMarkHdl();
}
-
-/*************************************************************************
-|*
-|* SwViewImp::PaintLayer(), PaintDispatcher()
-|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung AMA 04. Jun. 98
-|*
-|*************************************************************************/
-// OD 29.08.2002 #102450#
-// add 3rd paramter <const Color* pPageBackgrdColor> for setting this
-// color as the background color at the outliner of the draw view.
-// OD 09.12.2002 #103045# - add 4th parameter for the horizontal text direction
-// of the page in order to set the default horizontal text direction at the
-// outliner of the draw view for painting layers <hell> and <heaven>.
-// OD 25.06.2003 #108784# - correct type of 1st parameter
void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
SwPrintData const*const pPrintData,
const SwRect& ,
@@ -196,20 +117,17 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
pOutDev->SetDrawMode( nOldDrawMode | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL |
DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
}
-
- // OD 29.08.2002 #102450#
// For correct handling of accessibility, high contrast, the page background
// color is set as the background color at the outliner of the draw view.
// Only necessary for the layers hell and heaven
Color aOldOutlinerBackgrdColor;
- // OD 09.12.2002 #103045# - set default horizontal text direction on
- // painting <hell> or <heaven>.
+ // set default horizontal text direction on painting <hell> or <heaven>.
EEHorizontalTextDirection aOldEEHoriTextDir = EE_HTEXTDIR_L2R;
const IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
if ( (_nLayerID == pIDDMA->GetHellId()) ||
(_nLayerID == pIDDMA->GetHeavenId()) )
{
- ASSERT( _pPageBackgrdColor,
+ OSL_ENSURE( _pPageBackgrdColor,
"incorrect usage of SwViewImp::PaintLayer: pPageBackgrdColor have to be set for painting layer <hell> or <heaven>");
if ( _pPageBackgrdColor )
{
@@ -235,9 +153,8 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
GetPageView()->DrawLayer(_nLayerID, pOutDev);
pOutDev->Pop();
- // OD 29.08.2002 #102450#
// reset background color of the outliner
- // OD 09.12.2002 #103045# - reset default horizontal text direction
+ // reset default horizontal text direction
if ( (_nLayerID == pIDDMA->GetHellId()) ||
(_nLayerID == pIDDMA->GetHeavenId()) )
{
@@ -249,14 +166,6 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
}
}
-/*************************************************************************
-|*
-|* SwViewImp::IsDragPossible()
-|*
-|* Ersterstellung MA 19. Jan. 93
-|* Letzte Aenderung MA 16. Jan. 95
-|*
-|*************************************************************************/
#define WIEDUWILLST 400
sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
@@ -288,15 +197,6 @@ sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
return aRect.IsInside( rPoint );
}
-/*************************************************************************
-|*
-|* SwViewImp::NotifySizeChg()
-|*
-|* Ersterstellung MA 23. Jun. 93
-|* Letzte Aenderung MA 05. Oct. 98
-|*
-|*************************************************************************/
-
void SwViewImp::NotifySizeChg( const Size &rNewSz )
{
if ( !HasDrawView() )
@@ -305,7 +205,6 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
if ( GetPageView() )
GetPageView()->GetPage()->SetSize( rNewSz );
- //Begrenzung des Arbeitsbereiches.
const Rectangle aRect( Point( DOCUMENTBORDER, DOCUMENTBORDER ), rNewSz );
const Rectangle &rOldWork = GetDrawView()->GetWorkArea();
sal_Bool bCheckDrawObjs = sal_False;
@@ -318,7 +217,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
if ( !bCheckDrawObjs )
return;
- ASSERT( pSh->getIDocumentDrawModelAccess()->GetDrawModel(), "NotifySizeChg without DrawModel" );
+ OSL_ENSURE( pSh->getIDocumentDrawModelAccess()->GetDrawModel(), "NotifySizeChg without DrawModel" );
SdrPage* pPage = pSh->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
const sal_uLong nObjs = pPage->GetObjCount();
for( sal_uLong nObj = 0; nObj < nObjs; ++nObj )
@@ -326,8 +225,6 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
SdrObject *pObj = pPage->GetObj( nObj );
if( !pObj->ISA(SwVirtFlyDrawObj) )
{
- //Teilfix(26793): Objekte, die in Rahmen verankert sind, brauchen
- //nicht angepasst werden.
const SwContact *pCont = (SwContact*)GetUserCall(pObj);
//JP - 16.3.00 Bug 73920: this function might be called by the
// InsertDocument, when a PageDesc-Attribute is
@@ -344,7 +241,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
continue;
}
- // OD 19.06.2003 #108784# - no move for drawing objects in header/footer
+ // no move for drawing objects in header/footer
if ( pAnchor->FindFooterOrHeader() )
{
continue;
@@ -361,7 +258,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
if ( aSz.Width() || aSz.Height() )
pObj->Move( aSz );
- //Notanker: Grosse Objekte nicht nach oben verschwinden lassen.
+ //Note anchor: Large objects can not disappear from the top.
aSz.Width() = aSz.Height() = 0;
if ( aBound.Bottom() < aRect.Top() )
aSz.Width() = (aBound.Bottom() - aRect.Top()) - MINFLY;
@@ -376,3 +273,4 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index b384d0763ef4..aa60644f8adb 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,6 @@
#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "viewimp.hxx"
-#include "errhdl.hxx"
#include "viewopt.hxx"
#include "flyfrm.hxx"
#include "frmfmt.hxx"
@@ -46,7 +46,6 @@
#include <svx/svdpage.hxx>
#include <accmap.hxx>
-// OD 12.12.2002 #103492#
#include <pagepreviewlayout.hxx>
#include <comcore.hrc>
@@ -56,19 +55,10 @@
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentSettingAccess.hxx>
-/*************************************************************************
-|*
-|* SwViewImp::Init()
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 03. Nov. 95
-|*
-|*************************************************************************/
-
void SwViewImp::Init( const SwViewOption *pNewOpt )
{
- ASSERT( pDrawView, "SwViewImp::Init without DrawView" );
- //Jetzt die PageView erzeugen wenn sie noch nicht existiert.
+ OSL_ENSURE( pDrawView, "SwViewImp::Init without DrawView" );
+ //Now create the page view if it does not exist.
SwRootFrm *pRoot = pSh->getIDocumentLayoutAccess()->GetRootFrm();
if ( !pSdrPageView )
{
@@ -80,8 +70,7 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
pRoot->GetDrawPage()->SetSize( pRoot->Frm().SSize() );
pSdrPageView = pDrawView->ShowSdrPage( pRoot->GetDrawPage());
- // OD 26.06.2003 #108784# - notify drawing page view about invisible
- // layers.
+ // notify drawing page view about invisible layers.
pIDDMA->NotifyInvisibleLayers( *pSdrPageView );
}
pDrawView->SetDragStripes( pNewOpt->IsCrossHair() );
@@ -110,15 +99,6 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
pDrawView->SetMarkHdlSizePixel(pNewOpt->IsBigMarkHdl() ? 9 : 7);
}
-/*************************************************************************
-|*
-|* SwViewImp::SwViewImp() CTor fuer die Core-Internas
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 06. Sep. 96
-|*
-|*************************************************************************/
-
SwViewImp::SwViewImp( ViewShell *pParent ) :
pSh( pParent ),
pDrawView( 0 ),
@@ -130,33 +110,19 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
pAccMap( 0 ),
pSdrObjCached(NULL),
nRestoreActions( 0 ),
- // OD 12.12.2002 #103492#
mpPgPrevwLayout( 0 )
{
- //bResetXorVisibility =
- //HMHbShowHdlPaint =
bResetHdlHiddenPaint =
bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
bFirstPageInvalid = sal_True;
}
-/******************************************************************************
-|*
-|* SwViewImp::~SwViewImp()
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 16. Dec. 94
-|*
-******************************************************************************/
-
SwViewImp::~SwViewImp()
{
delete pAccMap;
- // OD 12.12.2002 #103492#
delete mpPgPrevwLayout;
- //JP 29.03.96: nach ShowSdrPage muss auch HideSdrPage gemacht werden!!!
if( pDrawView )
pDrawView->HideSdrPage();
@@ -164,33 +130,15 @@ SwViewImp::~SwViewImp()
DelRegion();
- ASSERT( !pLayAct, "Have action for the rest of your life." );
- ASSERT( !pIdleAct,"Be idle for the rest of your life." );
+ OSL_ENSURE( !pLayAct, "Have action for the rest of your life." );
+ OSL_ENSURE( !pIdleAct,"Be idle for the rest of your life." );
}
-/******************************************************************************
-|*
-|* SwViewImp::DelRegions()
-|*
-|* Ersterstellung MA 14. Apr. 94
-|* Letzte Aenderung MA 14. Apr. 94
-|*
-******************************************************************************/
-
void SwViewImp::DelRegion()
{
DELETEZ(pRegion);
}
-/******************************************************************************
-|*
-|* SwViewImp::AddPaintRect()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 27. Jul. 94
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
{
if ( rRect.IsOver( pSh->VisArea() ) )
@@ -203,31 +151,12 @@ sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
return sal_False;
}
-
-/******************************************************************************
-|*
-|* ViewImp::CheckWaitCrsr()
-|*
-|* Ersterstellung MA 10. Aug. 94
-|* Letzte Aenderung MA 10. Aug. 94
-|*
-******************************************************************************/
-
void SwViewImp::CheckWaitCrsr()
{
if ( pLayAct )
pLayAct->CheckWaitCrsr();
}
-/******************************************************************************
-|*
-|* ViewImp::IsCalcLayoutProgress()
-|*
-|* Ersterstellung MA 12. Aug. 94
-|* Letzte Aenderung MA 12. Aug. 94
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::IsCalcLayoutProgress() const
{
if ( pLayAct )
@@ -235,15 +164,6 @@ sal_Bool SwViewImp::IsCalcLayoutProgress() const
return sal_False;
}
-/******************************************************************************
-|*
-|* ViewImp::IsUpdateExpFlds()
-|*
-|* Ersterstellung MA 28. Mar. 96
-|* Letzte Aenderung MA 28. Mar. 96
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::IsUpdateExpFlds()
{
if ( pLayAct && pLayAct->IsCalcLayout() )
@@ -254,24 +174,12 @@ sal_Bool SwViewImp::IsUpdateExpFlds()
return sal_False;
}
-
-/******************************************************************************
-|*
-|* SwViewImp::SetFirstVisPage(), ImplGetFirstVisPage();
-|*
-|* Ersterstellung MA 21. Sep. 93
-|* Letzte Aenderung MA 08. Mar. 94
-|*
-******************************************************************************/
-
void SwViewImp::SetFirstVisPage()
{
if ( pSh->bDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
{
- //Wir stecken in einer Action und die VisArea sitzt wegen
- //Loeschoperationen hinter der erste sichtbaren Seite.
- //Damit nicht zu heftig Formatiert wird, liefern wir die letzte Seite
- //zurueck.
+ //We are in an "Action", and the VisArea is behind the first visible page due
+ //to delete operations. To prevent expensive formatting, return the last page
pFirstVisPage = (SwPageFrm*)pSh->GetLayout()->Lower();
while ( pFirstVisPage && pFirstVisPage->GetNext() )
pFirstVisPage = (SwPageFrm*)pFirstVisPage->GetNext();
@@ -301,15 +209,6 @@ void SwViewImp::SetFirstVisPage()
bFirstPageInvalid = sal_False;
}
-/******************************************************************************
-|*
-|* SwViewImp::MakeDrawView();
-|*
-|* Ersterstellung AMA 01. Nov. 95
-|* Letzte Aenderung AMA 01. Nov. 95
-|*
-******************************************************************************/
-
void SwViewImp::MakeDrawView()
{
IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
@@ -334,7 +233,6 @@ void SwViewImp::MakeDrawView()
if(!pOutDevForDrawView)
{
- // pOutDevForDrawView = (OutputDevice*)GetShell()->getIDocumentDeviceAccess()->getPrinter( false );
pOutDevForDrawView = GetShell()->GetOut();
}
@@ -345,22 +243,10 @@ void SwViewImp::MakeDrawView()
const SwViewOption* pSwViewOption = GetShell()->GetViewOptions();
Init(pSwViewOption);
- // #i68597# If document is read-only, we will not profit from overlay,
- // so switch it off.
+ // #i68597# If document is read-only, we will not profit from overlay, so switch it off.
if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
{
- bool bIsReadOnly(pSwViewOption->IsReadonly());
-
-#ifdef DBG_UTIL
- // add test possibilities
- static bool bAlwaysActivateForTest(false);
- if(bAlwaysActivateForTest && bIsReadOnly)
- {
- bIsReadOnly = false;
- }
-#endif
-
- if(bIsReadOnly)
+ if(pSwViewOption->IsReadonly())
{
pDrawView->SetBufferedOverlayAllowed(false);
}
@@ -368,15 +254,6 @@ void SwViewImp::MakeDrawView()
}
}
-/******************************************************************************
-|*
-|* SwViewImp::GetRetoucheColor()
-|*
-|* Ersterstellung MA 24. Jun. 98
-|* Letzte Aenderung MA 24. Jun. 98
-|*
-******************************************************************************/
-
Color SwViewImp::GetRetoucheColor() const
{
Color aRet( COL_TRANSPARENT );
@@ -395,15 +272,9 @@ Color SwViewImp::GetRetoucheColor() const
return aRet;
}
-/** create page preview layout
-
- OD 12.12.2002 #103492#
-
- @author OD
-*/
void SwViewImp::InitPagePreviewLayout()
{
- ASSERT( pSh->GetLayout(), "no layout - page preview layout can not be created.");
+ OSL_ENSURE( pSh->GetLayout(), "no layout - page preview layout can not be created.");
if ( pSh->GetLayout() )
mpPgPrevwLayout = new SwPagePreviewLayout( *pSh, *(pSh->GetLayout()) );
}
@@ -413,8 +284,8 @@ void SwViewImp::UpdateAccessible()
// We require a layout and an XModel to be accessible.
IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess();
Window *pWin = GetShell()->GetWin();
- ASSERT( pIDLA->GetRootFrm(), "no layout, no access" );
- ASSERT( pWin, "no window, no access" );
+ OSL_ENSURE( pIDLA->GetRootFrm(), "no layout, no access" );
+ OSL_ENSURE( pWin, "no window, no access" );
if( IsAccessible() && pIDLA->GetRootFrm() && pWin )
GetAccessibleMap().GetDocumentView();
@@ -424,7 +295,7 @@ void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
const SdrObject *pObj,
sal_Bool bRecursive )
{
- ASSERT( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -438,7 +309,7 @@ void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
const SwRect& rOldFrm )
{
- ASSERT( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -452,7 +323,7 @@ void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
void SwViewImp::InvalidateAccessibleFrmContent( const SwFrm *pFrm )
{
- ASSERT( pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -503,12 +374,7 @@ void SwViewImp::InvalidateAccessibleRelationSet( const SwFlyFrm *pMaster,
} while ( pTmp != pVSh );
}
- /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
-
- OD 2005-12-01 #i27138#
-
- @author OD
-*/
+// #i27138# invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
const SwTxtFrm* _pToTxtFrm )
{
@@ -539,12 +405,7 @@ void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxt
} while ( pTmp != pVSh );
}
-/** invalidate text selection for paragraphs
-
- OD 2005-12-12 #i27301#
-
- @author OD
-*/
+//#i27301# invalidate text selection for paragraphs
void SwViewImp::_InvalidateAccessibleParaTextSelection()
{
ViewShell* pVSh = GetShell();
@@ -560,12 +421,7 @@ void SwViewImp::_InvalidateAccessibleParaTextSelection()
} while ( pTmp != pVSh );
}
-/** invalidate attributes for paragraphs
-
- OD 2009-01-06 #i88069#
-
- @author OD
-*/
+//#i88069# invalidate attributes for paragraphs
void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
{
ViewShell* pVSh = GetShell();
@@ -581,7 +437,6 @@ void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
} while ( pTmp != pVSh );
}
-// OD 15.01.2003 #103492# - method signature change due to new page preview functionality
void SwViewImp::UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
const SwPageFrm* _pSelectedPageFrm,
@@ -600,7 +455,7 @@ void SwViewImp::InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage )
SwAccessibleMap *SwViewImp::CreateAccessibleMap()
{
- ASSERT( !pAccMap, "accessible map exists" )
+ OSL_ENSURE( !pAccMap, "accessible map exists" );
pAccMap = new SwAccessibleMap( GetShell() );
return pAccMap;
}
@@ -618,3 +473,4 @@ IMPL_LINK(SwViewImp, SetStopPrt, void *, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index e2a8ec46567f..209528f33436 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,7 +59,6 @@
using namespace ::com::sun::star;
-// OD 12.12.2002 #103492#
SwPagePreviewLayout* ViewShell::PagePreviewLayout()
{
return Imp()->PagePreviewLayout();
@@ -69,15 +69,12 @@ void ViewShell::ShowPreViewSelection( sal_uInt16 nSelPage )
Imp()->InvalidateAccessiblePreViewSelection( nSelPage );
}
-/** adjust view options for page preview
-
- OD 09.01.2003 #i6467#
-*/
+//#i6467# adjust view options for page preview
void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions)
{
if ( !IsPreView() )
{
- ASSERT( false, "view shell doesn't belongs to a page preview - no adjustment of its view options");
+ OSL_ENSURE( false, "view shell doesn't belongs to a page preview - no adjustment of its view options");
return;
}
@@ -87,9 +84,7 @@ void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions)
}
-// print brochure
-// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling
-// for a page to be printed.
+//#i14016# - consider empty pages on calculation of the scaling for a page to be printed.
void ViewShell::PrintProspect(
OutputDevice *pOutDev,
const SwPrintData &rPrintData,
@@ -110,14 +105,12 @@ void ViewShell::PrintProspect(
std::pair< sal_Int32, sal_Int32 > rPagesToPrint =
rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ];
-// 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" );
DBG_ASSERT( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
#endif
- // eine neue Shell fuer den Printer erzeugen
+ // create a new shell for the Printer
ViewShell aShell( *this, 0, pPrinter );
SET_CURR_SHELL( &aShell );
@@ -147,8 +140,7 @@ void ViewShell::PrintProspect(
pNxtPage = aIt->second;
}
- // OD 05.05.2003 #i14016# - consider empty pages on calculation
- // of page size, used for calculation of scaling.
+ //#i14016# - consider empty pages on calculation of page size, used for calculation of scaling.
Size aSttPageSize;
if ( pStPage )
{
@@ -196,7 +188,6 @@ void ViewShell::PrintProspect(
nMaxRowSz = Max( aNxtPageSize.Height(), aSttPageSize.Height() );
}
- // den MapMode einstellen
aMapMode.SetOrigin( Point() );
{
Fraction aScX( aPrtSize.Width(), nMaxColSz );
@@ -205,8 +196,6 @@ void ViewShell::PrintProspect(
aScY = aScX;
{
- // fuer Drawing, damit diese ihre Objecte vernuenftig Painten
- // koennen, auf "glatte" Prozentwerte setzen
aScY *= Fraction( 1000, 1 );
long nTmp = (long)aScY;
if( 1 < nTmp )
@@ -256,3 +245,4 @@ void ViewShell::PrintProspect(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 115ced0d37c6..afeaa33de325 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#define _SVX_PARAITEM_HXX
#define _SVX_TEXTITEM_HXX
@@ -39,9 +39,6 @@
#include <svx/srchdlg.hxx>
#include <svx/svdobj.hxx>
#include <sfx2/viewsh.hxx>
-#ifndef _SHL_HXX
-//#include <tools/shl.hxx>
-#endif
#include <swwait.hxx>
#include <swmodule.hxx>
#include <fesh.hxx>
@@ -63,9 +60,7 @@
#include <fntcache.hxx>
#include <ptqueue.hxx>
#include <tabfrm.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <pagedesc.hxx>
#include <ndole.hxx>
#include <ndindex.hxx>
@@ -73,18 +68,11 @@
#include <svtools/colorcfg.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <accessibilityoptions.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
-// OD 14.01.2003 #103492#
#include <pagepreviewlayout.hxx>
-// --> OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
#include <anchoredobject.hxx>
-// <--
#include "../../ui/inc/view.hxx"
#include <PostItMgr.hxx>
@@ -92,7 +80,6 @@
#include <vcl/svapp.hxx>
-// #i74769#
#include <svx/sdrpaintwindow.hxx>
sal_Bool ViewShell::bLstAct = sal_False;
@@ -177,17 +164,9 @@ void ViewShell::DLPostPaint2(bool bPaintFormLayer)
//////////////////////////////////////////////////////////////////////////////
-/******************************************************************************
-|*
-|* ViewShell::ImplEndAction()
-|*
-|* Letzte Aenderung MA 04. Sep. 96
-|*
-******************************************************************************/
-
void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
{
- //Fuer den Drucker gibt es hier nichts zu tun.
+ //There is nothing to do here for the printer
if ( !GetWin() || IsPreView() )
{
bPaintWorks = sal_True;
@@ -197,12 +176,13 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
bInEndAction = sal_True;
- //Laeuft hiermit das EndAction der Letzten Shell im Ring?
ViewShell::bLstAct = sal_True;
ViewShell *pSh = (ViewShell*)this->GetNext();
while ( pSh != this )
- { if ( pSh->ActionPend() )
- { ViewShell::bLstAct = sal_False;
+ {
+ if ( pSh->ActionPend() )
+ {
+ ViewShell::bLstAct = sal_False;
pSh = this;
}
else
@@ -233,9 +213,8 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
if ( bIsShellForCheckViewLayout )
GetLayout()->CheckViewLayout( GetViewOptions(), &aVisArea );
- //Wenn wir selbst keine Paints erzeugen, so warten wir auf das Paint
- //vom System. Dann ist das Clipping korrekt gesetzt; Beispiel: verschieben
- //eines DrawObjektes.
+ //If we do not generate Paints, we wait for the paint by the system.
+ //Then, the clipping is set correctly, for example: move a DrawObject.
if ( Imp()->GetRegion() ||
aInvalidRect.HasArea() ||
bExtraData )
@@ -256,12 +235,6 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
SwRegionRects *pRegion = Imp()->GetRegion();
- //JP 27.11.97: wer die Selection hided, muss sie aber auch
- // wieder Showen. Sonst gibt es Paintfehler!
- // z.B.: addional Mode, Seite vertikal hab zu sehen, in der
- // Mitte eine Selektion und mit einem anderen Cursor an linken
- // rechten Rand springen. Ohne ShowCrsr verschwindet die
- // Selektion
sal_Bool bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
if( bShowCrsr )
((SwCrsrShell*)this)->HideCrsrs();
@@ -272,7 +245,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
Imp()->pRegion = NULL;
- //Erst Invert dann Compress, niemals andersherum!
+ // First Invert then Compress, never the other way round!
pRegion->Invert();
pRegion->Compress();
@@ -286,7 +259,6 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
sal_Bool bPaint = sal_True;
if ( IsEndActionByVirDev() )
{
- //virtuelles device erzeugen und einstellen.
if ( !pVout )
pVout = new VirtualDevice( *GetOut() );
MapMode aMapMode( GetOut()->GetMapMode() );
@@ -316,11 +288,9 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
{
bPaint = sal_False;
- // --> OD 2007-07-26 #i79947#
// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
const Region aRepaintRegion(aRect.SVRect());
DLPrePaint2(aRepaintRegion);
- // <--
OutputDevice *pOld = GetOut();
pVout->SetLineColor( pOld->GetLineColor() );
@@ -360,7 +330,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
DLPostPaint2(true);
}
- // --> OD 2009-12-03 #i107365#
+ // #i107365#
// Direct paint has been performed. Thus, take care of
// transparent child windows.
if ( GetWin() )
@@ -389,7 +359,6 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
}
}
}
- // <--
}
delete pVout;
@@ -413,10 +382,6 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
Imp()->EndAction();
- //Damit sich die automatischen Scrollbars auch richtig anordnen k?nnen
- //muessen wir die Aktion hier kuenstlich beenden (EndAction loesst ein
- //Notify aus, und das muss Start-/EndAction rufen um die Scrollbars
- //klarzubekommen.
--nStartAction;
UISizeNotify();
++nStartAction;
@@ -425,35 +390,16 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
Imp()->FireAccessibleEvents();
}
-/******************************************************************************
-|*
-|* ViewShell::ImplStartAction()
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 25. Jul. 94
-|*
-******************************************************************************/
-
void ViewShell::ImplStartAction()
{
bPaintWorks = sal_False;
Imp()->StartAction();
}
-
-/******************************************************************************
-|*
-|* ViewShell::ImplLockPaint(), ImplUnlockPaint()
-|*
-|* Ersterstellung MA 11. Jun. 96
-|* Letzte Aenderung MA 11. Jun. 96
-|*
-******************************************************************************/
-
void ViewShell::ImplLockPaint()
{
if ( GetWin() && GetWin()->IsVisible() )
- GetWin()->EnablePaint( sal_False ); //Auch die Controls abklemmen.
+ GetWin()->EnablePaint( sal_False );
Imp()->LockPaint();
}
@@ -465,7 +411,7 @@ void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
{
if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() )
{
- //Refresh mit virtuellem Device um das Flackern zu verhindern.
+ //prevent refresh with virtual device to flicker.
VirtualDevice *pVout = new VirtualDevice( *pOut );
pVout->SetMapMode( pOut->GetMapMode() );
Size aSize( VisArea().SSize() );
@@ -513,15 +459,6 @@ void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
Imp()->UnlockPaint();
}
-/******************************************************************************
-|*
-|* ViewShell::AddPaintRect()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 09. Feb. 97
-|*
-******************************************************************************/
-
sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
{
sal_Bool bRet = sal_False;
@@ -529,7 +466,6 @@ sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
do
{
if ( pSh->IsPreView() && pSh->GetWin() )
-// pSh->GetWin()->Invalidate();
::RepaintPagePreview( pSh, rRect );
else
bRet |= pSh->Imp()->AddPaintRect( rRect );
@@ -539,15 +475,6 @@ sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
return bRet;
}
-/******************************************************************************
-|*
-|* ViewShell::InvalidateWindows()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 09. Feb. 97
-|*
-******************************************************************************/
-
void ViewShell::InvalidateWindows( const SwRect &rRect )
{
if ( !Imp()->IsCalcLayoutProgress() )
@@ -558,7 +485,6 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
if ( pSh->GetWin() )
{
if ( pSh->IsPreView() )
-// pSh->GetWin()->Invalidate();
::RepaintPagePreview( pSh, rRect );
else if ( pSh->VisArea().IsOver( rRect ) )
pSh->GetWin()->Invalidate( rRect.SVRect() );
@@ -569,15 +495,6 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
}
}
-/******************************************************************************
-|*
-|* ViewShell::MakeVisible()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung AMA 10. Okt. 95
-|*
-******************************************************************************/
-
void ViewShell::MakeVisible( const SwRect &rRect )
{
if ( !VisArea().IsInside( rRect ) || IsScrollMDI( this, rRect ) || GetCareWin(*this) )
@@ -596,11 +513,10 @@ void ViewShell::MakeVisible( const SwRect &rRect )
EndAction();
} while( nOldH != pRoot->Frm().Height() && nLoopCnt-- );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
{
- //MA: 04. Nov. 94, braucht doch keiner oder??
- ASSERT( !this, "MakeVisible fuer Drucker wird doch gebraucht?" );
+ OSL_ENSURE( !this, "MakeVisible fuer Drucker wird doch gebraucht?" );
}
#endif
@@ -608,15 +524,6 @@ void ViewShell::MakeVisible( const SwRect &rRect )
}
}
-/******************************************************************************
-|*
-|* ViewShell::CareChildWindow()
-|*
-|* Ersterstellung AMA 10. Okt. 95
-|* Letzte Aenderung AMA 10. Okt. 95
-|*
-******************************************************************************/
-
Window* ViewShell::CareChildWin(ViewShell& rVSh)
{
if(rVSh.pSfxViewShell)
@@ -631,33 +538,15 @@ Window* ViewShell::CareChildWin(ViewShell& rVSh)
return NULL;
}
-/******************************************************************************
-|*
-|* ViewShell::GetPagePos()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 04. Aug. 93
-|*
-******************************************************************************/
-
Point ViewShell::GetPagePos( sal_uInt16 nPageNum ) const
{
return GetLayout()->GetPagePos( nPageNum );
}
-/******************************************************************************
-|*
-|* ViewShell::GetNumPages()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 20. Apr. 94
-|*
-******************************************************************************/
-
sal_uInt16 ViewShell::GetNumPages()
{
- //Es kann sein, das noch kein Layout existiert weil die Methode vom
- //Root-Ctor gerufen wird.
+ //It can happen that there still no Layout exists due to the
+ //method being called from the Root ctor.
return GetLayout() ? GetLayout()->GetPageNum() : 0;
}
@@ -666,18 +555,6 @@ sal_Bool ViewShell::IsDummyPage( sal_uInt16 nPageNum ) const
return GetLayout() ? GetLayout()->IsDummyPage( nPageNum ) : 0;
}
-/*************************************************************************
-|*
-|* ViewShell::UpdateFlds()
-|*
-|* Ersterstellung BP 04.05.92
-|* Beschreibung erzwingt ein Update fuer jedes Feld
-|*
-|* UpdateFlds benachrichtigt alle Felder mit pNewHt.
-|* Wenn pNewHt == 0 ist (default), wird der Feldtyp verschickt.
-|*
-*************************************************************************/
-
void ViewShell::UpdateFlds(sal_Bool bCloseDB)
{
SET_CURR_SHELL( this );
@@ -723,26 +600,16 @@ sal_Bool ViewShell::HasCharts() const
return bRet;
}
-/*************************************************************************
-|*
-|* ViewShell::LayoutIdle()
-|*
-|* Ersterstellung MA 26. May. 92
-|* Letzte Aenderung OG 19. Mar. 96
-|*
-*************************************************************************/
-
void ViewShell::LayoutIdle()
{
#ifdef TCOVER
- //fuer TCV-Version: Ende der Startphase des Programmes
TCovCall::Idle();
#endif
if( !pOpt->IsIdle() || !GetWin() ||
( Imp()->HasDrawView() && Imp()->GetDrawView()->IsDragObj() ) )
return;
- //Kein Idle wenn gerade gedruckt wird.
+
ViewShell *pSh = this;
do
{ if ( !pSh->GetWin() )
@@ -753,8 +620,7 @@ void ViewShell::LayoutIdle()
SET_CURR_SHELL( this );
-#ifdef DBG_UTIL
- // Wenn Test5 gedrueckt ist, wird der IdleFormatierer abgeknipst.
+#if OSL_DEBUG_LEVEL > 1
if( pOpt->IsTest5() )
return;
#endif
@@ -762,12 +628,8 @@ void ViewShell::LayoutIdle()
{
DBG_PROFSTART( LayoutIdle );
- //Cache vorbereiten und restaurieren, damit er nicht versaut wird.
SwSaveSetLRUOfst aSave( *SwTxtFrm::GetTxtCache(),
SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
- // #125243# there are lots of stacktraces indicating that Imp() returns NULL
- // this ViewShell seems to be invalid - but it's not clear why
- // this return is only a workaround!
DBG_ASSERT(Imp(), "ViewShell already deleted?");
if(!Imp())
return;
@@ -802,7 +664,7 @@ void lcl_InvalidateAllCntnt( ViewShell& rSh, sal_uInt8 nInv )
objects (Writer fly frame and drawing objects), which are anchored
to paragraph or to character.
- OD 2004-03-16 #i11860#
+ #i11860#
@author OD
*/
@@ -887,8 +749,6 @@ void ViewShell::SetUseVirDev( bool bNewVirtual )
}
}
-// OD 2004-02-16 #106629# - control, if paragraph and table spacing is added
-// at bottom of table cells
void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -901,7 +761,7 @@ void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells
}
}
-// OD 06.01.2004 #i11859# - control, if former formatting of text lines with
+// #i11859# - control, if former formatting of text lines with
// proportional line spacing is used or not.
void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
{
@@ -915,7 +775,7 @@ void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
}
}
-// OD 2004-03-12 #i11860# - control, if former object positioning is used or not.
+// #i11860# - control, if former object positioning is used or not.
void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -927,7 +787,7 @@ void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
}
}
-// OD 2004-05-05 #i28701#
+// #i28701#
void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -939,7 +799,6 @@ void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
}
}
-// --> FME #108724#
void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -951,9 +810,8 @@ void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
lcl_InvalidateAllCntnt( *this, nInv );
}
}
-// <--
-// -> PB 2007-06-11 #i45491#
+// #i45491#
void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -965,25 +823,11 @@ void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWit
lcl_InvalidateAllCntnt( *this, nInv );
}
}
-// <--
-
-/******************************************************************************
-|*
-|* ViewShell::Reformat
-|*
-|* Ersterstellung BP ???
-|* Letzte Aenderung MA 13. Feb. 98
-|*
-******************************************************************************/
void ViewShell::Reformat()
{
SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
- // Wir gehen auf Nummer sicher:
- // Wir muessen die alten Fontinformationen wegschmeissen,
- // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert.
- // Init() und Reformat() sind die sichersten Stellen.
#ifdef FNTMET
aFntMetList.Flush();
#else
@@ -1007,26 +851,14 @@ void ViewShell::Reformat()
Reformat();
}
-/******************************************************************************
-|*
-|* ViewShell::CalcLayout()
-|* Vollstaendige Formatierung von Layout und Inhalt.
-|*
-|* Ersterstellung MA 31. Jan. 94
-|* Letzte Aenderung MA 08. Oct. 96
-|*
-******************************************************************************/
-
void ViewShell::CalcLayout()
{
SET_CURR_SHELL( this );
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 sal_Bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0;
if ( bEndProgress )
{
@@ -1044,8 +876,8 @@ void ViewShell::CalcLayout()
aAction.Action();
GetDoc()->UnlockExpFlds();
- //Das SetNewFldLst() am Doc wurde unterbunden und muss nachgeholt
- //werden (siehe flowfrm.cxx, txtfld.cxx)
+ // The SetNewFldLst() on Doc was stopped and has to be rescheduled
+ // (see flowfrm.cxx, txtfld.cxx)
if ( aAction.IsExpFlds() )
{
aAction.Reset();
@@ -1066,15 +898,6 @@ void ViewShell::CalcLayout()
::EndProgress( GetDoc()->GetDocShell() );
}
-/******************************************************************************
-|*
-|* ViewShell::SetFirstVisPageInvalid()
-|*
-|* Ersterstellung MA 19. May. 94
-|* Letzte Aenderung MA 19. May. 94
-|*
-******************************************************************************/
-
void ViewShell::SetFirstVisPageInvalid()
{
ViewShell *pSh = this;
@@ -1085,15 +908,6 @@ void ViewShell::SetFirstVisPageInvalid()
} while ( pSh != this );
}
-/******************************************************************************
-|*
-|* ViewShell::SizeChgNotify()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 17. Sep. 96
-|*
-******************************************************************************/
-
void ViewShell::SizeChgNotify()
{
if ( !pWin )
@@ -1122,32 +936,20 @@ void ViewShell::SizeChgNotify()
}
}
-/******************************************************************************
-|*
-|* ViewShell::VisPortChgd()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 22. Jul. 96
-|*
-******************************************************************************/
-
void ViewShell::VisPortChgd( const SwRect &rRect)
{
- ASSERT( GetWin(), "VisPortChgd ohne Window." );
+ OSL_ENSURE( GetWin(), "VisPortChgd ohne Window." );
if ( rRect == VisArea() )
return;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if ( bInEndAction )
{
- //Da Rescheduled doch schon wieder irgendwo einer?
- ASSERT( !this, "Scroll waehrend einer EndAction." );
+ OSL_ENSURE( !this, "Scroll waehrend einer EndAction." );
}
#endif
- //Ersteinmal die alte sichtbare Seite holen, dann braucht nacher nicht
- //lange gesucht werden.
const SwFrm *pOldPage = Imp()->GetFirstVisPage();
const SwRect aPrevArea( VisArea() );
@@ -1155,9 +957,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
aVisArea = rRect;
SetFirstVisPageInvalid();
- //Wenn noch eine PaintRegion herumsteht und sich die VisArea geaendert hat,
- //so ist die PaintRegion spaetestens jetzt obsolete. Die PaintRegion kann
- //vom RootFrm::Paint erzeugt worden sein.
+ // When there is still a PaintRegion and the VisArea has changed,
+ // Then the PaintRegion becomes obsolete. The PaintRegion can have been
+ // produced by RootFrm::Paint.
if ( !bInEndAction &&
Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
Imp()->DelRegion();
@@ -1172,16 +974,12 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
GetWin()->Invalidate();
else
{
- // Betrag ausrechnen, um den gescrolled werden muss.
const long nXDiff = aPrevArea.Left() - VisArea().Left();
const long nYDiff = aPrevArea.Top() - VisArea().Top();
if( !nXDiff && !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
(!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
{
- //Falls moeglich die Wiese nicht mit Scrollen.
- //Also linke und rechte Kante des Scrollbereiches auf die
- //Seiten begrenzen.
const SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower();
if ( pPage->Frm().Top() > pOldPage->Frm().Top() )
pPage = (SwPageFrm*)pOldPage;
@@ -1207,10 +1005,6 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
if ( aPageRect.IsOver( aBoth ) )
{
- // OD 12.02.2003 #i9719#, #105645# - consider new border
- // and shadow width
- const SwTwips nBorderWidth =
- GetOut()->PixelToLogic( Size( pPage->BorderPxWidth(), 0 ) ).Width();
const SwTwips nShadowWidth =
GetOut()->PixelToLogic( Size( pPage->ShadowPxWidth(), 0 ) ).Width();
@@ -1220,14 +1014,14 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
{
case sw::sidebarwindows::SIDEBAR_LEFT:
{
- nPageLeft = aPageRect.Left() - nBorderWidth - nSidebarWidth;
- nPageRight = aPageRect.Right() + nBorderWidth + nShadowWidth;
+ nPageLeft = aPageRect.Left() - nSidebarWidth;
+ nPageRight = aPageRect.Right() + nShadowWidth;
}
break;
case sw::sidebarwindows::SIDEBAR_RIGHT:
{
- nPageLeft = aPageRect.Left() - nBorderWidth;
- nPageRight = aPageRect.Right() + nBorderWidth + nShadowWidth + nSidebarWidth;
+ nPageLeft = aPageRect.Left();
+ nPageRight = aPageRect.Right() + nShadowWidth + nSidebarWidth;
}
break;
case sw::sidebarwindows::SIDEBAR_NONE:
@@ -1238,9 +1032,6 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
nMinLeft = nPageLeft;
if( nPageRight > nMaxRight )
nMaxRight = nPageRight;
- //Zus. auf die Zeichenobjekte abgleichen.
- //Einen Ofst beruecksichtigen, weil die Objekte u.U.
- //selektiert sind und die Henkel dann hinausstehen.
if ( pPage->GetSortedObjs() )
{
const long nOfst = GetOut()->PixelToLogic(
@@ -1250,7 +1041,6 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
const Rectangle &rBound = pObj->GetObjRect().SVRect();
- // OD 03.03.2003 #107927# - use correct datatype
const SwTwips nL = Max( 0L, rBound.Left() - nOfst );
if ( nL < nMinLeft )
nMinLeft = nL;
@@ -1275,7 +1065,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
else
GetWin()->Invalidate( aRect );
}
- else if ( !nLockPaint ) //Wird im UnLock erledigt
+ else if ( !nLockPaint )
{
if( VisArea().IsOver( aPrevArea ) )
{
@@ -1302,14 +1092,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
}
GetWin()->Update();
- // --> OD 2010-02-11 #i88070#
+ // #i88070#
if ( pPostItMgr )
{
pPostItMgr->Rescale();
pPostItMgr->CalcRects();
pPostItMgr->LayoutPostIts();
}
- // <--
if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
pPostItMgr->CorrectPositions();
@@ -1319,15 +1108,6 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
}
-/******************************************************************************
-|*
-|* ViewShell::SmoothScroll()
-|*
-|* Ersterstellung MA 04. Jul. 96
-|* Letzte Aenderung MA 25. Mar. 97
-|*
-******************************************************************************/
-
sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
{
const sal_uLong nColCnt = pOut->GetColorCount();
@@ -1351,7 +1131,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
// #i75172# isolated static conditions
const bool bOnlyYScroll(!lXDiff && Abs(lYDiff) != 0 && Abs(lYDiff) < lMax);
const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull());
-// --> OD 2009-08-12 #i98766# - disable smooth scrolling for Mac port builds
+// #i98766# - disable smooth scrolling for Mac port builds
#ifdef QUARTZ
const bool bSmoothScrollAllowed(false);
(void) bOnlyYScroll;
@@ -1359,7 +1139,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
#else
const bool bSmoothScrollAllowed(bOnlyYScroll && bEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
#endif
-// <-
+
const bool bIAmCursorShell(ISA(SwCrsrShell));
(void) bIAmCursorShell;
@@ -1375,7 +1155,6 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
const SwRect aOldVis( VisArea() );
- //Virtuelles Device erzeugen und einstellen.
const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
VirtualDevice *pVout = new VirtualDevice( *GetWin() );
pVout->SetLineColor( GetWin()->GetLineColor() );
@@ -1389,7 +1168,6 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
{
nLockPaint++;
- //Ersteinmal alles neue in das VirDev Painten.
SwRect aRect( VisArea() );
aRect.Height( aSize.Height() );
if ( pRect )
@@ -1441,31 +1219,11 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
// end paint and destroy ObjectContact again
DLPostPaint2(true);
pDrawView->DeleteWindowFromPaintView(pVout);
-
- // temporary debug paint checking...
- static bool bDoSaveForVisualControl(false);
- if(bDoSaveForVisualControl)
- {
- const bool bMapModeWasEnabledVDev(pVout->IsMapModeEnabled());
- pVout->EnableMapMode(false);
- const Bitmap aBitmap(pVout->GetBitmap(Point(), pVout->GetOutputSizePixel()));
- const String aTmpString(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8);
- SvFileStream aNew(aTmpString, STREAM_WRITE|STREAM_TRUNC);
- aNew << aBitmap;
- pVout->EnableMapMode(bMapModeWasEnabledVDev);
- }
}
pOut = pOld;
aVisArea = aOldVis;
- //Jetzt Stueckchenweise schieben und die neuen Pixel aus dem
- //VirDev kopieren.
-
- // ??????????????????????
- // or is it better to get the scrollfactor from the User
- // as option?
- // ??????????????????????
long lMaDelta = aPixSz.Height();
if ( Abs(lYDiff) > ( aVisArea.Height() / 3 ) )
lMaDelta *= 6;
@@ -1535,9 +1293,6 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
if(!Imp()->bStopSmooth)
{
- static bool bDoItOnPixels(true);
- if(bDoItOnPixels)
- {
// start paint on logic base
const Rectangle aTargetLogic(Imp()->aSmoothRect.SVRect());
DLPrePaint2(Region(aTargetLogic));
@@ -1555,21 +1310,6 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
rTargetDevice.EnableMapMode(false);
pVout->EnableMapMode(false);
- // copy content
- static bool bTestDirectToWindowPaint(false);
- if(bTestDirectToWindowPaint)
- {
- const bool bMapModeWasEnabledWin(GetWin()->IsMapModeEnabled());
- GetWin()->EnableMapMode(false);
-
- GetWin()->DrawOutDev(
- aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
- aSourceTopLeft, aTargetPixel.GetSize(), // source
- *pVout);
-
- GetWin()->EnableMapMode(bMapModeWasEnabledWin);
- }
-
rTargetDevice.DrawOutDev(
aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
aSourceTopLeft, aTargetPixel.GetSize(), // source
@@ -1581,34 +1321,6 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
// end paint on logoc base
DLPostPaint2(true);
- }
- else
- {
- Rectangle aRectangle(Imp()->aSmoothRect.SVRect());
- aRectangle.Left() -= aPixSz.Width();
- aRectangle.Right() += aPixSz.Width();
- aRectangle.Top() -= aPixSz.Height();
- aRectangle.Bottom() += aPixSz.Height();
- const Point aUpdateTopLeft(aRectangle.TopLeft());
- const Size aUpdateSize(aRectangle.GetSize());
-
- // #i75172# the part getting visible needs to be handled like a repaint.
- // For that, start with DLPrePaint2 and the correct Rectangle
- DLPrePaint2(Region(aRectangle));
-
- static bool bTestDirectToWindowPaint(false);
- if(bTestDirectToWindowPaint)
- {
- GetWin()->DrawOutDev(aUpdateTopLeft, aUpdateSize, aUpdateTopLeft, aUpdateSize, *pVout);
- }
-
- mpTargetPaintWindow->GetTargetOutputDevice().DrawOutDev(aUpdateTopLeft, aUpdateSize, aUpdateTopLeft, aUpdateSize, *pVout);
-
- // #i75172# Corret repaint end
- // Note: This also correcty creates the overlay, thus smooth scroll will
- // also be allowed now wth selection (see big IF above)
- DLPostPaint2(true);
- }
}
else
--nLockPaint;
@@ -1633,24 +1345,10 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
return sal_False;
}
-/******************************************************************************
-|*
-|* ViewShell::PaintDesktop()
-|*
-|* Ersterstellung MA 16. Dec. 93
-|* Letzte Aenderung MA 30. Nov. 95
-|*
-******************************************************************************/
-
void ViewShell::PaintDesktop( const SwRect &rRect )
{
if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
- return; //Fuer den Drucker tun wir hier nix
-
- //Sonderfaelle abfangen, damit es nicht gar so ueberraschend aussieht.
- //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.
+ return;
sal_Bool bBorderOnly = sal_False;
const SwRootFrm *pRoot = GetDoc()->GetRootFrm();
if ( rRect.Top() > pRoot->Frm().Bottom() )
@@ -1666,7 +1364,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
SwRegionRects aRegion( rRect );
- //mod #i6193: remove sidebar area to avoid flickering
+ //#i6193: remove sidebar area to avoid flickering
const SwPostItMgr* pPostItMgr = GetPostItMgr();
const SwTwips nSidebarWidth = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ?
pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() :
@@ -1698,9 +1396,9 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
{
const SwFrm *pPage = Imp()->GetFirstVisPage();
const SwTwips nBottom = rRect.Bottom();
- //const SwTwips nRight = rRect.Right();
+
while ( pPage && aRegion.Count() &&
- (pPage->Frm().Top() <= nBottom) ) // PAGES01 && (pPage->Frm().Left() <= nRight))
+ (pPage->Frm().Top() <= nBottom) )
{
SwRect aPageRect( pPage->Frm() );
if ( bBookMode )
@@ -1724,11 +1422,8 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
_PaintDesktop( aRegion );
}
-
-// PaintDesktop gesplittet, dieser Teil wird auch von PreViewPage benutzt
void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
{
- // OD 2004-04-23 #116347#
GetOut()->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
GetOut()->SetLineColor();
@@ -1777,15 +1472,6 @@ void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
GetOut()->Pop();
}
-/******************************************************************************
-|*
-|* ViewShell::CheckInvalidForPaint()
-|*
-|* Ersterstellung MA 19. May. 94
-|* Letzte Aenderung MA 09. Jun. 94
-|*
-******************************************************************************/
-
sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
{
if ( !GetWin() )
@@ -1826,8 +1512,6 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
SwRegionRects *pRegion = Imp()->GetRegion();
if ( pRegion && aAction.IsBrowseActionStop() )
{
- //Nur dann interessant, wenn sich im sichtbaren Bereich etwas
- //veraendert hat.
sal_Bool bStop = sal_True;
for ( sal_uInt16 i = 0; i < pRegion->Count(); ++i )
{
@@ -1844,7 +1528,7 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
if ( pRegion )
{
- //Erst Invert dann Compress, niemals andersherum!
+ //First Invert, then Compress, never the other way round!
pRegion->Invert();
pRegion->Compress();
bRet = sal_False;
@@ -1890,15 +1574,6 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
return bRet;
}
-/******************************************************************************
-|*
-|* ViewShell::Paint()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 17. Sep. 96
-|*
-******************************************************************************/
-
void ViewShell::Paint(const Rectangle &rRect)
{
if ( nLockPaint )
@@ -1926,7 +1601,7 @@ void ViewShell::Paint(const Rectangle &rRect)
return;
}
- //MA 30. Jul. 95: fix(16787): mit !nStartAction versuche ich mal mich gegen
+ // mit !nStartAction versuche ich mal mich gegen
//fehlerhaften Code an anderen Stellen zu wehren. Hoffentlich fuehrt das
//nicht zu Problemen!?
if ( bPaintWorks && !nStartAction )
@@ -1965,34 +1640,23 @@ void ViewShell::Paint(const Rectangle &rRect)
}
else
{
- //SwSaveHdl *pSaveHdl = 0;
- //if ( Imp()->HasDrawView() )
- // pSaveHdl = new SwSaveHdl( Imp() );
-
- //Wenn eine der sichtbaren Seiten noch irgendetwas zum Repaint
- //angemeldet hat, so muessen Repaints ausgeloest werden.
if ( !CheckInvalidForPaint( aRect ) )
{
- // --> OD 2009-08-12 #i101192#
- // start Pre/PostPaint encapsulation to avoid screen blinking
+ // #i101192# start Pre/PostPaint encapsulation to avoid screen blinking
const Region aRepaintRegion(aRect.SVRect());
DLPrePaint2(aRepaintRegion);
- // <--
+
PaintDesktop( aRect );
- //Falls sinnvoll gleich das alte InvalidRect verarbeiten bzw.
- //vernichten.
+
if ( aRect.IsInside( aInvalidRect ) )
ResetInvalidRect();
ViewShell::bLstAct = sal_True;
GetLayout()->Paint( aRect );
ViewShell::bLstAct = sal_False;
- // --> OD 2009-08-12 #i101192#
- // end Pre/PostPaint encapsulation
+ // #i101192# end Pre/PostPaint encapsulation
DLPostPaint2(true);
- // <--
- }
- //delete pSaveHdl;
+ }
}
SwRootFrm::SetNoVirDev( sal_False );
bPaintInProgress = sal_False;
@@ -2022,7 +1686,6 @@ void ViewShell::Paint(const Rectangle &rRect)
const Region aDLRegion(rRect);
DLPrePaint2(aDLRegion);
- // OD 2004-04-23 #116347#
pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
pOut->SetFillColor( Imp()->GetRetoucheColor() );
pOut->SetLineColor();
@@ -2035,15 +1698,6 @@ void ViewShell::Paint(const Rectangle &rRect)
}
}
-/******************************************************************************
-|*
-|* ViewShell::SetBrowseBorder()
-|*
-|* Ersterstellung AMA 20. Aug. 96
-|* Letzte Aenderung AMA 20. Aug. 96
-|*
-******************************************************************************/
-
void ViewShell::SetBrowseBorder( const Size& rNew )
{
if( rNew != aBrowseBorder )
@@ -2073,15 +1727,6 @@ sal_Int32 ViewShell::GetBrowseWidth() const
return aVisArea.Width() - 2 * GetOut()->PixelToLogic(aBrowseBorder).Width();
}
-/******************************************************************************
-|*
-|* ViewShell::CheckBrowseView()
-|*
-|* Ersterstellung MA 04. Mar. 96
-|* Letzte Aenderung MA 04. Jul. 96
-|*
-******************************************************************************/
-
void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
{
if ( !bBrowseChgd &&
@@ -2090,7 +1735,7 @@ void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
SET_CURR_SHELL( this );
- ASSERT( GetLayout(), "Layout not ready" );
+ OSL_ENSURE( GetLayout(), "Layout not ready" );
// Wenn das Layout noch nicht einmal eine Hoehe hat,
// ist sowieso nichts formatiert.
@@ -2141,16 +1786,6 @@ void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
UnlockPaint();
}
-/*************************************************************************
-|*
-|* ViewShell::GetLayout()
-|* ViewShell::GetNodes()
-|*
-|* Ersterstellung OK 26. May. 92
-|* Letzte Aenderung MA 16. Sep. 93
-|*
-*************************************************************************/
-
SwRootFrm *ViewShell::GetLayout() const
{
return GetDoc()->GetRootFrm();
@@ -2198,15 +1833,6 @@ SfxItemPool& ViewShell::GetAttrPool()
return GetDoc()->GetAttrPool();
}
-/******************************************************************************
-|*
-|* ViewShell::ApplyViewOptions(), ImplApplyViewOptions()
-|*
-|* Ersterstellung ??
-|* Letzte Aenderung MA 03. Mar. 98
-|*
-******************************************************************************/
-
void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
{
@@ -2218,7 +1844,7 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
ImplApplyViewOptions( rOpt );
- //Einige Aenderungen muessen synchronisiert werden.
+ //Some changes have to be synchronized
pSh = (ViewShell*)this->GetNext();
while ( pSh != this )
{
@@ -2251,7 +1877,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
Window *pMyWin = GetWin();
if( !pMyWin )
{
- ASSERT( pMyWin, "ViewShell::ApplyViewOptions: no window" );
+ OSL_ENSURE( pMyWin, "ViewShell::ApplyViewOptions: no window" );
return;
}
@@ -2342,7 +1968,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
sal_Bool bOnlineSpellChgd = pOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
- *pOpt = rOpt; // Erst jetzt werden die Options uebernommen.
+ *pOpt = rOpt;
pOpt->SetUIOptions(rOpt);
pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode(pDoc->GetDocShell()));
@@ -2372,15 +1998,6 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
}
-/******************************************************************************
-|*
-|* ViewShell::SetUIOptions()
-|*
-|* Ersterstellung OS 29.07.96
-|* Letzte Aenderung OS 29.07.96
-|*
-******************************************************************************/
-
void ViewShell::SetUIOptions( const SwViewOption &rOpt )
{
pOpt->SetUIOptions(rOpt);
@@ -2392,24 +2009,10 @@ void ViewShell::SetUIOptions( const SwViewOption &rOpt )
pOpt->SetSymbolFont(rOpt.GetSymbolFont());
}
-/******************************************************************************
-|*
-|* ViewShell::SetReadonly()
-|*
-|* Ersterstellung OS 05.09.96
-|* Letzte Aenderung MA 12. Feb. 97
-|*
-******************************************************************************/
-
void ViewShell::SetReadonlyOption(sal_Bool bSet)
{
- //JP 01.02.99: bei ReadOnly Flag richtig abfragen und ggfs. neu
- // formatieren; Bug 61335
-
- // Schalten wir gerade von Readonly auf Bearbeiten um?
if( bSet != pOpt->IsReadonly() )
{
- // damit die Flags richtig erfragt werden koennen.
pOpt->SetReadonly( sal_False );
sal_Bool bReformat = pOpt->IsFldName();
@@ -2430,9 +2033,7 @@ void ViewShell::SetReadonlyOption(sal_Bool bSet)
Imp()->InvalidateAccessibleEditableState( sal_False );
}
}
-/* -----------------28.08.2003 15:45-----------------
- --------------------------------------------------*/
void ViewShell::SetPDFExportOption(sal_Bool bSet)
{
if( bSet != pOpt->IsPDFExport() )
@@ -2443,9 +2044,7 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet)
pOpt->SetPDFExport(bSet);
}
}
-/* -----------------------------2002/07/31 17:06------------------------------
- ---------------------------------------------------------------------------*/
void ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
{
if( bSet != pOpt->IsSelectionInReadonly() )
@@ -2453,30 +2052,12 @@ void ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
pOpt->SetSelectionInReadonly(bSet);
}
}
-/******************************************************************************
-|*
-|* ViewShell::SetPrtFormatOption()
-|*
-|* Ersterstellung AMA 10. Sep. 97
-|* Letzte Aenderung AMA 10. Sep. 97
-|*
-******************************************************************************/
void ViewShell::SetPrtFormatOption( sal_Bool bSet )
{
pOpt->SetPrtFormat( bSet );
}
-/******************************************************************************
-|*
-|* ViewShell::UISizeNotify()
-|*
-|* Ersterstellung MA 14. Jan. 97
-|* Letzte Aenderung MA 14. Jan. 97
-|*
-******************************************************************************/
-
-
void ViewShell::UISizeNotify()
{
if ( bDocSizeChgd )
@@ -2512,8 +2093,8 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create
SwDoc *pMyDoc = GetDoc();
// We require a layout and an XModel to be accessible.
- ASSERT( pMyDoc->GetRootFrm(), "no layout, no access" );
- ASSERT( GetWin(), "no window, no access" );
+ OSL_ENSURE( pMyDoc->GetRootFrm(), "no layout, no access" );
+ OSL_ENSURE( GetWin(), "no window, no access" );
if( pMyDoc->GetRootFrm() && GetWin() )
xAcc = Imp()->GetAccessibleMap().GetDocumentView();
@@ -2528,13 +2109,11 @@ ViewShell::CreateAccessiblePreview()
"Can't create accessible preview for non-preview ViewShell" );
// We require a layout and an XModel to be accessible.
- ASSERT( pDoc->GetRootFrm(), "no layout, no access" );
- ASSERT( GetWin(), "no window, no access" );
+ OSL_ENSURE( pDoc->GetRootFrm(), "no layout, no access" );
+ OSL_ENSURE( GetWin(), "no window, no access" );
- // OD 15.01.2003 #103492# - add condition <IsPreView()>
if ( IsPreView() && pDoc->GetRootFrm() && GetWin() )
{
- // OD 14.01.2003 #103492# - adjustment for new method signature
return Imp()->GetAccessibleMap().GetDocumentPreview(
PagePreviewLayout()->maPrevwPages,
GetWin()->GetMapMode().GetScaleX(),
@@ -2550,12 +2129,7 @@ void ViewShell::InvalidateAccessibleFocus()
Imp()->GetAccessibleMap().InvalidateFocus();
}
-/** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
-
- OD 2005-12-01 #i27138#
-
- @author OD
-*/
+// #i27138# invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
void ViewShell::InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
const SwTxtFrm* _pToTxtFrm )
{
@@ -2565,12 +2139,7 @@ void ViewShell::InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtF
}
}
-/** invalidate text selection for paragraphs
-
- OD 2005-12-12 #i27301#
-
- @author OD
-*/
+// #i27301# invalidate text selection for paragraphs
void ViewShell::InvalidateAccessibleParaTextSelection()
{
if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
@@ -2579,12 +2148,7 @@ void ViewShell::InvalidateAccessibleParaTextSelection()
}
}
-/** invalidate attributes for paragraphs
-
- OD 2009-01-06 #i88069#
-
- @author OD
-*/
+// #i88069# invalidate attributes for paragraphs
void ViewShell::InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
{
if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
@@ -2602,9 +2166,6 @@ SwAccessibleMap* ViewShell::GetAccessibleMap()
return 0;
}
-/* -----------------------------06.05.2002 13:23------------------------------
-
- ---------------------------------------------------------------------------*/
void ViewShell::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
{
if(pOpt->IsPagePreview() && !rAccessibilityOptions.GetIsForPagePreviews())
@@ -2619,7 +2180,7 @@ void ViewShell::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibility
pAccOptions->SetStopAnimatedGraphics(! rAccessibilityOptions.GetIsAllowAnimatedGraphics());
pAccOptions->SetStopAnimatedText(! rAccessibilityOptions.GetIsAllowAnimatedText());
- // --> FME 2004-06-29 #114856# Formular view
+ // Formular view
// Always set this option, not only if document is read-only:
pOpt->SetSelectionInReadonly(rAccessibilityOptions.IsSelectionInReadonly());
}
@@ -2636,22 +2197,21 @@ void ViewShell::SetCareWin( Window* pNew )
}
-// --> FME 2004-06-15 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
{
- ASSERT( GetLayout(), "GetPageNumAndSetOffsetForPDF assumes presence of layout" )
+ OSL_ENSURE( GetLayout(), "GetPageNumAndSetOffsetForPDF assumes presence of layout" );
sal_Int32 nRet = -1;
- // --> FME 2005-01-07 #i40059# Position out of bounds:
+ // #i40059# Position out of bounds
SwRect aRect( rRect );
aRect.Pos().X() = Max( aRect.Left(), GetLayout()->Frm().Left() );
- // <--
const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aRect.Center() );
if ( pPage )
{
- ASSERT( pPage, "GetPageNumAndSetOffsetForPDF: No page found" )
+ OSL_ENSURE( pPage, "GetPageNumAndSetOffsetForPDF: No page found" );
Point aOffset( pPage->Frm().Pos() );
aOffset.X() = -aOffset.X();
@@ -2666,32 +2226,25 @@ sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwR
return nRet;
}
-// <--
-// --> PB 2007-05-30 #146850#
const BitmapEx& ViewShell::GetReplacementBitmap( bool bIsErrorState )
{
BitmapEx** ppRet;
- sal_uInt16 nResId = 0, nHCResId = 0;
+ sal_uInt16 nResId = 0;
if( bIsErrorState )
{
ppRet = &pErrorBmp;
nResId = RID_GRAPHIC_ERRORBMP;
- nHCResId = RID_GRAPHIC_ERRORBMP_HC;
}
else
{
ppRet = &pReplaceBmp;
nResId = RID_GRAPHIC_REPLACEBMP;
- nHCResId = RID_GRAPHIC_REPLACEBMP_HC;
}
if( !*ppRet )
{
- sal_uInt16 nBmpResId =
- Application::GetSettings().GetStyleSettings().GetHighContrastMode()
- ? nHCResId : nResId;
- *ppRet = new BitmapEx( SW_RES( nBmpResId ) );
+ *ppRet = new BitmapEx( SW_RES( nResId ) );
}
return **ppRet;
}
@@ -2701,7 +2254,6 @@ void ViewShell::DeleteReplacementBitmaps()
DELETEZ( pErrorBmp );
DELETEZ( pReplaceBmp );
}
-// <--
SwPostItMgr* ViewShell::GetPostItMgr()
{
@@ -2737,7 +2289,7 @@ IDocumentUndoRedo & ViewShell::GetIDocumentUndoRedo()
IDocumentUndoRedo const& ViewShell::GetIDocumentUndoRedo() const
{ return pDoc->GetIDocumentUndoRedo(); }
-// --> OD 2007-11-14 #i83479#
+// #i83479#
const IDocumentListItems* ViewShell::getIDocumentListItemsAccess() const
{
return pDoc;
@@ -2746,4 +2298,5 @@ const IDocumentOutlineNodes* ViewShell::getIDocumentOutlineNodesAccess() const
{
return pDoc;
}
-// <--
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index bc454c4b0e7b..56ab8dd12671 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,48 +39,31 @@
#include <rootfrm.hxx>
#include <viewimp.hxx>
#include <viewopt.hxx>
-#include <txtfrm.hxx> // Zugriff auf TxtCache
+#include <txtfrm.hxx>
#include <notxtfrm.hxx>
#include <fntcache.hxx>
#include <docufld.hxx>
#include <ptqueue.hxx>
-#include <dview.hxx> // SdrView
+#include <dview.hxx>
#include <ndgrf.hxx>
#include <ndindex.hxx>
#include <accessibilityoptions.hxx>
-
-/*************************************************************************
-|*
-|* ViewShell::Init()
-|*
-|* Letzte Aenderung MA 14. Jun. 96
-|*
-|*************************************************************************/
-
void ViewShell::Init( const SwViewOption *pNewOpt )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::Init" );
bDocSizeChgd = sal_False;
- // Wir gehen auf Nummer sicher:
- // Wir muessen die alten Fontinformationen wegschmeissen,
- // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert.
- // Init() und Reformat() sind die sichersten Stellen.
pFntCache->Flush( );
- // ViewOptions werden dynamisch angelegt
if( !pOpt )
{
pOpt = new SwViewOption;
- // Ein ApplyViewOptions braucht nicht gerufen zu werden
if( pNewOpt )
{
*pOpt = *pNewOpt;
- // Der Zoomfaktor muss eingestellt werden, weil in der CTOR-
- // phase aus Performancegruenden kein ApplyViewOptions gerufen wird.
if( GetWin() && 100 != pOpt->GetZoom() )
{
MapMode aMode( pWin->GetMapMode() );
@@ -94,35 +78,27 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
SwDocShell* pDShell = pDoc->GetDocShell();
pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode( pDShell ) );
- // JP 02.02.99: Bug 61335 - Readonly-Flag an den ViewOptions setzen,
- // bevor das Layout angelegt wird. Ansonsten muesste man
- // nochmals durchformatieren!!
if( pDShell && pDShell->IsReadOnly() )
pOpt->SetReadonly( sal_True );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "View::Init - before InitPrt" );
- // --> FME 2007-11-06 #i82967#
+ // #i82967#
OutputDevice* pPDFOut = 0;
+
if ( pOut && pOut->GetPDFWriter() )
pPDFOut = pOut;
- // <--
-
- // --> FME 2005-01-21 #i41075#
- // Only setup the printer if we need one:
+ // #i41075# Only setup the printer if we need one:
const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE);
if( pPDFOut )
InitPrt( pPDFOut );
- // <--
-
- // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
- // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
+ // #i44963# Good occasion to check if page sizes in page descriptions
+ // are still set to (LONG_MAX, LONG_MAX) (html import)
if ( !bBrowseMode )
{
pDoc->CheckDefaultPageFmt();
}
- // <--
RTL_LOGFILE_CONTEXT_TRACE( aLog, "View::Init - after InitPrt" );
@@ -141,7 +117,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
SizeChgNotify();
- // --> #i31958#
+ // #i31958#
// XForms mode: initialize XForms mode, based on design mode (draw view)
// MakeDrawView() requires layout
if( GetDoc()->isXForms() )
@@ -150,17 +126,8 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
MakeDrawView();
pOpt->SetFormView( ! GetDrawView()->IsDesignMode() );
}
- // <-- #i31958#
}
-/*************************************************************************
-|*
-|* ViewShell::ViewShell() CTor fuer die erste Shell.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
-|*************************************************************************/
-
ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
const SwViewOption *pNewOpt, OutputDevice *pOutput,
long nFlags )
@@ -175,18 +142,18 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
mpTmpRef( 0 ),
pOpt( 0 ),
pAccOptions( new SwAccessibilityOptions ),
- mpTargetPaintWindow(0), // #i74769#
- mpBufferedOut(0), // #i74769#
+ mpTargetPaintWindow(0),
+ mpBufferedOut(0),
pDoc( &rDocument ),
nStartAction( 0 ),
nLockPaint( 0 ),
- mnPrePostPaintCount(0L), // #i72754#
- mpPrePostOutDev(0), // #i72754#
+ mnPrePostPaintCount(0L),
+ mpPrePostOutDev(0),
maPrePostMapMode()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
- // OD 2004-06-01 #i26791# - in order to suppress event handling in
+ // #i26791# in order to suppress event handling in
// <SwDrawContact::Changed> during contruction of <ViewShell> instance
mbInConstructor = true;
@@ -195,20 +162,17 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
bPaintWorks = bEnableSmooth = sal_True;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
- // --> OD 2005-02-11 #i38810# - Do not reset modified state of document,
- // if it's already been modified.
+ // #i38810# Do not reset modified state of document, if it's already been modified.
const bool bIsDocModified( pDoc->IsModified() );
// <--
pDoc->acquire();
pOutput = pOut;
- Init( pNewOpt ); //verstellt ggf. das Outdev (InitPrt())
+ Init( pNewOpt );
pOut = pOutput;
- // OD 28.03.2003 #108470# - initialize print preview layout after layout
- // is created in <ViewShell::Init(..)> - called above.
+ // initialize print preview layout after layout is created in <ViewShell::Init(..)> - called above.
if ( bPreView )
{
- // OD 12.12.2002 #103492# - init page preview layout
pImp->InitPagePreviewLayout();
}
@@ -217,33 +181,22 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !pOpt->IsShowHiddenField() );
- //In Init wird ein Standard-FrmFmt angelegt.
- // --> OD 2005-02-11 #i38810#
+ // #i38810#
if ( !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified()
&& !bIsDocModified )
- // <--
{
pDoc->ResetModified();
}
- //Format-Cache erweitern.
if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
SwTxtFrm::GetTxtCache()->IncreaseMax( 100 );
if( pOpt->IsGridVisible() || getIDocumentDrawModelAccess()->GetDrawModel() )
Imp()->MakeDrawView();
- // OD 2004-06-01 #i26791#
+ // #i26791#
mbInConstructor = false;
}
-/*************************************************************************
-|*
-|* ViewShell::ViewShell() CTor fuer weitere Shells auf ein Dokument.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
-|*************************************************************************/
-
ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
OutputDevice *pOutput, long nFlags ) :
Ring( &rShell ),
@@ -257,18 +210,18 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
mpTmpRef( 0 ),
pOpt( 0 ),
pAccOptions( new SwAccessibilityOptions ),
- mpTargetPaintWindow(0), // #i74769#
- mpBufferedOut(0), // #i74769#
+ mpTargetPaintWindow(0),
+ mpBufferedOut(0),
pDoc( rShell.GetDoc() ),
nStartAction( 0 ),
nLockPaint( 0 ),
- mnPrePostPaintCount(0L), // #i72754#
- mpPrePostOutDev(0), // #i72754#
+ mnPrePostPaintCount(0L),
+ mpPrePostOutDev(0),
maPrePostMapMode()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "ViewShell::SwViewShell" );
- // OD 2004-06-01 #i26791# - in order to suppress event handling in
+ // #i26791# in order to suppress event handling in
// <SwDrawContact::Changed> during contruction of <ViewShell> instance
mbInConstructor = true;
@@ -276,7 +229,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
bEndActionByVirDev = sal_False;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
- // OD 12.12.2002 #103492#
+
if ( bPreView )
pImp->InitPagePreviewLayout();
@@ -286,45 +239,34 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
sal_Bool bModified = pDoc->IsModified();
pOutput = pOut;
- Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt())
+ Init( rShell.GetViewOptions() );
pOut = pOutput;
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !pOpt->IsShowHiddenField() );
- // in Init wird ein Standard-FrmFmt angelegt
if( !bModified && !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified() )
{
pDoc->ResetModified();
}
- //Format-Cache erweitern.
if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
SwTxtFrm::GetTxtCache()->IncreaseMax( 100 );
if( pOpt->IsGridVisible() || getIDocumentDrawModelAccess()->GetDrawModel() )
Imp()->MakeDrawView();
- // OD 2004-06-01 #i26791#
+ // #i26791#
mbInConstructor = false;
}
-/******************************************************************************
-|*
-|* ViewShell::~ViewShell()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 10. May. 95
-|*
-******************************************************************************/
-
ViewShell::~ViewShell()
{
{
SET_CURR_SHELL( this );
bPaintWorks = sal_False;
- // FME 2004-06-21 #i9684# Stopping the animated graphics is not
+ // #i9684#Stopping the animated graphics is not
// necessary during printing or pdf export, because the animation
// has not been started in this case.
if( pDoc && GetWin() )
@@ -345,7 +287,7 @@ ViewShell::~ViewShell()
for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
pFrm; pFrm = (SwFrm*)aIter.Next() )
{
- ASSERT( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" );
+ OSL_ENSURE( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" );
((SwNoTxtFrm*)pFrm)->StopAnimation( pOut );
}
}
@@ -356,7 +298,7 @@ ViewShell::~ViewShell()
GetDoc()->StopNumRuleAnimations( pOut );
}
- delete pImp; //Erst loeschen, damit die LayoutViews vernichtet werden.
+ delete pImp;
pImp = 0; // Set to zero, because ~SwFrm relies on it.
if ( pDoc )
@@ -369,14 +311,12 @@ ViewShell::~ViewShell()
delete pOpt;
- //Format-Cache zurueckschrauben.
if ( SwTxtFrm::GetTxtCache()->GetCurMax() > 250 )
SwTxtFrm::GetTxtCache()->DecreaseMax( 100 );
- //Ggf. aus der PaintQueue entfernen lassen
SwPaintQueue::Remove( this );
- ASSERT( !nStartAction, "EndAction() pending." );
+ OSL_ENSURE( !nStartAction, "EndAction() pending." );
}
if ( pDoc )
@@ -407,3 +347,5 @@ SdrView* ViewShell::GetDrawViewWithValidMarkList()
pDView->ValidateMarkList();
return pDView;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 74cbdf946800..ad2f92b9c1f6 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/**************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/view/XRenderable.hpp>
#include <hintids.hxx>
@@ -74,21 +74,19 @@
#include <viewopt.hxx>
#include <printdata.hxx> // SwPrintData
#include <pagedesc.hxx>
-#include <poolfmt.hxx> // fuer RES_POOLPAGE_JAKET
-#include <mdiexp.hxx> // Ansteuern der Statusleiste
-#include <statstr.hrc> // -- " --
+#include <poolfmt.hxx>
+#include <mdiexp.hxx>
+#include <statstr.hrc>
#include <ptqueue.hxx>
#include <tabfrm.hxx>
-#include <txtfrm.hxx> // MinPrtLine
-#include <viscrs.hxx> // SwShellCrsr
+#include <txtfrm.hxx> // MinPrtLine
+#include <viscrs.hxx> // SwShellCrsr
#include <fmtpdsc.hxx> // SwFmtPageDesc
#include <globals.hrc>
using namespace ::com::sun::star;
-//--------------------------------------------------------------------
-//Klasse zum Puffern von Paints
class SwQueuedPaint
{
public:
@@ -194,16 +192,9 @@ void SwPaintQueue::Remove( ViewShell *pSh )
}
}
-/******************************************************************************
- * Methode : void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ...
- * Beschreibung:
- * Erstellt : OK 04.11.94 16:27
- * Aenderung :
- ******************************************************************************/
-
void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, sal_Bool /*bPDFExport*/ )
{
- ASSERT( !pSh->GetWin(), "Drucken mit Window?" );
+ OSL_ENSURE( !pSh->GetWin(), "Drucken mit Window?" );
pSh->aVisArea = rRect;
pSh->Imp()->SetFirstVisPageInvalid();
Point aPt( rRect.Pos() );
@@ -248,16 +239,9 @@ void ViewShell::InitPrt( OutputDevice *pOutDev )
pOut = pOutDev; //Oder was sonst?
}
-/******************************************************************************
- * Methode : void ViewShell::ChgAllPageOrientation
- * Erstellt : MA 08. Aug. 95
- * Aenderung :
- ******************************************************************************/
-
-
void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
{
- ASSERT( nStartAction, "missing an Action" );
+ OSL_ENSURE( nStartAction, "missing an Action" );
SET_CURR_SHELL( this );
sal_uInt16 nAll = GetDoc()->GetPageDescCnt();
@@ -278,10 +262,6 @@ void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
aNew.SetLandscape( bNewOri );
SwFrmFmt& rFmt = aNew.GetMaster();
SwFmtFrmSize aSz( rFmt.GetFrmSize() );
- // Groesse anpassen.
- // PORTRAIT -> Hoeher als Breit
- // LANDSCAPE -> Breiter als Hoch
- // Hoehe ist die VarSize, Breite ist die FixSize (per Def.)
if( bNewOri ? aSz.GetHeight() > aSz.GetWidth()
: aSz.GetHeight() < aSz.GetWidth() )
{
@@ -295,16 +275,9 @@ void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
}
}
-/******************************************************************************
- * Methode : void ViewShell::ChgAllPageOrientation
- * Erstellt : MA 08. Aug. 95
- * Aenderung :
- ******************************************************************************/
-
-
void ViewShell::ChgAllPageSize( Size &rSz )
{
- ASSERT( nStartAction, "missing an Action" );
+ OSL_ENSURE( nStartAction, "missing an Action" );
SET_CURR_SHELL( this );
SwDoc* pMyDoc = GetDoc();
@@ -342,7 +315,6 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
SET_CURR_SHELL( this );
SwRootFrm* pLayout = GetLayout();
- // sal_uLong nStatMax = pLayout->GetPageNum();
const SwFrm *pPage = pLayout->Lower();
SwLayAction aAction( pLayout, Imp() );
@@ -361,9 +333,9 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
aAction.Action();
- aVisArea = aOldVis; //Zuruecksetzen wg. der Paints!
+ aVisArea = aOldVis;
Imp()->SetFirstVisPageInvalid();
-// SwPaintQueue::Repaint();
+
}
pLayout->EndAllAction();
}
@@ -372,17 +344,12 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
{
- ASSERT( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only");
+ OSL_ENSURE( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only");
SwFEShell* pFESh = (SwFEShell*)this;
- // Wir bauen uns ein neues Dokument
-// SwDoc *pPrtDoc = new SwDoc;
-// pPrtDoc->acquire();
-// pPrtDoc->SetRefForDocShell( (SvEmbeddedObjectRef*)&(long&)rDocShellRef );
pPrtDoc->LockExpFlds();
- // Der Drucker wird uebernommen
- //! Make a copy of it since it gets destroyed with the temporary document
- //! used for PDF export
+ // Make a copy of it since it gets destroyed with the temporary document
+ // used for PDF export
if (pPrt)
pPrtDoc->setPrinter( new SfxPrinter(*pPrt), true, true );
@@ -392,19 +359,15 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) )
pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem );
- // JP 29.07.99 - Bug 67951 - set all Styles from the SourceDoc into
- // the PrintDoc - will be replaced!
pPrtDoc->ReplaceStyles( *GetDoc() );
SwShellCrsr *pActCrsr = pFESh->_GetCrsr();
SwShellCrsr *pFirstCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetNext());
- if( !pActCrsr->HasMark() ) // bei Multiselektion kann der aktuelle Cursor leer sein
+ if( !pActCrsr->HasMark() )
{
pActCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetPrev());
}
- // Die Y-Position der ersten Selektion
- // Die Y-Position der ersten Selektion
Point aSelPoint;
if( pFESh->IsTableMode() )
{
@@ -426,33 +389,28 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
}
const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint );
- ASSERT( pPage, "no page found!" );
+ OSL_ENSURE( pPage, "no page found!" );
// get page descriptor - fall back to the first one if pPage could not be found
const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName(
pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 );
if( !pFESh->IsTableMode() && pActCrsr->HasMark() )
- { // Am letzten Absatz die Absatzattribute richten:
+ {
SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
SwTxtNode* pTxtNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx )->GetTxtNode();
SwCntntNode *pLastNd =
pActCrsr->GetCntntNode( (*pActCrsr->GetMark()) <= (*pActCrsr->GetPoint()) );
- // Hier werden die Absatzattribute des ersten Absatzes uebertragen
+
if( pLastNd && pLastNd->IsTxtNode() )
((SwTxtNode*)pLastNd)->CopyCollFmt( *pTxtNd );
}
- // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!)
-//REMOVE // if( aDocShellRef.Is() )
-//REMOVE // SwDataExchange::InitOle( aDocShellRef, pPrtDoc );
- // und fuellen es mit dem selektierten Bereich
pFESh->Copy( pPrtDoc );
- //Jetzt noch am ersten Absatz die Seitenvorlage setzen
{
SwNodeIndex aNodeIdx( *pPrtDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
- SwCntntNode* pCNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx ); // gehe zum 1. ContentNode
+ SwCntntNode* pCNd = pPrtDoc->GetNodes().GoNext( &aNodeIdx );
if( pFESh->IsTableMode() )
{
SwTableNode* pTNd = pCNd->FindTableNode();
@@ -469,7 +427,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
{
SwCntntNode *pFirstNd =
pFirstCrsr->GetCntntNode( (*pFirstCrsr->GetMark()) > (*pFirstCrsr->GetPoint()) );
- // Hier werden die Absatzattribute des ersten Absatzes uebertragen
+
if( pFirstNd && pFirstNd->IsTxtNode() )
((SwTxtNode*)pFirstNd)->CopyCollFmt( *pTxtNd );
}
@@ -485,9 +443,6 @@ sal_Bool ViewShell::PrintOrPDFExport(
SwPrintData const& rPrintData,
sal_Int32 nRenderer /* the index in the vector of pages to be printed */ )
{
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//Immer die Druckroutinen in viewpg.cxx (PrintProspect) mitpflegen!!
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagesToPrint().size() - 1;
#if OSL_DEBUG_LEVEL > 1
@@ -500,7 +455,6 @@ sal_Bool ViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Push();
- // eine neue Shell fuer den Printer erzeugen
ViewShell *pShell;
SwDoc *pOutDevDoc;
@@ -520,12 +474,10 @@ sal_Bool ViewShell::PrintOrPDFExport(
pDrawView->SetBufferedOverlayAllowed( false );
}
- { //Zusaetzlicher Scope, damit die CurrShell vor dem zerstoeren der
- //Shell zurueckgesetzt wird.
-
+ {
SET_CURR_SHELL( pShell );
- //JP 01.02.99: das ReadOnly Flag wird NIE mitkopiert; Bug 61335
+
if( pOpt->IsReadonly() )
pShell->pOpt->SetReadonly( sal_True );
@@ -563,7 +515,6 @@ sal_Bool ViewShell::PrintOrPDFExport(
// FIXME disabled because rPrintData.aOffset is always (0,0)
#if 0
- // wenn wir einen Umschlag drucken wird ein Offset beachtet
if( pStPage->GetFmt()->GetPoolFmtId() == RES_POOLPAGE_JAKET )
{
Point aNewOrigin = pOutDev->GetMapMode().GetOrigin();
@@ -583,7 +534,7 @@ sal_Bool ViewShell::PrintOrPDFExport(
pStPage->GetUpper()->Paint( pStPage->Frm(), &rPrintData );
SwPaintQueue::Repaint();
- } //Zus. Scope wg. CurShell!
+ }
delete pShell;
@@ -594,21 +545,9 @@ sal_Bool ViewShell::PrintOrPDFExport(
return sal_True;
}
-/******************************************************************************
- * Methode : PrtOle2()
- * Beschreibung:
- * Erstellt : PK 07.12.94
- * Aenderung : MA 16. Feb. 95
- ******************************************************************************/
-
-
-
void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
OutputDevice* pOleOut, const Rectangle& rRect )
{
- //Wir brauchen eine Shell fuer das Drucken. Entweder hat das Doc schon
- //eine, dann legen wir uns eine neue Sicht an, oder das Doc hat noch
- //keine, dann erzeugen wir die erste Sicht.
ViewShell *pSh;
if( pDoc->GetRootFrm() && pDoc->GetRootFrm()->GetCurrShell() )
pSh = new ViewShell( *pDoc->GetRootFrm()->GetCurrShell(), 0, pOleOut );
@@ -630,7 +569,6 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
pDoc->GetRootFrm()->Lower()->InvalidateSize();
}
- // --> FME 2005-02-10 #119474#
// CalcPagesForPrint() should not be necessary here. The pages in the
// visible area will be formatted in SwRootFrm::Paint().
// Removing this gives us a performance gain during saving the
@@ -638,29 +576,16 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
// formatting of the document.
// Seiten fuers Drucken formatieren
// pSh->CalcPagesForPrint( SHRT_MAX );
- // <--
-
- //#39275# jetzt will der Meyer doch ein Clipping
pOleOut->Push( PUSH_CLIPREGION );
pOleOut->IntersectClipRegion( aSwRect.SVRect() );
pSh->GetLayout()->Paint( aSwRect );
-// SFX_APP()->SpoilDemoOutput( *pOleOut, rRect );
+
pOleOut->Pop();
- // erst muss das CurrShell Object zerstoert werden!!
}
delete pSh;
}
-/******************************************************************************
- * Methode : IsAnyFieldInDoc()
- * Beschreibung: Stellt fest, ob im DocNodesArray Felder verankert sind
- * Erstellt : JP 27.07.95
- * Aenderung : JP 10.12.97
- ******************************************************************************/
-
-
-
sal_Bool ViewShell::IsAnyFieldInDoc() const
{
const SfxPoolItem* pItem;
@@ -670,7 +595,7 @@ sal_Bool ViewShell::IsAnyFieldInDoc() const
{
const SwFmtFld* pFmtFld = (SwFmtFld*)pItem;
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
- //#i101026# mod: do not include postits in field check
+ //#i101026# do not include postits in field check
const SwField* pFld = pFmtFld->GetFld();
if( pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() && (pFld->Which() != RES_POSTITFLD))
return sal_True;
@@ -678,14 +603,6 @@ sal_Bool ViewShell::IsAnyFieldInDoc() const
return sal_False;
}
-
-
-/******************************************************************************
- * SwDrawViewSave
- *
- * Saves some settings at the draw view
- ******************************************************************************/
-
SwDrawViewSave::SwDrawViewSave( SdrView* pSdrView )
: pDV( pSdrView )
{
@@ -705,10 +622,9 @@ SwDrawViewSave::~SwDrawViewSave()
}
-// OD 09.01.2003 #i6467# - method also called for page preview
+// #i6467# - method also called for page preview
void ViewShell::PrepareForPrint( const SwPrintData &rOptions )
{
- // Viewoptions fuer den Drucker setzen
pOpt->SetGraphic ( sal_True == rOptions.bPrintGraphic );
pOpt->SetTable ( sal_True == rOptions.bPrintTable );
pOpt->SetDraw ( sal_True == rOptions.bPrintDraw );
@@ -721,7 +637,7 @@ void ViewShell::PrepareForPrint( const SwPrintData &rOptions )
SdrView *pDrawView = GetDrawView();
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
- // OD 09.01.2003 #i6467# - consider, if view shell belongs to page preview
+ // #i6467# - consider, if view shell belongs to page preview
if ( !IsPreView() )
{
pDrawView->SetLayerPrintable( sLayerNm, rOptions.bPrintControl );
@@ -733,3 +649,4 @@ void ViewShell::PrepareForPrint( const SwPrintData &rOptions )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */