summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/acccell.cxx11
-rw-r--r--sw/source/core/access/acccontext.cxx88
-rw-r--r--sw/source/core/access/acccontext.hxx6
-rw-r--r--sw/source/core/access/accdoc.cxx11
-rw-r--r--sw/source/core/access/accembedded.cxx15
-rw-r--r--sw/source/core/access/accfootnote.cxx11
-rw-r--r--sw/source/core/access/accgraphic.cxx15
-rw-r--r--sw/source/core/access/accheaderfooter.cxx11
-rw-r--r--sw/source/core/access/accmap.cxx420
-rw-r--r--sw/source/core/access/accpage.cxx11
-rw-r--r--sw/source/core/access/accpara.cxx18
-rw-r--r--sw/source/core/access/accpreview.cxx15
-rw-r--r--sw/source/core/access/acctable.cxx11
-rw-r--r--sw/source/core/access/acctextframe.cxx11
-rw-r--r--sw/source/core/bastyp/bparr.cxx20
-rw-r--r--sw/source/core/bastyp/calc.cxx60
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/crsr/crsrsh.cxx18
-rw-r--r--sw/source/core/crsr/pam.cxx6
-rw-r--r--sw/source/core/crsr/swcrsr.cxx185
-rw-r--r--sw/source/core/crsr/viscrs.cxx34
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx58
-rw-r--r--sw/source/core/doc/docbm.cxx18
-rw-r--r--sw/source/core/doc/doccomp.cxx62
-rw-r--r--sw/source/core/doc/docdesc.cxx8
-rw-r--r--sw/source/core/doc/docedt.cxx15
-rw-r--r--sw/source/core/doc/docfld.cxx33
-rw-r--r--sw/source/core/doc/doclay.cxx51
-rw-r--r--sw/source/core/doc/docnum.cxx24
-rw-r--r--sw/source/core/doc/docredln.cxx67
-rw-r--r--sw/source/core/doc/docsort.cxx27
-rw-r--r--sw/source/core/doc/doctxm.cxx14
-rw-r--r--sw/source/core/doc/notxtfrm.cxx18
-rw-r--r--sw/source/core/doc/poolfmt.cxx14
-rw-r--r--sw/source/core/doc/tblcpy.cxx11
-rw-r--r--sw/source/core/doc/tblrwcl.cxx95
-rw-r--r--sw/source/core/docnode/ndcopy.cxx67
-rw-r--r--sw/source/core/docnode/ndsect.cxx8
-rw-r--r--sw/source/core/docnode/ndtbl.cxx118
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx22
-rw-r--r--sw/source/core/docnode/nodes.cxx4
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx43
-rw-r--r--sw/source/core/draw/dflyobj.cxx28
-rw-r--r--sw/source/core/draw/dpage.cxx14
-rw-r--r--sw/source/core/draw/drawdoc.cxx6
-rw-r--r--sw/source/core/edit/acorrect.cxx5
-rw-r--r--sw/source/core/edit/autofmt.cxx9
-rw-r--r--sw/source/core/edit/edattr.cxx92
-rw-r--r--sw/source/core/edit/editsh.cxx65
-rw-r--r--sw/source/core/edit/edsect.cxx249
-rw-r--r--sw/source/core/fields/authfld.cxx33
-rw-r--r--sw/source/core/fields/fldbas.cxx13
-rw-r--r--sw/source/core/frmedt/fecopy.cxx46
-rw-r--r--sw/source/core/frmedt/fefly1.cxx7
-rw-r--r--sw/source/core/frmedt/feshview.cxx58
-rw-r--r--sw/source/core/frmedt/fetab.cxx233
-rw-r--r--sw/source/core/frmedt/tblsel.cxx204
-rw-r--r--sw/source/core/graphic/ndgrf.cxx16
-rw-r--r--sw/source/core/inc/drawfont.hxx340
-rw-r--r--sw/source/core/inc/frmtool.hxx32
-rw-r--r--sw/source/core/inc/pagefrm.hxx130
-rw-r--r--sw/source/core/inc/prevwpage.hxx38
-rw-r--r--sw/source/core/inc/rootfrm.hxx20
-rw-r--r--sw/source/core/inc/swfont.hxx10
-rw-r--r--sw/source/core/inc/txtfrm.hxx9
-rw-r--r--sw/source/core/inc/viewimp.hxx46
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
-rw-r--r--sw/source/core/layout/calcmove.cxx50
-rw-r--r--sw/source/core/layout/findfrm.cxx11
-rw-r--r--sw/source/core/layout/flowfrm.cxx6
-rw-r--r--sw/source/core/layout/fly.cxx18
-rw-r--r--sw/source/core/layout/flycnt.cxx42
-rw-r--r--sw/source/core/layout/frmtool.cxx63
-rw-r--r--sw/source/core/layout/hffrm.cxx23
-rw-r--r--sw/source/core/layout/layact.cxx65
-rw-r--r--sw/source/core/layout/pagechg.cxx28
-rw-r--r--sw/source/core/layout/paintfrm.cxx717
-rw-r--r--sw/source/core/layout/sectfrm.cxx27
-rw-r--r--sw/source/core/layout/tabfrm.cxx666
-rw-r--r--sw/source/core/layout/trvlfrm.cxx422
-rw-r--r--sw/source/core/layout/wsfrm.cxx33
-rw-r--r--sw/source/core/text/frmcrsr.cxx293
-rw-r--r--sw/source/core/text/frmform.cxx9
-rw-r--r--sw/source/core/text/frmpaint.cxx17
-rw-r--r--sw/source/core/text/inftxt.cxx19
-rw-r--r--sw/source/core/text/inftxt.hxx7
-rw-r--r--sw/source/core/text/itrcrsr.cxx169
-rw-r--r--sw/source/core/text/itrform2.cxx19
-rw-r--r--sw/source/core/text/makefile.mk4
-rw-r--r--sw/source/core/text/porfld.cxx41
-rw-r--r--sw/source/core/text/porfly.cxx8
-rw-r--r--sw/source/core/text/porlay.cxx125
-rw-r--r--sw/source/core/text/pormulti.cxx23
-rw-r--r--sw/source/core/text/portxt.cxx10
-rw-r--r--sw/source/core/text/txtcache.cxx5
-rw-r--r--sw/source/core/text/txtfly.cxx22
-rw-r--r--sw/source/core/text/txtfrm.cxx12
-rw-r--r--sw/source/core/text/txtftn.cxx53
-rw-r--r--sw/source/core/text/txtio.cxx10
-rw-r--r--sw/source/core/text/txttab.cxx21
-rw-r--r--sw/source/core/tox/txmsrt.cxx21
-rw-r--r--sw/source/core/txtnode/fntcache.cxx39
-rw-r--r--sw/source/core/txtnode/fntcap.cxx25
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx48
-rw-r--r--sw/source/core/txtnode/swfont.cxx10
-rw-r--r--sw/source/core/txtnode/txtedt.cxx39
-rw-r--r--sw/source/core/unocore/swunohelper.cxx31
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx78
-rw-r--r--sw/source/core/unocore/unodraw.cxx8
-rw-r--r--sw/source/core/unocore/unofield.cxx6
-rw-r--r--sw/source/core/unocore/unoframe.cxx268
-rw-r--r--sw/source/core/unocore/unoftn.cxx27
-rw-r--r--sw/source/core/unocore/unoidx.cxx22
-rw-r--r--sw/source/core/unocore/unomap.cxx43
-rw-r--r--sw/source/core/unocore/unoobj.cxx41
-rw-r--r--sw/source/core/unocore/unoobj2.cxx12
-rw-r--r--sw/source/core/unocore/unoport.cxx7
-rw-r--r--sw/source/core/unocore/unoportenum.cxx32
-rw-r--r--sw/source/core/unocore/unoprnms.cxx21
-rw-r--r--sw/source/core/unocore/unoredline.cxx34
-rw-r--r--sw/source/core/unocore/unorefmk.cxx6
-rw-r--r--sw/source/core/unocore/unotbl.cxx23
-rw-r--r--sw/source/core/unocore/unotext.cxx23
-rw-r--r--sw/source/core/view/makefile.mk10
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx1424
-rw-r--r--sw/source/core/view/scrrect.cxx141
-rw-r--r--sw/source/core/view/viewimp.cxx50
-rw-r--r--sw/source/core/view/viewpg.cxx1575
-rw-r--r--sw/source/core/view/viewsh.cxx54
-rw-r--r--sw/source/core/view/vnew.cxx14
-rw-r--r--sw/source/core/view/vprint.cxx112
-rw-r--r--sw/source/filter/ascii/parasc.cxx514
-rw-r--r--sw/source/filter/basflt/fltini.cxx59
-rw-r--r--sw/source/filter/basflt/shellio.cxx19
-rw-r--r--sw/source/filter/html/htmlatr.cxx12
-rw-r--r--sw/source/filter/html/htmlbas.cxx6
-rw-r--r--sw/source/filter/html/htmlfly.cxx10
-rw-r--r--sw/source/filter/html/htmlfly.hxx6
-rw-r--r--sw/source/filter/html/htmlflyt.cxx83
-rw-r--r--sw/source/filter/html/htmlform.cxx6
-rw-r--r--sw/source/filter/html/htmlgrin.cxx168
-rw-r--r--sw/source/filter/html/htmltab.cxx23
-rw-r--r--sw/source/filter/html/htmltabw.cxx7
-rw-r--r--sw/source/filter/html/makefile.mk4
-rw-r--r--sw/source/filter/html/wrthtml.cxx8
-rw-r--r--sw/source/filter/inc/fltshell.hxx5
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx147
-rw-r--r--sw/source/filter/rtf/rtffld.cxx88
-rw-r--r--sw/source/filter/rtf/rtffly.cxx45
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx9
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx210
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx1933
-rw-r--r--sw/source/filter/rtf/swparrtf.hxx139
-rw-r--r--sw/source/filter/writer/writer.cxx41
-rw-r--r--sw/source/filter/ww1/fltshell.cxx18
-rw-r--r--sw/source/filter/ww8/dump/dump8a.cxx4
-rw-r--r--sw/source/filter/ww8/escher.hxx9
-rw-r--r--sw/source/filter/ww8/makefile.mk5
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx94
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx37
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx63
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx85
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx10
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx20
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx10
-rw-r--r--sw/source/filter/ww8/ww8glsy.cxx14
-rw-r--r--sw/source/filter/ww8/ww8glsy.hxx7
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx62
-rw-r--r--sw/source/filter/ww8/ww8graf.hxx7
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx42
-rw-r--r--sw/source/filter/ww8/ww8par.cxx747
-rw-r--r--sw/source/filter/ww8/ww8par.hxx202
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx100
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx8
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx18
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx179
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx1581
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx214
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx12
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx134
-rw-r--r--sw/source/filter/xml/swxml.cxx16
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx12
-rw-r--r--sw/source/filter/xml/xmliteme.cxx8
-rw-r--r--sw/source/filter/xml/xmltbli.cxx101
-rw-r--r--sw/source/filter/xml/xmltexte.cxx63
-rw-r--r--sw/source/filter/xml/xmltexte.hxx9
-rw-r--r--sw/source/ui/app/app.src327
-rw-r--r--sw/source/ui/app/appenv.cxx51
-rw-r--r--sw/source/ui/app/apphdl.cxx23
-rw-r--r--sw/source/ui/app/applab.cxx6
-rw-r--r--sw/source/ui/app/docsh.cxx127
-rw-r--r--sw/source/ui/app/docsh2.cxx15
-rw-r--r--sw/source/ui/app/docshini.cxx86
-rw-r--r--sw/source/ui/app/docst.cxx22
-rw-r--r--sw/source/ui/app/error.src250
-rw-r--r--sw/source/ui/app/makefile.mk6
-rw-r--r--sw/source/ui/app/mn.src26
-rw-r--r--sw/source/ui/app/swmodul1.cxx193
-rw-r--r--sw/source/ui/app/swmodule.cxx14
-rw-r--r--sw/source/ui/chrdlg/ccoll.src400
-rw-r--r--sw/source/ui/chrdlg/chardlg.src148
-rw-r--r--sw/source/ui/chrdlg/chrdlg.src48
-rw-r--r--sw/source/ui/chrdlg/drpcps.src88
-rw-r--r--sw/source/ui/chrdlg/numpara.src40
-rw-r--r--sw/source/ui/chrdlg/paradlg.src96
-rw-r--r--sw/source/ui/chrdlg/swbreak.src76
-rw-r--r--sw/source/ui/config/optdlg.src141
-rw-r--r--sw/source/ui/config/optload.src227
-rw-r--r--sw/source/ui/config/optpage.cxx19
-rw-r--r--sw/source/ui/config/redlopt.src313
-rw-r--r--sw/source/ui/config/usrpref.cxx20
-rw-r--r--sw/source/ui/config/viewopt.cxx70
-rw-r--r--sw/source/ui/dbui/dbinsdlg.src30
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx61
-rw-r--r--sw/source/ui/dbui/dbui.src62
-rw-r--r--sw/source/ui/dialog/abstract.src69
-rw-r--r--sw/source/ui/dialog/ascfldlg.src116
-rw-r--r--sw/source/ui/dialog/dialog.src50
-rw-r--r--sw/source/ui/dialog/docstdlg.src80
-rw-r--r--sw/source/ui/dialog/regionsw.cxx13
-rw-r--r--sw/source/ui/dialog/regionsw.src244
-rw-r--r--sw/source/ui/dochdl/dochdl.src78
-rw-r--r--sw/source/ui/dochdl/gloshdl.cxx21
-rw-r--r--sw/source/ui/dochdl/selglos.src42
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx64
-rw-r--r--sw/source/ui/docvw/access.src104
-rw-r--r--sw/source/ui/docvw/docvw.src79
-rw-r--r--sw/source/ui/docvw/edtwin.cxx163
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx12
-rw-r--r--sw/source/ui/docvw/srcedtw.cxx35
-rw-r--r--sw/source/ui/envelp/envelp.src63
-rw-r--r--sw/source/ui/envelp/envfmt.src277
-rw-r--r--sw/source/ui/envelp/envlop.src21
-rw-r--r--sw/source/ui/envelp/envprt.src17
-rw-r--r--sw/source/ui/envelp/label.src245
-rw-r--r--sw/source/ui/envelp/labfmt.src328
-rw-r--r--sw/source/ui/envelp/labprt.src15
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx27
-rw-r--r--sw/source/ui/envelp/mailmrge.hrc10
-rw-r--r--sw/source/ui/envelp/mailmrge.src328
-rw-r--r--sw/source/ui/fldui/changedb.src45
-rw-r--r--sw/source/ui/fldui/flddb.src18
-rw-r--r--sw/source/ui/fldui/flddinf.src143
-rw-r--r--sw/source/ui/fldui/flddok.src127
-rw-r--r--sw/source/ui/fldui/fldfunc.src119
-rw-r--r--sw/source/ui/fldui/fldpage.cxx22
-rw-r--r--sw/source/ui/fldui/fldref.src118
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx57
-rw-r--r--sw/source/ui/fldui/fldtdlg.src122
-rw-r--r--sw/source/ui/fldui/fldui.src111
-rw-r--r--sw/source/ui/fldui/fldvar.src39
-rw-r--r--sw/source/ui/fldui/inpdlg.src66
-rw-r--r--sw/source/ui/fldui/javaedit.src43
-rw-r--r--sw/source/ui/fmtui/fmtui.src50
-rw-r--r--sw/source/ui/fmtui/tmpdlg.src228
-rw-r--r--sw/source/ui/frmdlg/column.cxx13
-rw-r--r--sw/source/ui/frmdlg/column.src140
-rw-r--r--sw/source/ui/frmdlg/cption.src144
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx88
-rw-r--r--sw/source/ui/frmdlg/frmpage.src105
-rw-r--r--sw/source/ui/frmdlg/frmui.src306
-rw-r--r--sw/source/ui/frmdlg/makefile.mk9
-rw-r--r--sw/source/ui/frmdlg/wrap.src68
-rw-r--r--sw/source/ui/globdoc/globdoc.src51
-rw-r--r--sw/source/ui/inc/app.hrc6
-rw-r--r--sw/source/ui/inc/chartins.hxx13
-rw-r--r--sw/source/ui/inc/edtwin.hxx7
-rw-r--r--sw/source/ui/inc/fldtdlg.hxx5
-rw-r--r--sw/source/ui/inc/fldwrap.hxx18
-rw-r--r--sw/source/ui/inc/mailmrge.hxx29
-rw-r--r--sw/source/ui/inc/pview.hxx96
-rw-r--r--sw/source/ui/inc/shells.hrc8
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx17
-rw-r--r--sw/source/ui/inc/view.hxx13
-rw-r--r--sw/source/ui/index/cntex.cxx7
-rw-r--r--sw/source/ui/index/cnttab.cxx6
-rw-r--r--sw/source/ui/index/cnttab.src121
-rw-r--r--sw/source/ui/index/idxmrk.src127
-rw-r--r--sw/source/ui/index/multmrk.src76
-rw-r--r--sw/source/ui/lingu/olmenu.cxx7
-rw-r--r--sw/source/ui/lingu/olmenu.src17
-rw-r--r--sw/source/ui/misc/bookmark.src76
-rw-r--r--sw/source/ui/misc/docfnote.src583
-rw-r--r--sw/source/ui/misc/glosbib.src121
-rw-r--r--sw/source/ui/misc/glossary.src258
-rw-r--r--sw/source/ui/misc/insfnote.src122
-rw-r--r--sw/source/ui/misc/insrule.cxx10
-rw-r--r--sw/source/ui/misc/insrule.src59
-rw-r--r--sw/source/ui/misc/linenum.src307
-rw-r--r--sw/source/ui/misc/num.src27
-rw-r--r--sw/source/ui/misc/numberingtypelistbox.src77
-rw-r--r--sw/source/ui/misc/outline.src498
-rw-r--r--sw/source/ui/misc/pgfnote.src184
-rw-r--r--sw/source/ui/misc/pggrid.src176
-rw-r--r--sw/source/ui/misc/redlndlg.src29
-rw-r--r--sw/source/ui/misc/srtdlg.cxx35
-rw-r--r--sw/source/ui/misc/srtdlg.src371
-rw-r--r--sw/source/ui/ribbar/inputwin.src512
-rw-r--r--sw/source/ui/ribbar/tblctrl.src16
-rw-r--r--sw/source/ui/ribbar/tbxanchr.src77
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx20
-rw-r--r--sw/source/ui/ribbar/workctrl.src135
-rw-r--r--sw/source/ui/shells/basesh.cxx10
-rw-r--r--sw/source/ui/shells/drwbassh.cxx16
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx61
-rw-r--r--sw/source/ui/shells/frmsh.cxx13
-rw-r--r--sw/source/ui/shells/shells.src167
-rw-r--r--sw/source/ui/shells/slotadd.cxx7
-rw-r--r--sw/source/ui/shells/textdrw.cxx17
-rw-r--r--sw/source/ui/shells/textfld.cxx6
-rw-r--r--sw/source/ui/shells/textsh.cxx19
-rw-r--r--sw/source/ui/shells/txtattr.cxx49
-rw-r--r--sw/source/ui/table/chartins.cxx26
-rw-r--r--sw/source/ui/table/chartins.src56
-rw-r--r--sw/source/ui/table/colwd.src72
-rw-r--r--sw/source/ui/table/convert.src222
-rw-r--r--sw/source/ui/table/insrc.src129
-rw-r--r--sw/source/ui/table/instable.src219
-rw-r--r--sw/source/ui/table/mergetbl.src76
-rw-r--r--sw/source/ui/table/rowht.src52
-rw-r--r--sw/source/ui/table/splittbl.src97
-rw-r--r--sw/source/ui/table/table.src25
-rw-r--r--sw/source/ui/table/tabledlg.src296
-rw-r--r--sw/source/ui/table/tautofmt.src354
-rw-r--r--sw/source/ui/uiview/pview.cxx737
-rw-r--r--sw/source/ui/uiview/pview.src40
-rw-r--r--sw/source/ui/uiview/scroll.cxx12
-rw-r--r--sw/source/ui/uiview/srcview.cxx39
-rw-r--r--sw/source/ui/uiview/view.cxx82
-rw-r--r--sw/source/ui/uiview/view.src147
-rw-r--r--sw/source/ui/uiview/view0.cxx6
-rw-r--r--sw/source/ui/uiview/view1.cxx16
-rw-r--r--sw/source/ui/uiview/view2.cxx246
-rw-r--r--sw/source/ui/uiview/viewport.cxx77
-rw-r--r--sw/source/ui/uiview/viewprt.cxx13
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx14
-rw-r--r--sw/source/ui/uiview/viewstat.cxx16
-rw-r--r--sw/source/ui/uiview/viewtab.cxx32
-rw-r--r--sw/source/ui/uno/RefreshListenerContainer.cxx6
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx95
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.hxx44
-rw-r--r--sw/source/ui/uno/SwXPrintPreviewSettings.cxx31
-rw-r--r--sw/source/ui/uno/SwXPrintPreviewSettings.hxx27
-rw-r--r--sw/source/ui/uno/makefile.mk6
-rw-r--r--sw/source/ui/uno/unoatxt.cxx12
-rw-r--r--sw/source/ui/uno/unofreg.cxx22
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx1000
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx7
-rw-r--r--sw/source/ui/uno/unotxvw.cxx27
-rw-r--r--sw/source/ui/utlui/attrdesc.src506
-rw-r--r--sw/source/ui/utlui/gloslst.src43
-rw-r--r--sw/source/ui/utlui/initui.src1346
-rw-r--r--sw/source/ui/utlui/navipi.src135
-rw-r--r--sw/source/ui/utlui/poolfmt.src922
-rw-r--r--sw/source/ui/utlui/unotools.src115
-rw-r--r--sw/source/ui/utlui/utlui.src85
-rw-r--r--sw/source/ui/web/web.src60
-rw-r--r--sw/source/ui/wrtsh/delete.cxx33
-rw-r--r--sw/source/ui/wrtsh/select.cxx10
-rw-r--r--sw/source/ui/wrtsh/wrtsh.src1451
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx23
-rw-r--r--sw/source/ui/wrtsh/wrtsh3.cxx10
364 files changed, 22931 insertions, 16732 deletions
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index 2864690d86c9..253de82cdd06 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acccell.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mib $ $Date: 2002-11-25 15:14:37 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -380,11 +380,14 @@ Sequence< Type > SAL_CALL SwAccessibleCell::getTypes() throw(RuntimeException)
Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index a215555e7c45..cbb2b6413ba5 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acccontext.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: mib $ $Date: 2002-12-05 14:10:33 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -139,6 +139,9 @@
#ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_HXX
#include <svx/AccessibleShape.hxx>
#endif
+#ifndef COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER
+#include <comphelper/accessibleeventnotifier.hxx>
+#endif
#if defined DEBUG && defined TEST_MIB
#define DBG_MSG( _msg ) \
@@ -532,31 +535,8 @@ void SwAccessibleContext::FireAccessibleEvent( AccessibleEventObject& rEvent )
rEvent.Source = xThis;
}
- ::cppu::OInterfaceIteratorHelper aIter( aAccessibleEventListeners );
- while( aIter.hasMoreElements() )
- {
- Reference < XAccessibleEventListener > xListener( aIter.next(),
- UNO_QUERY );
- if( xListener.is() ) // TODO: test is unneccessary soon
- {
- try
- {
- xListener->notifyEvent( rEvent );
- }
- catch( ::com::sun::star::uno::RuntimeException& r )
- {
-#ifdef DEBUG
- ByteString aError( "Runtime exception caught for event" );
- aError += ByteString::CreateFromInt32( rEvent.EventId );
- aError += ".:\n";
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#endif
-// aIter.remove();
- }
- }
- }
-
+ if (nClientId)
+ comphelper::AccessibleEventNotifier::addEvent( nClientId, rEvent );
}
void SwAccessibleContext::FireVisibleDataEvent()
@@ -615,10 +595,10 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
const SwFrm *pF ) :
SwAccessibleFrame( pM->GetVisArea().SVRect(), pF,
pM->GetShell()->IsPreView() ),
- aAccessibleEventListeners( aListenerMutex ),
pMap( pM ),
nRole( nR ),
- bDisposing( sal_False )
+ bDisposing( sal_False ),
+ nClientId(0)
{
InitStates();
DBG_MSG_CD( "constructed" )
@@ -631,10 +611,10 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
SwAccessibleFrame( pM->GetVisArea().SVRect(), pF,
pM->GetShell()->IsPreView() ),
sName( rName ),
- aAccessibleEventListeners( aListenerMutex ),
pMap( pM ),
nRole( nR ),
- bDisposing( sal_False )
+ bDisposing( sal_False ),
+ nClientId(0)
{
InitStates();
DBG_MSG_CD( "constructed" )
@@ -816,7 +796,14 @@ void SAL_CALL SwAccessibleContext::addEventListener(
throw (::com::sun::star::uno::RuntimeException)
{
DBG_MSG( "accessible event listener added" )
- aAccessibleEventListeners.addInterface( xListener );
+
+ if (xListener.is())
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ if (!nClientId)
+ nClientId = comphelper::AccessibleEventNotifier::registerClient( );
+ comphelper::AccessibleEventNotifier::addEventListener( nClientId, xListener );
+ }
}
void SAL_CALL SwAccessibleContext::removeEventListener(
@@ -824,7 +811,21 @@ void SAL_CALL SwAccessibleContext::removeEventListener(
throw (::com::sun::star::uno::RuntimeException)
{
DBG_MSG( "accessible event listener removed" )
- aAccessibleEventListeners.removeInterface( xListener );
+
+ if (xListener.is())
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( nClientId, xListener );
+ if ( !nListenerCount )
+ {
+ // no listeners anymore
+ // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
+ // and at least to us not firing any events anymore, in case somebody calls
+ // NotifyAccessibleEvent, again
+ comphelper::AccessibleEventNotifier::revokeClient( nClientId );
+ nClientId = 0;
+ }
+ }
}
static sal_Bool lcl_PointInRectangle(const awt::Point & aPoint,
@@ -866,8 +867,8 @@ Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAt(
Point aPixPoint( aPoint.X, aPoint.Y ); // px rel to parent
if( !GetFrm()->IsRootFrm() )
{
- Point aLogPos( GetBounds( GetFrm() ).Pos() ); // twip rel to doc root
- Point aPixPos( GetMap()->CoreToPixel( aLogPos ) );
+ SwRect aLogBounds( GetBounds( GetFrm() ) ); // twip rel to doc root
+ Point aPixPos( GetMap()->CoreToPixel( aLogBounds.SVRect() ).TopLeft() );
aPixPoint.X() += aPixPos.X();
aPixPoint.Y() += aPixPos.Y();
}
@@ -924,15 +925,20 @@ awt::Rectangle SAL_CALL SwAccessibleContext::getBoundsImpl(sal_Bool bRelative)
{
ASSERT( GetShell()->IsPreView(), "empty page accessible?" );
if( GetShell()->IsPreView() )
- aLogBounds.SSize( GetMap()->GetPreViewPageSize() );
+ {
+ // OD 15.01.2003 #103492# - adjust method call <GetMap()->GetPreViewPageSize()>
+ sal_uInt16 nPageNum =
+ static_cast < const SwPageFrm * >( GetFrm() )->GetPhyPageNum();
+ aLogBounds.SSize( GetMap()->GetPreViewPageSize( nPageNum ) );
+ }
}
if( !aLogBounds.IsEmpty() )
{
aPixBounds = GetMap()->CoreToPixel( aLogBounds.SVRect() );
if( !pParent->IsRootFrm() && bRelative)
{
- Point aParentLogPos( GetBounds( pParent ).Pos() ); // twip rel to doc root
- Point aParentPixPos( GetMap()->CoreToPixel( aParentLogPos ) );
+ SwRect aParentLogBounds( GetBounds( pParent ) ); // twip rel to doc root
+ Point aParentPixPos( GetMap()->CoreToPixel( aParentLogBounds.SVRect() ).TopLeft() );
aPixBounds.Move( -aParentPixPos.X(), -aParentPixPos.Y() );
}
}
@@ -1150,10 +1156,10 @@ void SwAccessibleContext::Dispose( sal_Bool bRecursive )
}
// broadcast dispose event
+ if ( nClientId )
{
- EventObject aEvent;
- aEvent.Source = xThis;
- aAccessibleEventListeners.disposeAndClear( aEvent );
+ comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId, *this );
+ nClientId = 0;
DBG_MSG_CD( "dispose" )
}
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx
index e1a984d95a72..832d64d41d2d 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acccontext.hxx,v $
*
- * $Revision: 1.30 $
+ * $Revision: 1.31 $
*
- * last change: $Author: mib $ $Date: 2002-10-29 14:05:36 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -140,7 +140,6 @@ protected:
private:
::rtl::OUString sName; // immutable outside constructor
- ::cppu::OInterfaceContainerHelper aAccessibleEventListeners;
// The parent if it has been retrieved. This is always an
// SwAccessibleContext. (protected by Mutex)
@@ -149,6 +148,7 @@ private:
SwAccessibleMap *pMap; // must be protected by solar mutex
+ sal_uInt32 nClientId; // client id in the AccessibleEventNotifier queue
sal_Int16 nRole; // immutable outside constructor
// The current states (protected by mutex)
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index f58ea220b161..6398729b0baf 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accdoc.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-10-02 08:48:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -514,11 +514,14 @@ Sequence< Type > SAL_CALL SwAccessibleDocument::getTypes() throw(RuntimeExceptio
Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index 53acc19460d6..331ae57e14c6 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accembedded.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mib $ $Date: 2002-08-15 10:25:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,10 @@
#pragma hdrstop
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <drafts/com/sun/star/accessibility/AccessibleRole.hpp>
#endif
@@ -132,10 +136,13 @@ Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNam
Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index c8d9874f642c..ea272622d3c8 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accfootnote.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mib $ $Date: 2002-12-05 14:32:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -213,11 +213,14 @@ Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
Sequence< sal_Int8 > SAL_CALL SwAccessibleFootnote::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index f958e8828fc6..8a5680659eed 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accgraphic.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mib $ $Date: 2002-08-15 10:25:12 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,10 @@
#pragma hdrstop
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <drafts/com/sun/star/accessibility/AccessibleRole.hpp>
#endif
@@ -131,10 +135,13 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index 15604c509ab6..c61e327c18a9 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accheaderfooter.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mib $ $Date: 2002-12-05 14:32:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -190,10 +190,13 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 90c9fff643b9..bf09b4b517fb 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accmap.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: mib $ $Date: 2002-09-27 11:44:18 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -184,7 +184,10 @@
#ifndef _CPPUHELPER_IMPLBASE1_HXX_
#include <cppuhelper/implbase1.hxx>
#endif
-
+// OD 15.01.2003 #103492#
+#ifndef _PAGEPREVIEWLAYOUT_HXX
+#include <pagepreviewlayout.hxx>
+#endif
using namespace ::com::sun::star::uno;
using namespace ::drafts::com::sun::star::accessibility;
@@ -1084,27 +1087,23 @@ 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.
Reference<XAccessible> SwAccessibleMap::GetDocumentPreview(
- sal_uInt8 nRow,
- sal_uInt8 nColumn,
- sal_Int16 nStartPage,
- const Size& rPageSize,
- const Point& rFreePoint,
- const Fraction& rScale,
- sal_uInt16 nSelectedPage )
+ const std::vector<PrevwPage*>& _rPrevwPages,
+ const Fraction& _rScale,
+ const SwPageFrm* _pSelectedPageFrm,
+ const Size& _rPrevwWinSize )
{
// create & update preview data object
if( mpPreview == NULL )
mpPreview = new SwAccPreviewData();
- mpPreview->Update( nRow, nColumn, nStartPage,
- rPageSize, rFreePoint, rScale, GetShell(),
- nSelectedPage );
+ mpPreview->Update( _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize );
Reference<XAccessible> xAcc = _GetDocumentView( sal_True );
return xAcc;
}
-
Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
sal_Bool bCreate )
{
@@ -1836,19 +1835,18 @@ void SwAccessibleMap::InvalidateRelationSet( const SwFrm* pMaster,
_InvalidateRelationSet( pFollow, sal_True );
}
-void SwAccessibleMap::UpdatePreview( sal_uInt8 nRow, sal_uInt8 nColumn,
- sal_Int16 nStartPage,
- const Size& rPageSize,
- const Point& rFreePoint,
- const Fraction& rScale,
- sal_uInt16 nSelectedPage )
+// 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,
+ const Size& _rPrevwWinSize )
{
DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
DBG_ASSERT( mpPreview != NULL, "no preview data?" );
- mpPreview->Update( nRow, nColumn, nStartPage,
- rPageSize, rFreePoint, rScale, GetShell(),
- nSelectedPage );
+ // OD 15.01.2003 #103492# - adjustments for changed method signature
+ mpPreview->Update( _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize );
// propagate change of VisArea through the document's
// accessibility tree; this will also send appropriate scroll
@@ -1885,7 +1883,8 @@ void SwAccessibleMap::InvalidatePreViewSelection( sal_uInt16 nSelPage )
DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
DBG_ASSERT( mpPreview != NULL, "no preview data?" );
- mpPreview->InvalidateSelection( nSelPage );
+ // OD 16.01.2003 #103492# - changed metthod call due to method signature change.
+ mpPreview->InvalidateSelection( GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
Reference < XAccessible > xOldAcc;
Reference < XAccessible > xAcc;
@@ -1974,7 +1973,10 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint ) const
Window *pWin = GetShell()->GetWin();
if( pWin )
{
- aPoint = pWin->LogicToPixel( aPoint );
+ // OD 16.01.2003 #103492# - get mapping mode for LogicToPixel conversion
+ MapMode aMapMode;
+ GetMapMode( aPoint, aMapMode );
+ aPoint = pWin->LogicToPixel( aPoint, aMapMode );
aPoint = pWin->OutputToAbsoluteScreenPixel( aPoint );
}
@@ -1988,7 +1990,10 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) const
Size aSize( OutputDevice::LogicToLogic( rSize, aSrc, aDest ) );
if( GetShell()->GetWin() )
{
- aSize = GetShell()->GetWin()->LogicToPixel( aSize );
+ // OD 16.01.2003 #103492# - get mapping mode for LogicToPixel conversion
+ MapMode aMapMode;
+ GetMapMode( Point(0,0), aMapMode );
+ aSize = GetShell()->GetWin()->LogicToPixel( aSize, aMapMode );
}
return aSize;
@@ -2001,7 +2006,10 @@ Point SwAccessibleMap::PixelToLogic( const Point& rPoint ) const
if( pWin )
{
aPoint = pWin->ScreenToOutputPixel( rPoint );
- aPoint = pWin->PixelToLogic( aPoint );
+ // OD 16.01.2003 #103492# - get mapping mode for PixelToLogic conversion
+ MapMode aMapMode;
+ GetMapMode( aPoint, aMapMode );
+ aPoint = pWin->PixelToLogic( aPoint, aMapMode );
MapMode aSrc( MAP_TWIP );
MapMode aDest( MAP_100TH_MM );
aPoint = OutputDevice::LogicToLogic( aPoint, aSrc, aDest );
@@ -2015,7 +2023,10 @@ Size SwAccessibleMap::PixelToLogic( const Size& rSize ) const
Size aSize;
if( GetShell()->GetWin() )
{
- aSize = GetShell()->GetWin()->PixelToLogic( rSize );
+ // OD 16.01.2003 #103492# - get mapping mode for PixelToLogic conversion
+ MapMode aMapMode;
+ GetMapMode( Point(0,0), aMapMode );
+ aSize = GetShell()->GetWin()->PixelToLogic( rSize, aMapMode );
MapMode aSrc( MAP_TWIP );
MapMode aDest( MAP_100TH_MM );
aSize = OutputDevice::LogicToLogic( aSize, aSrc, aDest );
@@ -2102,24 +2113,15 @@ sal_Bool SwAccessibleMap::ReplaceChild (
return sal_True;
}
-Point SwAccessibleMap::CoreToPixel( const Point& rPoint ) const
-{
- Point aPoint;
- if( GetShell()->GetWin() )
- {
- PreviewAdjust( rPoint, sal_False );
- aPoint = GetShell()->GetWin()->LogicToPixel( rPoint );
- }
- return aPoint;
-}
-
Point SwAccessibleMap::PixelToCore( const Point& rPoint ) const
{
Point aPoint;
if( GetShell()->GetWin() )
{
- PreviewAdjust( rPoint, sal_True );
- aPoint = GetShell()->GetWin()->PixelToLogic( rPoint );
+ // OD 15.01.2003 #103492# - replace <PreviewAdjust(..)> by <GetMapMode(..)>
+ MapMode aMapMode;
+ GetMapMode( rPoint, aMapMode );
+ aPoint = GetShell()->GetWin()->PixelToLogic( rPoint, aMapMode );
}
return aPoint;
}
@@ -2162,10 +2164,12 @@ Rectangle SwAccessibleMap::CoreToPixel( const Rectangle& rRect ) const
Rectangle aRect;
if( GetShell()->GetWin() )
{
- PreviewAdjust( rRect.TopLeft(), sal_False );
- aRect = GetShell()->GetWin()->LogicToPixel( rRect );
+ // OD 15.01.2003 #103492# - replace <PreviewAdjust(..)> by <GetMapMode(..)>
+ MapMode aMapMode;
+ GetMapMode( rRect.TopLeft(), aMapMode );
+ aRect = GetShell()->GetWin()->LogicToPixel( rRect, aMapMode );
- Rectangle aTmpRect = GetShell()->GetWin()->PixelToLogic( aRect );
+ Rectangle aTmpRect = GetShell()->GetWin()->PixelToLogic( aRect, aMapMode );
lcl_CorrectRectangle(aRect, rRect, aTmpRect);
}
@@ -2177,38 +2181,69 @@ Rectangle SwAccessibleMap::PixelToCore( const Rectangle& rRect ) const
Rectangle aRect;
if( GetShell()->GetWin() )
{
- PreviewAdjust( rRect.TopLeft(), sal_True );
- aRect = GetShell()->GetWin()->PixelToLogic( rRect );
+ // OD 15.01.2003 #103492# - replace <PreviewAdjust(..)> by <GetMapMode(..)>
+ MapMode aMapMode;
+ GetMapMode( rRect.TopLeft(), aMapMode );
+ aRect = GetShell()->GetWin()->PixelToLogic( rRect, aMapMode );
- Rectangle aTmpRect = GetShell()->GetWin()->LogicToPixel( aRect );
+ Rectangle aTmpRect = GetShell()->GetWin()->LogicToPixel( aRect, aMapMode );
lcl_CorrectRectangle(aRect, rRect, aTmpRect);
}
return aRect;
}
-inline void SwAccessibleMap::PreviewAdjust( const Point& rPoint,
- sal_Bool bFromPreview ) 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
{
+ MapMode aMapMode = GetShell()->GetWin()->GetMapMode();
if( GetShell()->IsPreView() )
{
DBG_ASSERT( mpPreview != NULL, "need preview data" );
- Window* pWin = GetShell()->GetWin();
- MapMode aMode = pWin->GetMapMode();
- mpPreview->AdjustMapMode( aMode, rPoint, sal_True );
- pWin->SetMapMode( aMode );
+ mpPreview->AdjustMapMode( aMapMode, _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." );
+ DBG_ASSERT( mpVSh->IsPreView() && ( mpPreview != NULL ),
+ "missing accessible preview data at page preview" );
+ if ( mpVSh->IsPreView() && ( mpPreview != NULL ) )
+ {
+ return mpVSh->PagePreviewLayout()->GetPrevwPageSizeByPageNum( _nPrevwPageNum );
+ }
+ else
+ {
+ return Size( 0, 0 );
+ }
+}
//
// SwAccPreviewData
//
SwAccPreviewData::SwAccPreviewData() :
- mpStartPage( 0 ),
- mpSelPage( 0 ),
- mnStartPage( 0 )
+ mpSelPage( 0 )
{
}
@@ -2216,139 +2251,61 @@ SwAccPreviewData::~SwAccPreviewData()
{
}
-void SwAccPreviewData::Update( sal_uInt8 nRow,
- sal_uInt8 nColumn,
- sal_uInt16 nStartPage,
- const Size& rPageSize,
- const Point& rFreePixel,
- const Fraction& rScale,
- ViewShell* pShell,
- sal_uInt16 nSelPage )
-{
- DBG_ASSERT( nRow > 0, "invalid row value" );
- DBG_ASSERT( nColumn > 0, "invalid column value" );
- DBG_ASSERT( nStartPage >= 0, "invalid start page" );
- DBG_ASSERT( pShell != NULL, "need view shell" );
- DBG_ASSERT( pShell->IsPreView(), "not inpreview?" );
-
- // store the rScale (for AdjustMapMode; will be called from here, too)
- maScale = rScale;
- maPageSize = rPageSize;
-
- // get first page frame from layout, and iterate to page nSttPage
- SwRootFrm* pRoot = pShell->GetLayout();
- DBG_ASSERT( pRoot != NULL, "No layout?" );
-
- SwPageFrm* pPage = static_cast<SwPageFrm*>( pRoot->Lower() );
- DBG_ASSERT( pPage != NULL, "No page?" );
-
- // adjust for the first page (which is always a right page) if
- // there is more than one column
- sal_Bool bSkipFirstPage = (nStartPage == 0) && (nColumn != 1);
-
- // get offset of selected page
- mnStartPage = nStartPage;
- nSelPage -= nStartPage;
-
- // we'll count on nStartPage, so it should be zero-based
- if( nStartPage > 0 )
- nStartPage--;
-
- // iterate until nStartPage is found
- sal_Int32 nPage = 0;
- while( (nStartPage > 0) && (pPage != NULL) )
- {
- pPage = static_cast<SwPageFrm*>( pPage->GetNext() );
- nStartPage--;
-
- // if pPage isn't valid, thethe parameter checking allowed an
- // invalid index
- DBG_ASSERT( pPage != NULL, "non-existing start page" );
- }
-
- // iterate over pages and collect data
- // 1) VisArea as union of visible pages
- // 2) areas of visible pages for preview/logic mapping
- mpStartPage = pPage;
- mpSelPage = 0;
- if( pPage != NULL )
- {
- // first page: use to initialize VisArea
- SwFrmOrObj aPage( pPage );
- maVisArea = aPage.GetBox();
- maPreviewRects.clear();
- maLogicRects.clear();
-
- // compute free point
- MapMode aMapMode( MAP_TWIP );
- AdjustMapMode( aMapMode );
- Point aFreePoint = pShell->GetWin()->PixelToLogic( rFreePixel,
- aMapMode );
-
- // loop over col*row pages, and advance aCurrentPoint to start
- // of this page's previeww
- Point aCurrentPoint = aFreePoint;
- for( sal_uInt8 nR = 0; (pPage != NULL) && (nR < nRow); nR++ )
- {
- aCurrentPoint.X() = aFreePoint.X();
+// OD 13.01.2003 #103492# - complete re-factoring of method due to new page/print
+// preview functionality.
+void SwAccPreviewData::Update( const std::vector<PrevwPage*>& _rPrevwPages,
+ const Fraction& _rScale,
+ const SwPageFrm* _pSelectedPageFrm,
+ const Size& _rPrevwWinSize )
+{
+ // store preview scaling, maximal preview page size and selected page
+ maScale = _rScale;
+ mpSelPage = _pSelectedPageFrm;
+
+ // prepare loop on preview pages
+ maPreviewRects.clear();
+ maLogicRects.clear();
+ SwFrmOrObj aPage;
+ maVisArea.Clear();
+
+ // loop on preview pages to calculate <maPreviewRects>, <maLogicRects> and
+ // <maVisArea>
+ for ( std::vector<PrevwPage*>::const_iterator aPageIter = _rPrevwPages.begin();
+ aPageIter != _rPrevwPages.end();
+ ++aPageIter )
+ {
+ aPage = (*aPageIter)->pPage;
+
+ // add preview page rectangle to <maPreviewRects>
+ Rectangle aPrevwPgRect( (*aPageIter)->aPrevwWinPos, (*aPageIter)->aPageSize );
+ maPreviewRects.push_back( aPrevwPgRect );
- for( sal_uInt8 nC = 0; (pPage != NULL) && (nC < nColumn); nC++ )
+ // add logic page rectangle to <maLogicRects>
+ SwRect aLogicPgSwRect( aPage.GetBox() );
+ Rectangle aLogicPgRect( aLogicPgSwRect.SVRect() );
+ maLogicRects.push_back( aLogicPgRect );
+ // union visible area with visible part of logic page rectangle
+ if ( (*aPageIter)->bVisible )
+ {
+ if ( !(*aPageIter)->pPage->IsEmptyPage() )
{
- if( bSkipFirstPage )
- {
- aCurrentPoint.X() += rPageSize.Width();
- bSkipFirstPage = sal_False;
- // DON'T proceed to next page!
- }
- else
- {
- // collect data
- aPage = pPage;
- SwRect aSwRect = aPage.GetBox();
- maVisArea.Union( aSwRect );
-
- Rectangle aRect = aSwRect.SVRect();
- maLogicRects.push_back( aRect );
- aRect.SetPos( aCurrentPoint );
- maPreviewRects.push_back( aRect );
-
- aCurrentPoint.X() += pPage->IsEmptyPage()
- ? rPageSize.Width()
- : aSwRect.Width();
- if( 0 == nSelPage )
- mpSelPage = pPage;
-
- pPage = static_cast<SwPageFrm*>( pPage->GetNext() );
- }
- aCurrentPoint.X() += aFreePoint.X() +1;
- nSelPage--;
+ AdjustLogicPgRectToVisibleArea( aLogicPgSwRect,
+ SwRect( aPrevwPgRect ),
+ _rPrevwWinSize );
}
- aCurrentPoint.Y() += rPageSize.Height() + 1 + aFreePoint.Y();
+ if ( maVisArea.IsEmpty() )
+ maVisArea = aLogicPgSwRect;
+ else
+ maVisArea.Union( aLogicPgSwRect );
}
}
}
-void SwAccPreviewData::InvalidateSelection( sal_uInt16 nSelPage )
+// OD 16.01.2003 #103492# - complete re-factoring of method due to new page/print
+// preview functionality.
+void SwAccPreviewData::InvalidateSelection( const SwPageFrm* _pSelectedPageFrm )
{
- mpSelPage = 0;
- nSelPage -= mnStartPage;
- ASSERT( nSelPage >= 0, "invalid selected page" );
- ASSERT( mpStartPage, "no start page" );
- if( mpStartPage != NULL )
- {
- const SwPageFrm *pPage = mpStartPage;
-
- // loop over col*row pages, and advance aCurrentPoint to start
- // of this page's preview
- while( mpSelPage == 0 && pPage != 0 )
- {
- if( 0 == nSelPage )
- mpSelPage = pPage;
-
- pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
- nSelPage--;
- }
- }
+ mpSelPage = _pSelectedPageFrm;
ASSERT( mpSelPage, "selected page not found" );
}
@@ -2367,67 +2324,16 @@ const SwRect& SwAccPreviewData::GetVisArea() const
return maVisArea;
}
-Point SwAccPreviewData::PreviewToLogic(const Point& rPoint) const
-{
- Rectangles::const_iterator aIter = find_if( maPreviewRects.begin(),
- maPreviewRects.end(),
- ContainsPredicate( rPoint ) );
- if( aIter != maPreviewRects.end() )
- {
- Point aPoint = rPoint;
- aPoint -= aIter->TopLeft();
- aPoint += (maLogicRects.begin() + ( aIter - maPreviewRects.begin() ))
- ->TopLeft();
- return aPoint;
- }
- else
- return Point(0,0);
-}
-
-Point SwAccPreviewData::LogicToPreview(const Point& rPoint) const
-{
- Rectangles::const_iterator aIter = find_if( maLogicRects.begin(),
- maLogicRects.end(),
- ContainsPredicate( rPoint ) );
- if( aIter != maLogicRects.end() )
- {
- Point aPoint = rPoint;
- aPoint -= aIter->TopLeft();
- aPoint += (maPreviewRects.begin() + ( aIter - maLogicRects.begin() ))
- ->TopLeft();
- return aPoint;
- }
- else
- return Point(0,0);
-}
-
-void SwAccPreviewData::AdjustMapMode( MapMode& rMapMode ) const
+void SwAccPreviewData::AdjustMapMode( MapMode& rMapMode,
+ const Point& rPoint ) const
{
// adjust scale
rMapMode.SetScaleX( maScale );
rMapMode.SetScaleY( maScale );
-}
-
-void SwAccPreviewData::DisposePage(const SwPageFrm *pPageFrm )
-{
- if( mpStartPage == pPageFrm )
- mpStartPage = 0;
- if( mpSelPage == pPageFrm )
- mpSelPage = 0;
-}
-
-
-void SwAccPreviewData::AdjustMapMode( MapMode& rMapMode,
- const Point& rPoint,
- sal_Bool bFromPreview ) const
-{
- // adjust scale
- AdjustMapMode( rMapMode );
// find proper rectangle
- const Rectangles& rRects = bFromPreview ? maLogicRects : maPreviewRects;
- Rectangles::const_iterator aBegin = rRects.begin();
- Rectangles::const_iterator aEnd = rRects.end();
+ Rectangles::const_iterator aBegin = maLogicRects.begin();
+ Rectangles::const_iterator aEnd = maLogicRects.end();
Rectangles::const_iterator aFound = find_if( aBegin, aEnd,
ContainsPredicate( rPoint ) );
@@ -2440,3 +2346,45 @@ void SwAccPreviewData::AdjustMapMode( MapMode& rMapMode,
}
// else: don't adjust MapMode
}
+
+void SwAccPreviewData::DisposePage(const SwPageFrm *pPageFrm )
+{
+ if( mpSelPage == pPageFrm )
+ mpSelPage = 0;
+}
+
+/** adjust logic page retangle to its visible part
+
+ OD 17.01.2003 #103492#
+
+ @author OD
+*/
+void SwAccPreviewData::AdjustLogicPgRectToVisibleArea(
+ SwRect& _iorLogicPgSwRect,
+ const SwRect& _rPrevwPgSwRect,
+ const Size& _rPrevwWinSize )
+{
+ // determine preview window rectangle
+ const SwRect aPrevwWinSwRect( Point( 0, 0 ), _rPrevwWinSize );
+ // calculate visible preview page rectangle
+ SwRect aVisPrevwPgSwRect( _rPrevwPgSwRect );
+ aVisPrevwPgSwRect.Intersection( aPrevwWinSwRect );
+ // adjust logic page rectangle
+ SwTwips nTmpDiff;
+ // left
+ nTmpDiff = aVisPrevwPgSwRect.Left() - _rPrevwPgSwRect.Left();
+ if ( nTmpDiff > 0 )
+ _iorLogicPgSwRect.Left( _iorLogicPgSwRect.Left() + nTmpDiff );
+ // top
+ nTmpDiff = aVisPrevwPgSwRect.Top() - _rPrevwPgSwRect.Top();
+ if ( nTmpDiff > 0 )
+ _iorLogicPgSwRect.Top( _iorLogicPgSwRect.Top() + nTmpDiff );
+ // right
+ nTmpDiff = _rPrevwPgSwRect.Right() - aVisPrevwPgSwRect.Right();
+ if ( nTmpDiff > 0 )
+ _iorLogicPgSwRect.Right( _iorLogicPgSwRect.Right() - nTmpDiff );
+ // bottom
+ nTmpDiff = _rPrevwPgSwRect.Bottom() - aVisPrevwPgSwRect.Bottom();
+ if ( nTmpDiff > 0 )
+ _iorLogicPgSwRect.Bottom( _iorLogicPgSwRect.Bottom() - nTmpDiff );
+}
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index d8e3f977a097..bab45c3cbf39 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accpage.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mib $ $Date: 2002-08-15 12:18:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -249,11 +249,14 @@ Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 5f596d0508ef..4feca8692506 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accpara.cxx,v $
*
- * $Revision: 1.47 $
+ * $Revision: 1.48 $
*
- * last change: $Author: mib $ $Date: 2002-12-05 14:10:33 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1099,11 +1099,14 @@ Sequence< Type > SAL_CALL SwAccessibleParagraph::getTypes() throw(RuntimeExcepti
Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
@@ -1263,8 +1266,8 @@ com::sun::star::awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
CHECK_FOR_WINDOW( XAccessibleComponent, pWin );
Rectangle aScreenRect( GetMap()->CoreToPixel( aCoreRect.SVRect() ));
- Point aFrmLogPos( GetBounds().Pos() ); // twip rel to doc root
- Point aFrmPixPos( GetMap()->CoreToPixel( aFrmLogPos ) );
+ SwRect aFrmLogBounds( GetBounds() ); // twip rel to doc root
+ Point aFrmPixPos( GetMap()->CoreToPixel( aFrmLogBounds.SVRect() ).TopLeft() );
aScreenRect.Move( -aFrmPixPos.X(), -aFrmPixPos.Y() );
// convert into AWT Rectangle
@@ -1288,6 +1291,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const com::sun::star::awt::Poi
{
vos::OGuard aGuard(Application::GetSolarMutex());
+
CHECK_FOR_DEFUNC( XAccessibleText );
// construct SwPosition (where GetCrsrOfst() will put the result into)
@@ -1300,7 +1304,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const com::sun::star::awt::Poi
CHECK_FOR_WINDOW( XAccessibleComponent, pWin );
Point aPoint( rPoint.X, rPoint.Y );
SwRect aLogBounds( GetBounds( GetFrm() ) ); // twip rel to doc root
- Point aPixPos( GetMap()->CoreToPixel( aLogBounds.Pos() ) );
+ Point aPixPos( GetMap()->CoreToPixel( aLogBounds.SVRect() ).TopLeft() );
aPoint.X() += aPixPos.X();
aPoint.Y() += aPixPos.Y();
MapMode aMapMode = pWin->GetMapMode();
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index 89acf5d63ad4..dac84cd53299 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accpreview.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mib $ $Date: 2002-08-15 10:25:19 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,10 @@
#pragma hdrstop
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
#ifndef _RTL_UUID_H_
#include <rtl/uuid.h>
#endif
@@ -131,10 +135,13 @@ Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 18524e54915d..3cdb7ff3b82f 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acctable.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-09-11 13:50:11 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -916,11 +916,14 @@ Sequence< ::com::sun::star::uno::Type > SAL_CALL SwAccessibleTable::getTypes() t
Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index acb0b890cca1..6e890ce25e2e 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acctextframe.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mib $ $Date: 2002-08-15 10:25:22 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -206,11 +206,14 @@ Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames()
Sequence< sal_Int8 > SAL_CALL SwAccessibleTextFrame::getImplementationId()
throw(RuntimeException)
{
+ vos::OGuard aGuard(Application::GetSolarMutex());
static Sequence< sal_Int8 > aId( 16 );
static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( reinterpret_cast< sal_uInt8 * >(aId.getArray() ),
- 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 69ad8c6b0894..afd1c7f135a7 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bparr.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mib $ $Date: 2001-11-28 13:47:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -117,11 +117,11 @@ BigPtrArray::~BigPtrArray()
BlockInfo** pp = ppInf;
for( USHORT n = 0; n < nBlock; ++n, ++pp )
{
- __DELETE( (*pp)->nElem ) (*pp)->pData;
- delete *pp;
+ delete[] (*pp)->pData;
+ delete *pp;
}
}
- __DELETE( nMaxBlock ) ppInf;
+ delete[] ppInf;
}
// Einfachst-Implementation, evtl. spaeter mal komplexer
@@ -278,7 +278,7 @@ BlockInfo* BigPtrArray::InsBlock( USHORT pos )
// dann sollte wir mal das Array erweitern
BlockInfo** ppNew = new BlockInfo* [ nMaxBlock + nBlockGrowSize ];
memcpy( ppNew, ppInf, nMaxBlock * sizeof( BlockInfo* ));
- __DELETE( nMaxBlock ) ppInf;
+ delete[] ppInf;
nMaxBlock += nBlockGrowSize;
ppInf = ppNew;
}
@@ -309,7 +309,7 @@ void BigPtrArray::BlockDel( USHORT nDel )
nDel = (( nBlock / nBlockGrowSize ) + 1 ) * nBlockGrowSize;
BlockInfo** ppNew = new BlockInfo* [ nDel ];
memcpy( ppNew, ppInf, nBlock * sizeof( BlockInfo* ));
- __DELETE( nMaxBlock ) ppInf;
+ delete[] ppInf;
ppInf = ppNew;
nMaxBlock = nDel;
}
@@ -449,7 +449,7 @@ void BigPtrArray::Remove( ULONG pos, ULONG n )
if( !p->nElem )
{
// eventuell Block ganz entfernen
- delete p->pData;
+ delete[] p->pData;
nBlkdel++;
if( USHRT_MAX == nBlk1del )
nBlk1del = cur;
@@ -588,8 +588,8 @@ USHORT BigPtrArray::Compress( short nMax )
if( !p->nElem )
{
// dann kann der entfernt werden
- delete p->pData;
- delete p, p = 0;
+ delete[] p->pData;
+ delete p, p = 0;
++nBlkdel;
}
else
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index c2ffd57314c2..342e2bff30ee 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: calc.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: fme $ $Date: 2002-11-07 09:43:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,8 +83,8 @@
#include <tools/svwin.h>
#endif
-#ifndef _TOOLS_SOLMATH_HXX
-#include <tools/solmath.hxx>
+#ifndef INCLUDED_RTL_MATH_HXX
+#include <rtl/math.hxx>
#endif
#ifndef _SVX_ADRITEM_HXX //autogen
#include <svx/adritem.hxx>
@@ -144,6 +144,9 @@
#ifndef _SWUNODEF_HXX
#include <swunodef.hxx>
#endif
+#ifndef _SWTYPES_HXX
+#include <swtypes.hxx>
+#endif
// tippt sich schneller
#define RESOURCE ViewShell::GetShellRes()
@@ -556,13 +559,11 @@ String SwCalc::GetStrResult( double nValue, BOOL bRound )
}
USHORT nDec = 15; //pLclData->getNumDigits();
- String aRetStr;
-
- SolarMath::DoubleToString( aRetStr, nValue,
- 'A', /// 'F' 'E' 'G' 'A'
- nDec, /// Nachkommastellen
- pLclData->getNumDecimalSep().GetChar(0), /// Dezimalseparator
- TRUE );
+ String aRetStr( ::rtl::math::doubleToUString( nValue,
+ rtl_math_StringFormat_Automatic,
+ nDec,
+ pLclData->getNumDecimalSep().GetChar(0),
+ true ));
return aRetStr;
}
@@ -1628,18 +1629,20 @@ FASTBOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
if( !pLclD )
pLclD = &GetAppLocaleData();
- const xub_Unicode *pEnd, nCurrCmdPos = rCommandPos;
- int nErrno;
- rVal = SolarMath::StringToDouble( rCommand.GetBuffer() + rCommandPos,
- pLclD->getNumThousandSep().GetChar(0),
- pLclD->getNumDecimalSep().GetChar(0),
- nErrno, &pEnd );
+ const xub_Unicode nCurrCmdPos = rCommandPos;
+ rtl_math_ConversionStatus eStatus;
+ const sal_Unicode* pEnd;
+ rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
+ rCommand.GetBuffer() + rCommand.Len(),
+ pLclD->getNumDecimalSep().GetChar(0),
+ pLclD->getNumThousandSep().GetChar(0),
+ &eStatus, &pEnd );
rCommandPos = pEnd - rCommand.GetBuffer();
if( !pLclData && pLclD != &GetAppLocaleData() )
delete (LocaleDataWrapper*)pLclD;
- return 0 == nErrno && nCurrCmdPos != rCommandPos;
+ return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos;
}
FASTBOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
@@ -1656,18 +1659,20 @@ FASTBOOL SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos,
SvxCreateLocale( eLang ) );
}
- const xub_Unicode *pEnd, nCurrCmdPos = rCommandPos;
- int nErrno;
- rVal = SolarMath::StringToDouble( rCommand.GetBuffer() + rCommandPos,
- pLclD->getNumThousandSep().GetChar(0),
- pLclD->getNumDecimalSep().GetChar(0),
- nErrno, &pEnd );
+ const xub_Unicode nCurrCmdPos = rCommandPos;
+ rtl_math_ConversionStatus eStatus;
+ const sal_Unicode* pEnd;
+ rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos,
+ rCommand.GetBuffer() + rCommand.Len(),
+ pLclD->getNumDecimalSep().GetChar(0),
+ pLclD->getNumThousandSep().GetChar(0),
+ &eStatus, &pEnd );
rCommandPos = pEnd - rCommand.GetBuffer();
if( pLclD != &GetAppLocaleData() )
delete (LocaleDataWrapper*)pLclD;
- return 0 == nErrno && nCurrCmdPos != rCommandPos;
+ return rtl_math_ConversionStatus_Ok == eStatus && nCurrCmdPos != rCommandPos;
}
//------------------------------------------------------------------------------
@@ -1740,7 +1745,6 @@ SwSbxValue::~SwSbxValue()
{
}
-
BOOL SwSbxValue::GetBool() const
{
return SbxSTRING == GetType() ? 0 != GetString().Len()
@@ -1755,6 +1759,10 @@ double SwSbxValue::GetDouble() const
xub_StrLen nStt = 0;
SwCalc::Str2Double( GetString(), nStt, nRet );
}
+ else if (IsBool())
+ {
+ nRet = 0 != GetBool() ? 1.0 : 0.0;
+ }
else
nRet = SbxValue::GetDouble();
return nRet;
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index a6b85ced9b74..ead3be0207b1 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: init.cxx,v $
*
- * $Revision: 1.35 $
+ * $Revision: 1.36 $
*
- * last change: $Author: os $ $Date: 2002-08-26 11:36:56 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -991,7 +991,7 @@ void _FinitCore()
#ifndef PRODUCT
//Defaultattribut freigeben lassen um asserts zu vermeiden.
- if ( aAttrTab[0]->GetRef() )
+ if ( aAttrTab[0]->GetRefCount() )
SfxItemPool::ReleaseDefaults( aAttrTab, POOLATTR_END-POOLATTR_BEGIN, FALSE);
#endif
delete SwDoc::pACmpltWords;
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index d44181235787..2dddf0139e2a 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: crsrsh.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-12-03 14:13:46 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -143,6 +143,9 @@
#ifndef _DOCSH_HXX
#include <docsh.hxx>
#endif
+#ifndef _DRAWFONT_HXX
+#include <drawfont.hxx>
+#endif
#ifndef _SWGLOBDOCSH_HXX //autogen
#include <globdoc.hxx>
#endif
@@ -437,7 +440,8 @@ FASTBOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
return bLeft ? GoPrevCell() : GoNextCell();
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- FASTBOOL bRet = pCurCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed );
+ FASTBOOL bRet = pCurCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed,
+ ! IsOverwriteCrsr() );
if( bRet )
UpdateCrsr();
return bRet;
@@ -2344,6 +2348,8 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pWin )
eMvState = MV_NONE; // Status fuers Crsr-Travelling - GetCrsrOfst
pVisCrsr = new SwVisCrsr( this );
// UpdateCrsr( 0 );
+ // OD 11.02.2003 #100556#
+ mbMacroExecAllowed = rShell.IsMacroExecAllowed();
}
@@ -2392,6 +2398,8 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pWin, SwRootFrm *pRoot,
pVisCrsr = new SwVisCrsr( this );
// UpdateCrsr( 0 );
+ // OD 11.02.2003 #100556#
+ mbMacroExecAllowed = true;
}
@@ -2785,7 +2793,9 @@ FASTBOOL SwCrsrShell::IsInVerticalText( const Point* pPt ) const
FASTBOOL SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const
{
const short nDir = GetTextDirection( pPt );
- return FRMDIR_HORI_RIGHT_TOP == nDir;
+ // GetTextDirection uses FRMDIR_VERT_TOP_LEFT to indicate RTL in
+ // vertical environment
+ return FRMDIR_VERT_TOP_LEFT == nDir || FRMDIR_HORI_RIGHT_TOP == nDir;
}
#else
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 699ec063b2cf..2d8e8f3ccf3e 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pam.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2002-02-01 12:37:59 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -552,6 +552,8 @@ SwPaM &SwPaM::operator=( SwPaM &rPam )
SetMark();
*pMark = *( rPam.pMark );
}
+ else
+ DeleteMark();
return *this;
}
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 886d81c78081..ace4e9f419fd 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swcrsr.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: fme $ $Date: 2002-12-03 12:58:01 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -420,35 +420,32 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
if( pNd->IsCntntNode() && 0 == (SwUnoCrsr*)*this )
{
const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->GetFrm();
- if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() )
+ if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() &&
+ 0 != ( SELOVER_CHANGEPOS & eFlags ) )
{
- if( 0 != ( SELOVER_CHANGEPOS & eFlags ) )
+ // skip to the next / prev valida paragraph with a layout
+ SwNodeIndex& rPtIdx = GetPoint()->nNode;
+ int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
+ while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm()
+ : pFrm->GetPrevCntntFrm() )) &&
+ 0 == pFrm->Frm().Height() )
+ ;
+
+ SwCntntNode* pCNd;
+ if( pFrm && 0 != (pCNd = (SwCntntNode*)pFrm->GetNode()) )
{
- // skip to the next / prev valida paragraph with a layout
- SwNodeIndex& rPtIdx = GetPoint()->nNode;
- int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
- while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm()
- : pFrm->GetPrevCntntFrm() )) &&
- 0 == pFrm->Frm().Height() )
- ;
-
- SwCntntNode* pCNd;
- if( pFrm && 0 != (pCNd = (SwCntntNode*)pFrm->GetNode()) )
- {
- // set this cntntNode as new position
- rPtIdx = *pCNd;
- pNd = pCNd;
+ // set this cntntNode as new position
+ rPtIdx = *pCNd;
+ pNd = pCNd;
- // ContentIndex noch anmelden:
- xub_StrLen nTmpPos = bGoNxt ? 0 : pCNd->Len();
- GetPoint()->nContent.Assign( pCNd, nTmpPos );
- // sollten wir in einer Tabelle gelandet sein?
- if( IsInProtectTable( TRUE ) )
- pFrm = 0;
- }
+ // ContentIndex noch anmelden:
+ xub_StrLen nTmpPos = bGoNxt ? 0 : pCNd->Len();
+ GetPoint()->nContent.Assign( pCNd, nTmpPos );
+
+ // sollten wir in einer Tabelle gelandet sein?
+ if( IsInProtectTable( TRUE ) )
+ pFrm = 0;
}
- else
- pFrm = 0;
}
if( !pFrm )
@@ -1097,7 +1094,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas,
*GetMark() = aMarkPos;
}
- if( nFound && SwCursor::IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS ) )
+ if( nFound && SwCursor::IsSelOvr( SELOVER_TOGGLE ) )
nFound = 0;
return nFound;
}
@@ -1289,10 +1286,12 @@ FASTBOOL SwCursor::GoPrevWord()
{
SwCrsrSaveState aSave( *this );
xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
+ const xub_StrLen nPtStart = nPtPos;
+
if( nPtPos )
--nPtPos;
nPtPos = (xub_StrLen)pBreakIt->xBreak->previousWord(
- pTxtNd->GetTxt(), nPtPos,
+ pTxtNd->GetTxt(), nPtStart,
pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos, 1 ) ),
WordType::ANYWORD_IGNOREWHITESPACES ).startPos;
@@ -1391,53 +1390,56 @@ FASTBOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
FASTBOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
- BOOL bVisualAllowed )
+ BOOL bVisualAllowed, BOOL bInsertCrsr )
{
SwTableCursor* pTblCrsr = (SwTableCursor*)*this;
if( pTblCrsr )
return bLeft ? pTblCrsr->GoPrevCell( nCnt )
: pTblCrsr->GoNextCell( nCnt );
-
+ // calculate cursor bidi level
+ const SwCntntFrm* pSttFrm = NULL;
SwNode& rNode = GetPoint()->nNode.GetNode();
- const BOOL bIsUnoCrsr = 0 != (SwUnoCrsr*)*this;
+ const BOOL bDoNotSetBidiLevel = 0 != (SwUnoCrsr*)*this;
- // The visual cursor travelling requires a layout. Therefore we do not
- // want this for an UnoCursor.
- if ( ! bIsUnoCrsr && rNode.IsTxtNode() )
+ if ( ! bDoNotSetBidiLevel )
{
- const SwTxtNode& rTNd = *rNode.GetTxtNode();
- SwIndex& rIdx = GetPoint()->nContent;
- xub_StrLen nPos = rIdx.GetIndex();
-
- SvtCTLOptions aCTLOptions;
- if ( bVisualAllowed && aCTLOptions.IsCTLFontEnabled() &&
- SvtCTLOptions::MOVEMENT_VISUAL ==
- aCTLOptions.GetCTLCursorMovement() )
+ if( rNode.IsTxtNode() )
{
- // for visual cursor travelling (used in bidi layout)
- // we first have to convert the logic to a visual position
- Point aPt;
- SwCntntFrm* pFrm = rTNd.GetFrm( &aPt, GetPoint() );
- if( pFrm )
+ const SwTxtNode& rTNd = *rNode.GetTxtNode();
+ SwIndex& rIdx = GetPoint()->nContent;
+ xub_StrLen nPos = rIdx.GetIndex();
+
+ SvtCTLOptions aCTLOptions;
+ if ( bVisualAllowed && aCTLOptions.IsCTLFontEnabled() &&
+ SvtCTLOptions::MOVEMENT_VISUAL ==
+ aCTLOptions.GetCTLCursorMovement() )
{
- BYTE nCrsrLevel = GetCrsrBidiLevel();
- sal_Bool bForward = ! bLeft;
- ((SwTxtFrm*)pFrm)->PrepareVisualMove( nPos, nCrsrLevel, bForward );
- rIdx = nPos;
- SetCrsrBidiLevel( nCrsrLevel );
- bLeft = ! bForward;
+ // for visual cursor travelling (used in bidi layout)
+ // we first have to convert the logic to a visual position
+ Point aPt;
+ pSttFrm = rTNd.GetFrm( &aPt, GetPoint() );
+ if( pSttFrm )
+ {
+ BYTE nCrsrLevel = GetCrsrBidiLevel();
+ sal_Bool bForward = ! bLeft;
+ ((SwTxtFrm*)pSttFrm)->PrepareVisualMove( nPos, nCrsrLevel,
+ bForward, bInsertCrsr );
+ rIdx = nPos;
+ SetCrsrBidiLevel( nCrsrLevel );
+ bLeft = ! bForward;
+ }
}
- }
- else
- {
- const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( rTNd );
- if ( pScriptInfo )
+ else
{
- const xub_StrLen nMoveOverPos = bLeft ?
- ( nPos ? nPos - 1 : 0 ) :
- nPos;
- SetCrsrBidiLevel( pScriptInfo->DirType( nMoveOverPos ) );
+ const SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( rTNd );
+ if ( pSI )
+ {
+ const xub_StrLen nMoveOverPos = bLeft ?
+ ( nPos ? nPos - 1 : 0 ) :
+ nPos;
+ SetCrsrBidiLevel( pSI->DirType( nMoveOverPos ) );
+ }
}
}
}
@@ -1449,6 +1451,27 @@ FASTBOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
while( nCnt && Move( fnMove, fnGo ) )
--nCnt;
+ // here come some special rules for visual cursor travelling
+ if ( pSttFrm )
+ {
+ SwNode& rTmpNode = GetPoint()->nNode.GetNode();
+ if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() )
+ {
+ Point aPt;
+ const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).GetFrm( &aPt, GetPoint() );
+ if ( pEndFrm )
+ {
+ if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() )
+ {
+ if ( ! bLeft )
+ pEndFrm->RightMargin( this );
+ else
+ pEndFrm->LeftMargin( this );
+ }
+ }
+ }
+ }
+
return 0 == nCnt && !IsInProtectTable( TRUE ) &&
!IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS );
}
@@ -1540,6 +1563,37 @@ FASTBOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
}
else
*GetPoint() = aOldPos;
+
+ // calculate cursor bidi level
+ const BOOL bDoNotSetBidiLevel = 0 != (SwUnoCrsr*)*this;
+
+ if ( ! bDoNotSetBidiLevel )
+ {
+ SwNode& rNode = GetPoint()->nNode.GetNode();
+ if ( rNode.IsTxtNode() )
+ {
+ const SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( (SwTxtNode&)rNode );
+ if ( pSI )
+ {
+ SwIndex& rIdx = GetPoint()->nContent;
+ xub_StrLen nPos = rIdx.GetIndex();
+
+ if( nPos && nPos < ((SwTxtNode&)rNode).GetTxt().Len() )
+ {
+ const BYTE nCurrLevel = pSI->DirType( nPos );
+ const BYTE nPrevLevel = pSI->DirType( nPos - 1 );
+
+ if ( nCurrLevel % 2 != nPrevLevel % 2 )
+ {
+ // set cursor level to the lower of the two levels
+ SetCrsrBidiLevel( Min( nCurrLevel, nPrevLevel ) );
+ }
+ else
+ SetCrsrBidiLevel( nCurrLevel );
+ }
+ }
+ }
+ }
}
return bRet;
}
@@ -1548,6 +1602,11 @@ FASTBOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI )
{
Point aPt;
SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+
+ // calculate cursor bidi level
+ if ( pFrm )
+ SetCrsrBidiLevel( pFrm->IsRightToLeft() ? 1 : 0 );
+
return pFrm && (bLeft ? pFrm->LeftMargin( this )
: pFrm->RightMargin( this, bAPI ));
}
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index af41f46db34b..8071a0502e4e 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viscrs.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: fme $ $Date: 2002-09-17 14:34:06 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -125,6 +125,9 @@
#ifndef _NDTXT_HXX
#include <ndtxt.hxx>
#endif
+#ifndef _DRAWFONT_HXX
+#include <drawfont.hxx>
+#endif
#ifndef _MDIEXP_HXX
#include <mdiexp.hxx> // GetSearchDialog
@@ -134,7 +137,8 @@
#endif
-extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
+// OD 24.01.2003 #106593# - no longer needed, included in <frmtool.hxx>
+//extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
extern void SwCalcPixStatics( OutputDevice *pOut );
@@ -528,6 +532,30 @@ void SwVisCrsr::_SetPosAndShow()
Size( pCrsrShell->aCharRect.Width(), nTmpY ) );
aRect.Pos().Y() += pCrsrShell->aCrsrHeight.X();
}
+
+ // check if cursor should show the current cursor bidi level
+ aTxtCrsr.SetDirection( CURSOR_DIRECTION_NONE );
+ const SwCursor* pTmpCrsr = pCrsrShell->_GetCrsr();
+
+ if ( pTmpCrsr && !pCrsrShell->IsOverwriteCrsr() )
+ {
+ SwNode& rNode = pTmpCrsr->GetPoint()->nNode.GetNode();
+ if( rNode.IsTxtNode() )
+ {
+ const SwTxtNode& rTNd = *rNode.GetTxtNode();
+ const SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( rTNd );
+
+ // cursor level has to be shown
+ if ( pSI && pSI->CountDirChg() > 1 )
+ {
+ aTxtCrsr.SetDirection(
+ ( pTmpCrsr->GetCrsrBidiLevel() % 2 ) ?
+ CURSOR_DIRECTION_RTL :
+ CURSOR_DIRECTION_LTR );
+ }
+ }
+ }
+
if( aRect.Height() )
{
::SwCalcPixStatics( pCrsrShell->GetOut() );
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 5a9f5fab487c..f2316267cf8a 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SwStyleNameMapper.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: os $ $Date: 2002-06-05 14:48:36 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1116,3 +1116,57 @@ const SvStringsDtor& SwStyleNameMapper::GetNumRuleProgNameArray()
*NewProgNameArray( pNumRuleProgNameArray, NumRuleProgNameTable,
sizeof ( NumRuleProgNameTable ) / sizeof ( SwTableEntry ) );
}
+
+
+const String SwStyleNameMapper::GetSpecialExtraProgName( const String& rExtraUIName )
+{
+ String aRes = rExtraUIName;
+ BOOL bChgName = FALSE;
+ const SvStringsDtor& rExtraArr = GetExtraUINameArray();
+ static sal_uInt16 nIds[] =
+ {
+ RES_POOLCOLL_LABEL_DRAWING - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_ABB - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_TABLE - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_FRAME- RES_POOLCOLL_EXTRA_BEGIN,
+ 0
+ };
+ for (const sal_uInt16 * pIds = nIds; *pIds; ++pIds)
+ {
+ if (aRes == *rExtraArr[ *pIds ])
+ {
+ bChgName = TRUE;
+ break;
+ }
+ }
+ if (bChgName)
+ aRes = *GetExtraProgNameArray()[*pIds];
+ return aRes;
+}
+
+const String SwStyleNameMapper::GetSpecialExtraUIName( const String& rExtraProgName )
+{
+ String aRes = rExtraProgName;
+ BOOL bChgName = FALSE;
+ const SvStringsDtor& rExtraArr = GetExtraProgNameArray();
+ static sal_uInt16 nIds[] =
+ {
+ RES_POOLCOLL_LABEL_DRAWING - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_ABB - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_TABLE - RES_POOLCOLL_EXTRA_BEGIN,
+ RES_POOLCOLL_LABEL_FRAME- RES_POOLCOLL_EXTRA_BEGIN,
+ 0
+ };
+ for (const sal_uInt16 * pIds = nIds; *pIds; ++pIds)
+ {
+ if (aRes == *rExtraArr[ *pIds ])
+ {
+ bChgName = TRUE;
+ break;
+ }
+ }
+ if (bChgName)
+ aRes = *GetExtraUINameArray()[*pIds];
+ return aRes;
+}
+
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 740f3b663033..3d3c6a154a73 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docbm.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dvo $ $Date: 2002-11-07 18:39:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -480,17 +480,16 @@ void _DelBookmarks( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
for( nCnt = 0; nCnt < rTbl.Count(); ++nCnt )
{
// liegt auf der Position ??
+ int eType = BKMK_POS_NONE;
SwRedline* pRedl = rTbl[ nCnt ];
- // get start/end positions
- SwPosition *pRStt = pRedl->GetPoint(),
- *pREnd = pRedl->GetMark();
+ SwPosition *pRStt = &pRedl->GetBound(TRUE),
+ *pREnd = &pRedl->GetBound(FALSE);
if( *pRStt > *pREnd )
{
- SwPosition *pTmp = pRStt; pRStt = pREnd; pREnd = pTmp;
+ SwPosition *pTmp = pRStt; pRStt = pREnd, pREnd = pTmp;
}
- // treat start position
if( Greater( *pRStt, rStt, pSttIdx ) && Lower( *pRStt, rEnd, pEndIdx ))
{
pRStt->nNode = rEnd;
@@ -514,10 +513,7 @@ void _DelBookmarks( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
pRStt->nContent.Assign( pCNd, nTmp );
}
}
-
- // treat end position (unless start == end, i.e. no mark)
- if( ( pRStt != pREnd ) &&
- Greater( *pREnd, rStt, pSttIdx ) && Lower( *pREnd, rEnd, pEndIdx ))
+ if( Greater( *pREnd, rStt, pSttIdx ) && Lower( *pREnd, rEnd, pEndIdx ))
{
pREnd->nNode = rStt;
if( pSttIdx )
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 3c65a80803ee..bb5d1081705f 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doccomp.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: dvo $ $Date: 2002-11-11 15:24:59 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -91,13 +91,6 @@
#include <sfx2/docinf.hxx>
#endif
-#ifdef JP_DUMP
-#include <stdio.h>
-#ifndef _STREAM_HXX //autogen
-#include <tools/stream.hxx>
-#endif
-#endif
-
#ifndef _DOC_HXX
#include <doc.hxx>
#endif
@@ -200,11 +193,6 @@ public:
{ return aLines.GetObject( nLine ); }
void InsertLine( CompareLine* pLine )
{ aLines.Insert( pLine, LIST_APPEND ); }
-
-#ifdef JP_DUMP
- // zum Debuggen!
- virtual void Dump();
-#endif
};
class Hash
@@ -306,12 +294,6 @@ void CompareData::SetIndex( ULONG nLine, ULONG nIndex )
pIndex[ nLine ] = nIndex;
}
-#ifdef JP_DUMP
-void CompareData::Dump()
-{
-}
-#endif
-
void CompareData::SetChanged( ULONG nLine, BOOL bFlag )
{
if( !pChangedFlag )
@@ -719,9 +701,6 @@ Compare::CompareSequence::CompareSequence(
pFDiag = pMemory + ( rMD2.GetCount() + 1 );
pBDiag = pMemory + ( nSize + rMD2.GetCount() + 1 );
-#ifdef JP_DUMP
- rD1.Dump(), rD2.Dump();
-#endif
Compare( 0, rMD1.GetCount(), 0, rMD2.GetCount() );
}
@@ -977,11 +956,6 @@ public:
virtual ~SwCompareData();
void SetRedlinesToDoc( BOOL bUseDocInfo, const SwDoc& rSrcDoc );
-
-#ifdef JP_DUMP
- // zum Debuggen!
- virtual void Dump();
-#endif
};
// ----------------------------------------------------------------
@@ -1576,34 +1550,6 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo, const SwDoc& rSrcDoc )
}
}
-#ifdef JP_DUMP
-void SwCompareData::Dump()
-{
- static int nFirst = 1;
- SvFileStream aStrm( "d:\\tmp\\compare.dmp", nFirst
- ? STREAM_WRITE | STREAM_TRUNC
- : STREAM_WRITE | STREAM_NOCREATE );
- if( !nFirst )
- aStrm.Seek( STREAM_SEEK_TO_END );
-
- nFirst = 0;
-
- aStrm << "\n";
- ULONG nLCount = aLines.Count();
- for( ULONG n = 0; n < nLCount; ++n )
- {
- SwCompareLine* pLine = (SwCompareLine*)GetLine( n );
- String sTxt( pLine->GetText() );
- char sBuffer[ 20 ];
- sprintf( sBuffer, "[%4ld][%3ld][%1d]",
- pLine->GetNode().GetIndex(),
- GetIndex( n ), GetChanged( n ) );
- ( aStrm << sBuffer ).WriteByteString( sTxt ) << '\n';
- }
-}
-
-#endif
-
/* */
@@ -1639,10 +1585,6 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
SetModified();
}
-#ifdef JP_DUMP
- aD0.Dump(), aD1.Dump();
-#endif
-
rSrcDoc.SetRedlineMode( eSrcRedlMode );
SetRedlineMode( REDLINE_SHOW_INSERT | REDLINE_SHOW_DELETE );
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 33095bf50dd6..c57cdf9401b3 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docdesc.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-12-04 14:34:31 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -687,8 +687,6 @@ void SwDoc::DelPageDesc( USHORT i )
|*
|*************************************************************************/
-extern SvxFrameDirection lcl_GetFrameDirection(ULONG aLanguage);
-
USHORT SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
BOOL bRegardLanguage)
{
@@ -712,7 +710,7 @@ USHORT SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
GetPrt(), FALSE );
SvxFrameDirection aFrameDirection = bRegardLanguage ?
- lcl_GetFrameDirection(GetAppLanguage())
+ GetDefaultFrameDirection(GetAppLanguage())
: FRMDIR_HORI_LEFT_TOP;
pNew->GetMaster().SetAttr( SvxFrameDirectionItem(aFrameDirection) );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 22c0db2a7b6b..706c62a7aae8 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docedt.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: dvo $ $Date: 2002-10-10 16:29:45 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2181,13 +2181,19 @@ sal_Bool SwDoc::DelFullPara( SwPaM& rPam )
pNd->StartOfSectionIndex();
sal_uInt32 nNodeDiff = rEnd.nNode.GetIndex() - rStt.nNode.GetIndex();
- if( nSectDiff-2 <= nNodeDiff || IsRedlineOn() )
+ if ( nSectDiff-2 <= nNodeDiff || IsRedlineOn() ||
+ /* #i9185# Prevent getting the node after the end node (see below) */
+ rEnd.nNode.GetIndex() + 1 == aNodes.Count() )
return sal_False;
// harte SeitenUmbrueche am nachfolgenden Node verschieben
sal_Bool bSavePageBreak = sal_False, bSavePageDesc = sal_False;
+
+ /* #i9185# This whould lead to a segmentation fault if not catched
+ above. */
sal_uInt32 nNextNd = rEnd.nNode.GetIndex() + 1;
- SwTableNode* pTblNd = GetNodes()[ nNextNd ]->GetTableNode();
+ SwTableNode* pTblNd = aNodes[ nNextNd ]->GetTableNode();
+
if( pTblNd && pNd->IsCntntNode() )
{
SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt();
@@ -2277,6 +2283,7 @@ sal_Bool SwDoc::DelFullPara( SwPaM& rPam )
}
rPam.DeleteMark();
SetModified();
+
return sal_True;
}
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 2190d1a92ee6..0c639a029ff6 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docfld.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: od $ $Date: 2002-10-10 09:14:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1279,6 +1279,10 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& 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
+ pSFld->ChgExpStr( aNew );
+
// suche den Namen vom Feld
aNew = ((SwSetExpFieldType*)pSFld->GetTyp())->GetSetRefName();
// Eintrag vorhanden ?
@@ -2150,6 +2154,8 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
String sFormel(rFormel);
String sNewName( rNewName );
sNewName.SearchAndReplace( DB_DELIM, '.');
+ //the command type is not part of the condition
+ sNewName = sNewName.GetToken(0, DB_DELIM);
String sUpperNewNm( sNewName );
@@ -2158,7 +2164,9 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
String sDBName( *rUsedDBNames.GetObject( i ) );
sDBName.SearchAndReplace( DB_DELIM, '.');
- if( sDBName.Equals( sUpperNewNm ))
+ //cut off command type
+ sDBName = sDBName.GetToken(0, DB_DELIM);
+ if( !sDBName.Equals( sUpperNewNm ))
{
xub_StrLen nPos = 0;
@@ -2169,6 +2177,10 @@ void SwDoc::ReplaceUsedDBs( const SvStringsDtor& rUsedDBNames,
{
rFormel.Erase( nPos, sDBName.Len() );
rFormel.Insert( sNewName, nPos );
+ //prevent re-searching - this is useless and provokes
+ //endless loops when names containing each other and numbers are exchanged
+ //e.g.: old 12345.12345 new: i12345.12345
+ nPos += sNewName.Len();
sFormel = rFormel;
}
}
@@ -2643,7 +2655,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich )
Point aPt;
const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, FALSE );
- _SetGetExpFld* pNew;
+ _SetGetExpFld* pNew = NULL;
BOOL bIsInBody = FALSE;
if( !pFrm || pFrm->IsInDocBody() )
@@ -2651,7 +2663,13 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich )
// einen Index fuers bestimmen vom TextNode anlegen
SwNodeIndex aIdx( rTxtNd );
bIsInBody = rDoc.GetNodes().GetEndOfExtras().GetIndex() < aIdx.GetIndex();
- pNew = new _SetGetExpFld( aIdx, &rTFld );
+
+ // #104291# dvo: 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.
+ if( (pFrm != NULL) || bIsInBody )
+ pNew = new _SetGetExpFld( aIdx, &rTFld );
}
else
{
@@ -2677,8 +2695,9 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich )
pDBFld->ChgBodyTxtFlag( bIsInBody );
}
- if( !pFldSortLst->Insert( pNew ))
- delete pNew;
+ if( pNew != NULL )
+ if( !pFldSortLst->Insert( pNew ))
+ delete pNew;
}
void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index cac250512e4e..319cace70c0e 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doclay.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mib $ $Date: 2002-07-24 13:12:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1135,11 +1135,43 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
|*
|*************************************************************************/
+/* #i6447# changed behaviour if lcl_CpyAttr:
+
+ If the old item set contains the item to set (no inheritance) copy the item
+ into the new set.
+
+ If the old item set contains the item by inheritance and the new set
+ contains the item, too:
+ If the two items differ copy the item from the old set to the new set.
+
+ Otherwise the new set will not be changed.
+*/
+
void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uInt16 nWhich )
{
- const SfxPoolItem *pItem;
- if ( SFX_ITEM_SET == (rOldSet.GetItemState( nWhich, sal_False, &pItem)))
- rNewSet.Put( *pItem );
+ const SfxPoolItem *pOldItem = NULL, *pNewItem = NULL;
+
+ rOldSet.GetItemState( nWhich, sal_False, &pOldItem);
+ if (pOldItem != NULL)
+ rNewSet.Put( *pOldItem );
+ else
+ {
+ pOldItem = rOldSet.GetItem( nWhich, sal_True);
+ if (pOldItem != NULL)
+ {
+ pNewItem = rNewSet.GetItem( nWhich, sal_True);
+ if (pNewItem != NULL)
+ {
+ if (*pOldItem != *pNewItem)
+ rNewSet.Put( *pOldItem );
+ }
+ else
+ ASSERT(0, "What am I doing here?");
+ }
+ else
+ ASSERT(0, "What am I doing here?");
+ }
+
}
@@ -1229,11 +1261,14 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt,
ASSERT( pOldFmt, "Format des Fly nicht gefunden." );
pOldFmt->DelFrms();
- SfxItemSet* pNewSet = pOldFmt->GetAttrSet().Clone( sal_False );
-
pNewFmt = MakeFlyFrmFmt( GetUniqueFrameName(),
GetFrmFmtFromPool( RES_POOLFRM_FRAME ));
+ /* #i6447#: Only the selected items are copied from the old
+ format. */
+ SfxItemSet* pNewSet = pNewFmt->GetAttrSet().Clone( sal_True );
+
+
//Diejenigen Attribute uebertragen die auch gesetzt sind,
//andere sollen weiterhin aus den Vorlagen gueltig werden.
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_PRINT );
@@ -1244,6 +1279,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt,
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_HORI_ORIENT );
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_LR_SPACE );
lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_UL_SPACE );
+ lcl_CpyAttr( *pNewSet, pOldFmt->GetAttrSet(), RES_BACKGROUND );
if( bCpyBrd )
{
// JP 07.07.99: Bug 67029 - if at Grafik no BoxItem but
@@ -1322,6 +1358,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt,
pNewSet->ClearItem();
pNewSet->Put( SwFmtSurround( SURROUND_NONE ) );
+ pNewSet->Put( SvxOpaqueItem( RES_OPAQUE, sal_True ) );
pNewSet->Put( SwFmtVertOrient( VERT_TOP ) );
pNewSet->Put( SwFmtHoriOrient( HORI_CENTER ) );
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index d7afd642216b..188ca770dead 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docnum.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: od $ $Date: 2002-12-10 16:03:17 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -505,8 +505,10 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
sName.Erase( 0, nPos );
nPos = 0;
sNum = sName.GetToken( 0, '.', nPos );
+ // #i4533# without this check all parts delimited by a dot are treated as outline numbers
+ if(!ByteString(sNum, gsl_getSystemTextEncoding()).IsNumericAscii())
+ nPos = STRING_NOTFOUND;
}
-
rName = sName; // das ist der nachfolgende Text.
// alle Levels gelesen, dann suche mal im Document nach dieser
@@ -591,7 +593,21 @@ BOOL SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
if( USHRT_MAX != nFndPos )
{
SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode();
- if( !pNd->GetExpandTxt().Equals( sName ) )
+ String sExpandedText = pNd->GetExpandTxt();
+ //#i4533# leading numbers followed by a dot have been remove while
+ //searching for the outline position
+ //to compensate this they must be removed from the paragraphs text content, too
+ USHORT nPos = 0;
+ String sTempNum;
+ while(sExpandedText.Len() && (sTempNum = sExpandedText.GetToken(0, '.', nPos)).Len() &&
+ STRING_NOTFOUND != nPos &&
+ ByteString(sTempNum, gsl_getSystemTextEncoding()).IsNumericAscii())
+ {
+ sExpandedText.Erase(0, nPos);
+ nPos = 0;
+ }
+
+ if( !sExpandedText.Equals( sName ) )
{
USHORT nTmp = ::lcl_FindOutlineName( GetNodes(), sName, TRUE );
if( USHRT_MAX != nTmp ) // ueber den Namen gefunden
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index db7a1aedca84..1169ef788152 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docredln.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: dvo $ $Date: 2002-11-28 17:45:15 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -162,6 +162,14 @@
for( USHORT i = 0; i < rTbl.Count(); ++i )
lcl_CheckPam( rTbl[ i ] );
+ for( USHORT j = 0; j < rTbl.Count(); ++j )
+ {
+ // check for empty redlines
+ ASSERT( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
+ ( rTbl[j]->GetContentIdx() != NULL ),
+ "redline table corrupted: empty redline" );
+ }
+
// verify proper redline sorting
for( USHORT n = 1; n < rTbl.Count(); ++n )
{
@@ -291,11 +299,24 @@ BOOL SwDoc::AppendRedline( SwRedline* pNewRedl, BOOL bCallDelete )
for( ; pNewRedl && n < pRedlineTbl->Count(); ++n )
{
+
+#ifdef DVO_TEST
+ _CHECK_REDLINE( this )
+#endif
+
SwRedline* pRedl = (*pRedlineTbl)[ n ];
SwPosition* pRStt = pRedl->Start(),
* pREnd = pRStt == pRedl->GetPoint() ? pRedl->GetMark()
: pRedl->GetPoint();
+ // #i8518# remove empty redlines while we're at it
+ if( ( *pRStt == *pREnd ) &&
+ ( pRedl->GetContentIdx() == NULL ) )
+ {
+ pRedlineTbl->DeleteAndDestroy(n);
+ continue;
+ }
+
SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd );
switch( pNewRedl->GetType() )
@@ -336,6 +357,14 @@ BOOL SwDoc::AppendRedline( SwRedline* pNewRedl, BOOL bCallDelete )
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl );
}
+ else if ( POS_OUTSIDE == eCmpPos )
+ {
+ // #107164# own insert-over-insert
+ // redlines: just scrap the inside ones
+ pRedlineTbl->Remove( n );
+ n--;
+ break;
+ }
else if( POS_INSIDE != eCmpPos && POS_EQUAL != eCmpPos)
break;
@@ -372,6 +401,18 @@ BOOL SwDoc::AppendRedline( SwRedline* pNewRedl, BOOL bCallDelete )
pNewRedl->SetStart( *pREnd );
pRedlineTbl->Insert( pSplit );
}
+ else if ( POS_OVERLAP_BEHIND == eCmpPos )
+ {
+ // #107164# handle overlapping redlines in broken
+ // documents
+ pNewRedl->SetStart( *pREnd );
+ }
+ else if ( POS_OVERLAP_BEFORE == eCmpPos )
+ {
+ // #107164# handle overlapping redlines in broken
+ // documents
+ pNewRedl->SetEnd( *pRStt );
+ }
break;
case REDLINE_DELETE:
if( POS_INSIDE == eCmpPos )
@@ -518,7 +559,27 @@ BOOL SwDoc::AppendRedline( SwRedline* pNewRedl, BOOL bCallDelete )
pNewRedl->SetStart( *pRStt, pStt );
else
pNewRedl->SetEnd( *pREnd, pEnd );
- pRedlineTbl->DeleteAndDestroy( n-- );
+
+ // delete current (below), and restart process with
+ // previous
+ USHORT nToBeDeleted = n;
+ n--;
+
+ // #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'
+ // beyond previous redlines, so better start
+ // again. Of course this is not supposed to
+ // happen, and in an ideal world it doesn't,
+ // but unfortunately this code is buggy and
+ // totally rotten so it does happen and we
+ // better fix it.
+ n = -1;
+ }
+
+ pRedlineTbl->DeleteAndDestroy( nToBeDeleted );
}
break;
}
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index eca9c8744e38..256efbf7d70e 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsort.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2002-03-21 13:12:29 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,8 +69,8 @@
#include <hintids.hxx>
#endif
-#ifndef _TOOLS_SOLMATH_HXX
-#include <tools/solmath.hxx>
+#ifndef INCLUDED_RTL_MATH_HXX
+#include <rtl/math.hxx>
#endif
#ifndef _UNOTOOLS_COLLATORWRAPPER_HXX
#include <unotools/collatorwrapper.hxx>
@@ -213,14 +213,14 @@ double SwSortElement::StrToDouble( const String& rStr ) const
pLclData = new LocaleDataWrapper(
::comphelper::getProcessServiceFactory(), *pLocale );
- const xub_Unicode *pEnd;
- int nErrno;
- double nRet = SolarMath::StringToDouble( rStr.GetBuffer(),
- pLclData->getNumThousandSep().GetChar(0),
+ rtl_math_ConversionStatus eStatus;
+ sal_Int32 nEnd;
+ double nRet = ::rtl::math::stringToDouble( rStr,
pLclData->getNumDecimalSep().GetChar(0),
- nErrno, &pEnd );
+ pLclData->getNumThousandSep().GetChar(0),
+ &eStatus, &nEnd );
- if( 0 != nErrno || pEnd == rStr.GetBuffer() )
+ if( rtl_math_ConversionStatus_Ok != eStatus || nEnd == 0 )
nRet = 0.0;
return nRet;
}
@@ -587,7 +587,12 @@ BOOL SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
// Auf gehts sortieren
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );;
+ }
+
if(!aFndBox.GetLines().Count())
return FALSE;
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 85e233701fef..c4d880840052 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doctxm.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-10-29 14:37:26 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1493,7 +1493,15 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTxtNode* pOwnChapterNode,
rTxtNode.GetNodes().IsDocNodes() /*&&
(!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */)
{
- SwTOXAuthority* pNew = new SwTOXAuthority( rTxtNode, *pFmtFld, rIntl );
+ //#106485# the body node has to be used!
+ SwCntntFrm *pFrm = rTxtNode.GetFrm();
+ SwPosition aFldPos(rTxtNode);
+ const SwTxtNode* pTxtNode = 0;
+ if(pFrm && !pFrm->IsInDocBody())
+ pTxtNode = GetBodyTxtNode( *pDoc, aFldPos, *pFrm );
+ if(!pTxtNode)
+ pTxtNode = &rTxtNode;
+ SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode, *pFmtFld, rIntl );
InsertSorted(pNew);
}
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 7bbbdae60267..b4831304a9ed 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: notxtfrm.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: od $ $Date: 2002-11-29 15:09:22 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -213,11 +213,12 @@
#define DEFTEXTSIZE 12
-/// OD 25.09.2002 #99739# - insert declaration of global methods <SwAlignRect>
-/// and <SwAlignGrtRect>.
-/// Methods are implemented in /core/layout/paintfrm.cxx
-extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
-extern void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
+// OD 25.09.2002 #99739# - insert declaration of global methods <SwAlignRect>
+// and <SwAlignGrtRect>.
+// Methods are implemented in /core/layout/paintfrm.cxx
+// OD 24.01.2003 #106593# - no longer needed, included in <frmtool.hxx>
+//extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
+//extern void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
//Zum asynchronen (erstmaligem) anfordern von Grafiken
class SwRequestGraphic : public SwClient
@@ -485,7 +486,8 @@ void SwNoTxtFrm::Paint( const SwRect &rRect ) const
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
- if ( pSh->GetWin() )
+ // OD 10.01.2003 #i6467# - no paint of placeholder for page preview
+ if ( pSh->GetWin() && !pSh->IsPreView() )
{
const SwNoTxtNode* pNd = GetNode()->GetNoTxtNode();
String aTxt( pNd->GetAlternateText() );
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 829b5cdb41b3..21616f836f74 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: poolfmt.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-12-04 14:38:05 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,6 +138,9 @@
#ifndef _SVX_FRMDIRITEM_HXX
#include <svx/frmdiritem.hxx>
#endif
+#ifndef _SVX_EMPHITEM_HXX
+#include <svx/emphitem.hxx>
+#endif
#ifndef _VIEWOPT_HXX
#include <viewopt.hxx>
#endif
@@ -435,7 +438,7 @@ void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
// Ist der String-Pointer definiert, dann erfrage nur die
// Beschreibung der Attribute, !! es legt keine Vorlage an !!
-SvxFrameDirection lcl_GetFrameDirection(ULONG nLanguage)
+SvxFrameDirection GetDefaultFrameDirection(ULONG nLanguage)
{
SvxFrameDirection eResult = FRMDIR_HORI_LEFT_TOP;
@@ -555,7 +558,8 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool
// allgemeine Inhaltsformen
case RES_POOLCOLL_STANDARD:
if (bRegardLanguage &&
- lcl_GetFrameDirection(GetAppLanguage()) == FRMDIR_HORI_RIGHT_TOP)
+ GetDefaultFrameDirection(GetAppLanguage()) ==
+ FRMDIR_HORI_RIGHT_TOP)
{
SvxAdjustItem aAdjust(SVX_ADJUST_RIGHT);
aSet.Put(aAdjust);
@@ -1432,6 +1436,8 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId, String* pDesc,
long nH = ((SvxFontHeightItem*)GetDfltAttr(
RES_CHRATR_CJK_FONTSIZE ))->GetHeight() / 2;
SetAllScriptItem( aSet, SvxFontHeightItem( nH ));
+ aSet.Put(SvxUnderlineItem( UNDERLINE_NONE ));
+ aSet.Put(SvxEmphasisMarkItem( EMPHASISMARK_NONE) );
}
break;
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index e11da889ac06..612fb927667e 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tblcpy.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2002-03-21 13:12:30 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -392,7 +392,12 @@ BOOL SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
USHORT nLn, nBx;
_FndLine *pFLine, *pInsFLine = 0;
- _FndBox aFndBox( rSelBoxes );
+ _FndBox aFndBox( 0, 0 );
+ // suche alle Boxen / Lines
+ {
+ _FndPara aPara( rSelBoxes, &aFndBox );
+ ((SwTableLines&)GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
+ }
// JP 06.09.96: Sonderfall - eine Box in der Tabelle -> in alle
// selektierten Boxen kopieren!
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index eebcef006252..736b703f5691 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tblrwcl.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: fme $ $Date: 2002-11-15 09:31:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -588,7 +588,11 @@ BOOL SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -625,7 +629,11 @@ BOOL SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -702,6 +710,41 @@ BOOL SwTable::InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return TRUE;
}
+BOOL _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara );
+
+BOOL _FndBoxAppendRowBox( const SwTableBox*& rpBox, void* pPara )
+{
+ _FndPara* pFndPara = (_FndPara*)pPara;
+ _FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
+ if( rpBox->GetTabLines().Count() )
+ {
+ _FndPara aPara( *pFndPara, pFndBox );
+ pFndBox->GetBox()->GetTabLines().ForEach( &_FndBoxAppendRowLine, &aPara );
+ if( !pFndBox->GetLines().Count() )
+ delete pFndBox;
+ }
+ else
+ pFndPara->pFndLine->GetBoxes().C40_INSERT( _FndBox, pFndBox,
+ pFndPara->pFndLine->GetBoxes().Count() );
+ return TRUE;
+}
+
+BOOL _FndBoxAppendRowLine( const SwTableLine*& rpLine, void* pPara )
+{
+ _FndPara* pFndPara = (_FndPara*)pPara;
+ _FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
+ _FndPara aPara( *pFndPara, pFndLine );
+ pFndLine->GetLine()->GetTabBoxes().ForEach( &_FndBoxAppendRowBox, &aPara );
+ if( pFndLine->GetBoxes().Count() )
+ {
+ pFndPara->pFndBox->GetLines().C40_INSERT( _FndLine, pFndLine,
+ pFndPara->pFndBox->GetLines().Count() );
+ }
+ else
+ delete pFndLine;
+ return TRUE;
+}
+
BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
{
@@ -710,7 +753,15 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( *GetTabLines()[ GetTabLines().Count()-1 ] );
+ _FndBox aFndBox( 0, 0 );
+ {
+ const SwTableLine* pLLine = GetTabLines()[ GetTabLines().Count()-1 ];
+
+ const SwSelBoxes* pBxs = 0; // Dummy !!!
+ _FndPara aPara( *pBxs, &aFndBox );
+
+ _FndBoxAppendRowLine( pLLine, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -1683,7 +1734,11 @@ BOOL SwTable::Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -1953,7 +2008,11 @@ BOOL SwTable::CopyHeadlineIntoTable( SwTableNode& rTblNd )
pBox = GetTblBox( pBox->GetSttNd()->FindStartNode()->GetIndex() + 1 );
SelLineFromBox( pBox, aSelBoxes, TRUE );
- _FndBox aFndBox( aSelBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( aSelBoxes, &aFndBox );
+ ((SwTableLines&)GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -1978,7 +2037,11 @@ BOOL SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
BOOL bCpyName ) const
{
// suche alle Boxen / Lines
- _FndBox aFndBox( rSelBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rSelBoxes, &aFndBox );
+ ((SwTableLines&)GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -3285,15 +3348,13 @@ _FndBox* lcl_SaveInsDelData( CR_SetBoxWidth& rParam, SwUndo** ppUndo,
rTbl.GetTabSortBoxes().Count() )
return 0;
- _FndBox* pFndBox;
+ _FndBox* pFndBox = new _FndBox( 0, 0 );
if( rParam.bBigger )
- {
- pFndBox = new _FndBox( 0, 0 );
pFndBox->SetTableLines( rParam.aBoxes, rTbl );
- }
else
{
- pFndBox = new _FndBox( rParam.aBoxes );
+ _FndPara aPara( rParam.aBoxes, pFndBox );
+ rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
@@ -3813,15 +3874,13 @@ _FndBox* lcl_SaveInsDelData( CR_SetLineHeight& rParam, SwUndo** ppUndo,
rTbl.GetTabSortBoxes().Count() )
return 0;
- _FndBox* pFndBox;
+ _FndBox* pFndBox = new _FndBox( 0, 0 );
if( !rParam.bBigger )
- {
- pFndBox = new _FndBox( 0, 0 );
pFndBox->SetTableLines( rParam.aBoxes, rTbl );
- }
else
{
- pFndBox = new _FndBox( rParam.aBoxes );
+ _FndPara aPara( rParam.aBoxes, pFndBox );
+ rTbl.GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
ASSERT( pFndBox->GetLines().Count(), "Wo sind die Boxen" );
pFndBox->SetTableLines( rTbl );
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index be8dfb911719..55ee8ff4b5b4 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndcopy.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: hbrinkm $ $Date: 2002-11-05 12:37:07 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -148,7 +148,6 @@
#include <poolfmt.hxx>
#endif
-
// Struktur fuer das Mappen von alten und neuen Frame-Formaten an den
// Boxen und Lines einer Tabelle
@@ -902,6 +901,23 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
}
}
+ const SfxPoolItem * pItem = NULL;
+ SwAttrSet * pAttrSet = pDestNd->GetpSwAttrSet();
+
+ /* #107213#: Safe numrule item at destination. */
+ int aState = SFX_ITEM_UNKNOWN;
+ SwNumRuleItem aNumRuleItem;
+
+ if (pAttrSet != NULL)
+ {
+ aState = pAttrSet->GetItemState
+ (RES_PARATR_NUMRULE, FALSE, &pItem);
+
+ if (SFX_ITEM_SET == aState)
+ aNumRuleItem = *((SwNumRuleItem *) pItem);
+ }
+ /* #107213# */
+
if( !bCopyOk )
{
xub_StrLen nCpyLen = ( bOneNode ? pEnd->nContent.GetIndex()
@@ -918,11 +934,21 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
if( bCopyCollFmt )
{
pSttNd->CopyCollFmt( *pDestNd );
- if( pSttNd->GetNum() )
- pDestNd->UpdateNum( *pSttNd->GetNum() );
+
+ if (pSttNd->GetNum())
+ pDestNd->UpdateNum(*pSttNd->GetNum());
+
+ /* #107213# If only a part of one paragraph is copied
+ restore the numrule at the destination. */
+ if (SFX_ITEM_SET == aState)
+ pDestNd->SwCntntNode::SetAttr(aNumRuleItem);
+ else
+ pDestNd->ResetAttr(RES_PARATR_NUMRULE);
}
+
break;
}
+
aRg.aStart++;
}
}
@@ -983,6 +1009,23 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
aInsPos--;
}
+ const SfxPoolItem * pItem = NULL;
+ SwAttrSet * pAttrSet = pDestNd->GetpSwAttrSet();
+
+ /* #107213# Save numrule at destination */
+ int aState = SFX_ITEM_UNKNOWN;
+ SwNumRuleItem aNumRuleItem;
+
+ if (pAttrSet != NULL)
+ {
+ aState = pAttrSet->GetItemState
+ (RES_PARATR_NUMRULE, FALSE, &pItem);
+
+ if (SFX_ITEM_SET == aState)
+ aNumRuleItem = *((SwNumRuleItem *) pItem);
+ }
+ /* #107213# */
+
BOOL bEmptyDestNd = 0 == pDestNd->GetTxt().Len();
pEndNd->Copy( pDestNd, aDestIdx, SwIndex( pEndNd ),
pEnd->nContent.GetIndex() );
@@ -991,8 +1034,19 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
if( bCopyCollFmt && ( bOneNode || bEmptyDestNd ))
{
pEndNd->CopyCollFmt( *pDestNd );
- if( pEndNd->GetNum() )
+
+ if (pEndNd->GetNum())
pDestNd->UpdateNum( *pEndNd->GetNum() );
+
+ if (bOneNode)
+ {
+ /* #107213# If only a part of one paragraph is copied
+ restore the numrule at the destination. */
+ if (SFX_ITEM_SET == aState)
+ pDestNd->SwCntntNode::SetAttr(aNumRuleItem);
+ else
+ pDestNd->ResetAttr(RES_PARATR_NUMRULE);
+ }
}
}
@@ -1065,6 +1119,7 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
}
pDoc->SetRedlineMode_intern( eOld );
pDoc->SetModified();
+
return TRUE;
}
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 5a812a85ee1e..e1e97e2bc7ec 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndsect.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: od $ $Date: 2002-11-15 11:07:52 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -412,8 +412,8 @@ USHORT SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
const SwCntntNode* pCNd = pEnd->nNode.GetNode().GetCntntNode();
const SwNode* pNd = &pStt->nNode.GetNode();
const SwSectionNode* pSectNd = pNd->FindSectionNode();
- const SwSectionNode* pEndSectNd = pCNd->FindSectionNode();
- if( pSectNd && pEndSectNd && pSectNd != pCNd->FindSectionNode() )
+ const SwSectionNode* pEndSectNd = pCNd ? pCNd->FindSectionNode() : 0;
+ if( pSectNd && pEndSectNd && pSectNd != pEndSectNd )
{
// versuche eine umschliessende Section zu erzeugen
// Aber, nur wenn der Start am Sectionanfang und das Ende am
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 9e5d7e7eec53..301091d13c4b 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndtbl.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: fme $ $Date: 2002-11-15 09:51:05 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -115,6 +115,9 @@
#ifndef _CELLFRM_HXX //autogen
#include <cellfrm.hxx>
#endif
+#ifndef _PAGEFRM_HXX
+#include <pagefrm.hxx>
+#endif
#ifndef _TABCOL_HXX //autogen
#include <tabcol.hxx>
#endif
@@ -249,17 +252,17 @@ class lcl_DelRedlines
SwDoc* pDoc;
public:
lcl_DelRedlines( const SwTableNode& rNd, BOOL bCheckForOwnRedline );
- lcl_DelRedlines( SwPaM& rPam )
- : pDoc( rPam.GetDoc() )
- {
- pDoc->StartUndo();
- if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
- pDoc->DeleteRedline( rPam );
- }
+ lcl_DelRedlines( SwPaM& rPam );
~lcl_DelRedlines() { pDoc->EndUndo(); }
};
+lcl_DelRedlines::lcl_DelRedlines( SwPaM & rPam) : pDoc( rPam.GetDoc() )
+{
+ pDoc->StartUndo();
+ if( !pDoc->IsIgnoreRedline() && pDoc->GetRedlineTbl().Count() )
+ pDoc->AcceptRedline( rPam );
+}
void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, BYTE nId )
{
@@ -514,6 +517,9 @@ const SwTable* SwDoc::InsertTable( const SwPosition& rPos, USHORT nRows,
if( (nInsTblFlags & HEADLINE) && (1 != nRows || !bDfltBorders) )
pHeadColl = GetTxtCollFromPool( RES_POOLCOLL_TABLE_HDLN );
+ /* #106283# Save content node to extract FRAMEDIR from. */
+ const SwCntntNode * pCntntNd = rPos.nNode.GetNode().GetCntntNode();
+
SwTableNode *pTblNd = GetNodes().InsertTable( rPos.nNode, nCols,
pBodyColl, nRows, pHeadColl );
@@ -521,6 +527,20 @@ const SwTable* SwDoc::InsertTable( const SwPosition& rPos, USHORT nRows,
SwTableLineFmt* pLineFmt = MakeTableLineFmt();
SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() );
+ /* #106283# 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)
+ {
+ const SwAttrSet & aNdSet = pCntntNd->GetSwAttrSet();
+ const SfxPoolItem *pItem = NULL;
+
+ if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, TRUE, &pItem )
+ && pItem != NULL)
+ {
+ pTableFmt->SetAttr( *pItem );
+ }
+ }
+
//Orientation am Fmt der Table setzen
pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) );
// alle Zeilen haben die Fill-Order von links nach rechts !
@@ -716,6 +736,9 @@ const SwTable* SwDoc::TextToTable( const SwPaM& rRange, sal_Unicode cCh,
return 0;
}
+ /* #106283# 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();
@@ -786,6 +809,21 @@ const SwTable* SwDoc::TextToTable( const SwPaM& rRange, sal_Unicode cCh,
if( !(nInsTblFlags & SPLIT_LAYOUT) )
pTableFmt->SetAttr( SwFmtLayoutSplit( FALSE ));
+ /* #106283# If the first node in the selection is a context node and if it
+ has an item FRAMEDIR set (no default) propagate the item to the
+ replacing table. */
+ if (pSttCntntNd)
+ {
+ const SwAttrSet & aNdSet = pSttCntntNd->GetSwAttrSet();
+ const SfxPoolItem *pItem = NULL;
+
+ if (SFX_ITEM_SET == aNdSet.GetItemState( RES_FRAMEDIR, TRUE, &pItem )
+ && pItem != NULL)
+ {
+ pTableFmt->SetAttr( *pItem );
+ }
+ }
+
SwTableNode* pTblNd = GetNodes().TextToTable( aRg, cCh, pTableFmt,
pLineFmt, pBoxFmt,
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ),
@@ -1526,7 +1564,12 @@ BOOL SwDoc::DeleteRow( const SwCursor& rCursor )
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( aBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( aBoxes, &aFndBox );
+ pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
+
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -2133,18 +2176,19 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
}
//Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ.
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pTab )
- rFill.SetLeftMin ( (USHORT)(pTab->Frm().*fnRect->fnGetLeft)() );
+ const SwPageFrm* pPage = pTab->FindPageFrm();
+ const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+ const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+
+ rFill.SetLeftMin ( nLeftMin );
rFill.SetLeft ( (pTab->Prt().*fnRect->fnGetLeft)() );
rFill.SetRight ( (pTab->Prt().*fnRect->fnGetRight)());
- rFill.SetRightMax( (USHORT)(pTab->Frm().*fnRect->fnGetRight)() - rFill.GetLeftMin() );
-#else
- rFill.SetLeftMin ( (USHORT)pTab->Frm().Left() );
- rFill.SetLeft ( pTab->Prt().Left() );
- rFill.SetRight ( pTab->Prt().Right());
- rFill.SetRightMax( (USHORT)pTab->Frm().Right() - rFill.GetLeftMin() );
-#endif
+ rFill.SetRightMax( nRightMax - nLeftMin );
pTab->GetTable()->GetTabCols( rFill, pBox );
}
@@ -2205,18 +2249,19 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
SwTabCols aOld( rNew.Count() );
+ const SwPageFrm* pPage = pTab->FindPageFrm();
+ const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+ const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+
//Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ.
-#ifdef VERTICAL_LAYOUT
- aOld.SetLeftMin ( (USHORT)(pTab->Frm().*fnRect->fnGetLeft)() );
+ aOld.SetLeftMin ( nLeftMin );
aOld.SetLeft ( (pTab->Prt().*fnRect->fnGetLeft)() );
aOld.SetRight ( (pTab->Prt().*fnRect->fnGetRight)());
- aOld.SetRightMax( (USHORT)(pTab->Frm().*fnRect->fnGetRight)() - aOld.GetLeftMin() );
-#else
- aOld.SetLeftMin ( (USHORT)pTab->Frm().Left() );
- aOld.SetLeft ( pTab->Prt().Left() );
- aOld.SetRight ( pTab->Prt().Right());
- aOld.SetRightMax( (USHORT)pTab->Frm().Right() - aOld.GetLeftMin() );
-#endif
+ aOld.SetRightMax( nRightMax - nLeftMin );
/* if( DoesUndo() )
{
@@ -3018,7 +3063,11 @@ BOOL SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -3089,7 +3138,11 @@ BOOL SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
return FALSE;
// suche alle Boxen / Lines
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( rBoxes, &aFndBox );
+ pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
if( !aFndBox.GetLines().Count() )
return FALSE;
@@ -3890,7 +3943,10 @@ lcl_DelRedlines::lcl_DelRedlines( const SwTableNode& rNd,
}
}
if( bDelete )
- pDoc->DeleteRedline( rNd );
+ {
+ SwPaM aPam(*rNd.EndOfSectionNode(), rNd);
+ pDoc->AcceptRedline( aPam );
+ }
}
}
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index a9fb82f3c6ae..1e1a5cf41211 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndtbl1.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 12:24:28 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -287,7 +287,6 @@ BOOL _FindLine( const _FndLine*& rpLine, void* pPara )
return TRUE;
}
-
void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor )
{
//Zuerst die selektierten Boxen einsammeln.
@@ -296,11 +295,15 @@ void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor )
return ;
//Die selektierte Struktur kopieren.
- _FndBox aFndBox( aBoxes );
-
- //Diejenigen Lines einsammeln, die nur selektierte Boxen enthalten.
const SwTable &rTable = aBoxes[0]->GetSttNd()->FindTableNode()->GetTable();
LinesAndTable aPara( rArr, rTable );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( aBoxes, &aFndBox );
+ ((SwTableLines&)rTable.GetTabLines()).ForEach( &_FndLineCopyCol, &aPara );
+ }
+
+ //Diejenigen Lines einsammeln, die nur selektierte Boxen enthalten.
const _FndBox *pTmp = &aFndBox;
::_FindBox( pTmp, &aPara );
@@ -1427,6 +1430,9 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
SwTabCols aTabCols;
GetTabCols( aTabCols, 0, (SwCellFrm*)pBoxFrm );
+ if ( ! aTabCols.Count() )
+ return;
+
const BYTE nTmp = (BYTE)Max( USHORT(255), USHORT(aTabCols.Count() + 1) );
SvUShorts aWish( nTmp, nTmp ),
aMins( nTmp, nTmp );
@@ -1501,13 +1507,13 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, BOOL bBalance )
else
nDiff -= aTabCols[i] - aTabCols[i-1];
- USHORT nTabRight = aTabCols.GetRight() + nDiff;
+ long nTabRight = aTabCols.GetRight() + nDiff;
//Wenn die Tabelle zu breit wuerde begrenzen wir die Anpassung
//auf das erlaubte Maximum.
if ( !bBalance && nTabRight > aTabCols.GetRightMax() )
{
- const USHORT nTmp = nTabRight - aTabCols.GetRightMax();
+ const long nTmp = nTabRight - aTabCols.GetRightMax();
nDiff -= nTmp;
nTabRight -= nTmp;
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 41cce89dd5de..422e6c295369 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: nodes.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: od $ $Date: 2003-02-28 12:41:34 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index dcd8db0e9f74..386169d1b4c1 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swbaslnk.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2001-07-04 18:13:29 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,13 @@
#include <hintids.hxx>
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_OUTDEV_HXX
+#include <vcl/outdev.hxx>
+#endif
+
#ifndef _LNKBASE_HXX //autogen
#include <so3/lnkbase.hxx>
#endif
@@ -146,7 +153,7 @@
#include <htmltbl.hxx>
#endif
-BOOL SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd );
+BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd );
TYPEINIT1( SwBaseLink, ::so3::SvBaseLink );
@@ -228,7 +235,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
FASTBOOL bGraphicArrived = FALSE;
FASTBOOL bGraphicPieceArrived = FALSE;
FASTBOOL bDontNotify = FALSE;
- Size aGrfSz;
+ Size aGrfSz, aFrmFmtSz;
if( pCntntNode->IsGrfNode() )
{
@@ -246,6 +253,18 @@ void SwBaseLink::DataChanged( const String& rMimeType,
GRAPHIC_DEFAULT != rGrfObj.GetType() ) )
{
aGrfSz = ::GetGraphicSizeTwip( aGrf, 0 );
+ if( static_cast< const SwGrfNode * >( pCntntNode )->IsChgTwipSizeFromPixel() )
+ {
+ const MapMode aMapTwip( MAP_TWIP );
+ aFrmFmtSz =
+ Application::GetDefaultDevice()->PixelToLogic(
+ aGrf.GetSizePixel(), aMapTwip );
+
+ }
+ else
+ {
+ aFrmFmtSz = aGrfSz;
+ }
Size aSz( ((SwGrfNode*)pCntntNode)->GetTwipSize() );
if( bGraphicPieceArrived && GRAPHIC_DEFAULT != aGrf.GetType() &&
@@ -341,11 +360,11 @@ void SwBaseLink::DataChanged( const String& rMimeType,
IsGrafikArrived() );
// Fly der Grafik anpassen !
- if( !::SetGrfFlySize( aGrfSz, pGrfNd ) )
+ if( !::SetGrfFlySize( aGrfSz, aFrmFmtSz, pGrfNd ) )
::lcl_CallModify( *pGrfNd, aMsgHint );
}
else if( pBLink == this &&
- !::SetGrfFlySize( aGrfSz, pGrfNd ) )
+ !::SetGrfFlySize( aGrfSz, aFrmFmtSz, pGrfNd ) )
// Fly der Grafik anpassen !
::lcl_CallModify( *pGrfNd, aMsgHint );
}
@@ -387,7 +406,7 @@ FASTBOOL SwBaseLink::IsShowQuickDrawBmp() const
}
-BOOL SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd )
+BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
{
BOOL bRet = FALSE;
ViewShell *pSh;
@@ -406,15 +425,15 @@ BOOL SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd )
Size aCalcSz( aSz );
if ( !aSz.Height() && aSz.Width() )
//passende Hoehe ausrechnen.
- aCalcSz.Height() = rGrfSz.Height() *
- aSz.Width() / rGrfSz.Width();
+ aCalcSz.Height() = rFrmSz.Height() *
+ aSz.Width() / rFrmSz.Width();
else if ( !aSz.Width() && aSz.Height() )
//passende Breite ausrechnen
- aCalcSz.Width() = rGrfSz.Width() *
- aSz.Height() / rGrfSz.Height();
+ aCalcSz.Width() = rFrmSz.Width() *
+ aSz.Height() / rFrmSz.Height();
else
//Hoehe und Breite uebernehmen
- aCalcSz = rGrfSz;
+ aCalcSz = rFrmSz;
const SvxBoxItem &rBox = pFmt->GetBox();
aCalcSz.Width() += rBox.CalcLineSpace(BOX_LINE_LEFT) +
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 7c29ff6851d1..b37fd7e988d8 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dflyobj.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: fme $ $Date: 2002-10-10 08:45:44 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -301,16 +301,22 @@ SdrObject* __EXPORT SwVirtFlyDrawObj::CheckHit( const Point& rPnt, USHORT nTol,
&& !rURL.GetURL().Len() && !rURL.GetMap()
*/ )
{
- //Vor dem Return noch 3a (siehe oben) pruefen.
- SdrPage *pPg = GetPage();
- for ( UINT32 i = GetOrdNumDirect()+1; i < pPg->GetObjCount(); ++i )
- {
- SdrObject *pObj = pPg->GetObj( i );
- if ( pObj->IsWriterFlyFrame() &&
- ((SwVirtFlyDrawObj*)pObj)->GetBoundRect().IsInside( rPnt ) )
- return 0;
- }
+ // #107513#
+ // This test needs to be done outside, since also drawing layer HitTest
+ // methods are called. Not all drawing objects are derived and the
+ // CheckHit() overloaded. That's an conceptual error here.
return (SdrObject*)this;
+
+ //Vor dem Return noch 3a (siehe oben) pruefen.
+ //SdrPage *pPg = GetPage();
+ //for ( UINT32 i = GetOrdNumDirect()+1; i < pPg->GetObjCount(); ++i )
+ //{
+ // SdrObject *pObj = pPg->GetObj( i );
+ // if ( pObj->IsWriterFlyFrame() &&
+ // ((SwVirtFlyDrawObj*)pObj)->GetBoundRect().IsInside( rPnt ) )
+ // return 0;
+ //}
+ //return (SdrObject*)this;
}
else
{
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 5cbd2c28745b..4277d6505d73 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dpage.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: os $ $Date: 2000-11-27 07:50:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -168,10 +168,12 @@ SwDPage::~SwDPage()
}
-Point SwDPage::GetOffset() const
-{
- return Point( DOCUMENTBORDER, DOCUMENTBORDER );
-}
+// #i3694#
+// This GetOffset() method is not needed anymore, it even leads to errors.
+//Point SwDPage::GetOffset() const
+//{
+// return Point( DOCUMENTBORDER, DOCUMENTBORDER );
+//}
/*************************************************************************
|*
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 2133aec830e5..d32c209ce6e1 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: drawdoc.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: ka $ $Date: 2001-11-02 16:05:52 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -244,6 +244,8 @@ SwDrawDocument::SwDrawDocument( SfxItemPool *pPool, SwDocShell *pDocSh )
SwDrawDocument::~SwDrawDocument()
{
+ Broadcast(SdrHint(HINT_MODELCLEARED));
+
Clear();
}
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 13aaecf3083b..d6948d20bb9d 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: acorrect.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jp $ $Date: 2002-02-22 12:00:10 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -472,6 +472,7 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
pDoc->DontExpandFmt( *aPam.GetPoint() );
pDoc->Insert( aPam, pCorr->Correct() );
+ pDoc->AppendTmpCorr(sKurz, pCorr->Correct());
bRet = TRUE;
}
}
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 62a31723b732..53881e32594c 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: autofmt.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: iha $ $Date: 2002-11-28 12:12:41 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -961,9 +961,14 @@ USHORT SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
// 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))
? strchr( "mdclxvi", cLow )
: strchr( "mlxvi", cLow ) ))
+#else
+ if( 256 > cLow && ( strchr( "mdclxvi", cLow ) ))
+#endif
{
if( bIsUpper )
cNumTyp = '0' + SVX_NUM_ROMAN_UPPER, eTmpScan = UPPER_ROMAN;
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 9f3eda4c4408..137b20354461 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: edattr.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:26:44 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -149,11 +149,15 @@ using namespace ::com::sun::star::i18n;
// wenn Selektion groesser Max Nodes oder mehr als Max Selektionen
// => keine Attribute
-static const USHORT nMaxLookup = 255;
+const USHORT& getMaxLookup()
+{
+ static const USHORT nMaxLookup = 1000;
+ return nMaxLookup;
+}
BOOL SwEditShell::GetAttr( SfxItemSet& rSet ) const
{
- if( GetCrsrCnt() > nMaxLookup )
+ if( GetCrsrCnt() > getMaxLookup() )
{
rSet.InvalidateAllItems();
return FALSE;
@@ -175,7 +179,7 @@ BOOL SwEditShell::GetAttr( SfxItemSet& rSet ) const
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp;
}
- if( nEndNd - nSttNd >= nMaxLookup )
+ if( nEndNd - nSttNd >= getMaxLookup() )
{
rSet.ClearItem();
rSet.InvalidateAllItems();
@@ -246,7 +250,7 @@ SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
{
SwTxtFmtColl *pFmt = 0;
- if ( GetCrsrCnt() > nMaxLookup )
+ if ( GetCrsrCnt() > getMaxLookup() )
return 0;
FOREACHPAM_START(this)
@@ -262,7 +266,7 @@ SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl() const
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp;
}
- if( nEndNd - nSttNd >= nMaxLookup )
+ if( nEndNd - nSttNd >= getMaxLookup() )
{
pFmt = 0;
break;
@@ -480,10 +484,41 @@ inline USHORT lcl_SetScriptFlags( USHORT nType )
}
BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
- USHORT &rScrpt, BOOL bInSelection )
+ USHORT &rScrpt, BOOL bInSelection, BOOL bNum )
{
BOOL bRet = FALSE;
const String& rTxt = rTNd.GetTxt();
+ String sExp;
+
+ // consider numbering
+ if ( bNum )
+ {
+ bRet = FALSE;
+
+ const SwNumRule* pNumRule = rTNd.GetNumRule();
+ const SwNodeNum* pNum = rTNd.GetNum();
+
+ if( !pNumRule ) // oder sollte OutlineNum an sein?
+ {
+ pNum = rTNd.GetOutlineNum();
+ if( pNum )
+ pNumRule = rTNd.GetDoc()->GetOutlineNumRule();
+ }
+
+ if( pNumRule && pNum && MAXLEVEL > pNum->GetLevel() )
+ {
+ const SwNumFmt &rNumFmt = pNumRule->Get( pNum->GetLevel() );
+
+ if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
+ {
+ sExp = ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() ?
+ rNumFmt.GetBulletChar() :
+ pNumRule->MakeNumString( *pNum ) );
+ }
+ }
+ }
+
+ // and fields
const SwTxtAttr* pTFld;
if( CH_TXTATR_BREAKWORD == rTxt.GetChar( nPos ) &&
0 != ( pTFld = rTNd.GetTxtAttr( nPos ) ) )
@@ -491,27 +526,32 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
bRet = TRUE; // all other then fields can be
// defined as weak-script ?
const SwField* pFld;
- String sExp;
if( RES_TXTATR_FIELD == pTFld->Which() &&
- 0 != (pFld = pTFld->GetFld().GetFld() ) &&
- (sExp = pFld->Expand()).Len() )
+ 0 != (pFld = pTFld->GetFld().GetFld() ) )
+ {
+ sExp += pFld->Expand();
+ }
+ }
+
+ xub_StrLen nEnd = sExp.Len();
+ if ( nEnd )
+ {
+ xub_StrLen n;
+ if( bInSelection )
{
- xub_StrLen n, nEnd = sExp.Len();
- if( bInSelection )
+ USHORT nScript;
+ for( n = 0; n < nEnd; n = (xub_StrLen)
+ pBreakIt->xBreak->endOfScript( sExp, n, nScript ))
{
- USHORT nScript;
- for( n = 0; n < nEnd; n = (xub_StrLen)
- pBreakIt->xBreak->endOfScript( sExp, n, nScript ))
- {
- nScript = pBreakIt->xBreak->getScriptType( sExp, n );
- rScrpt |= nScript;
- }
+ nScript = pBreakIt->xBreak->getScriptType( sExp, n );
+ rScrpt |= lcl_SetScriptFlags( nScript );
}
- else
- rScrpt |= lcl_SetScriptFlags( pBreakIt->xBreak->
- getScriptType( sExp, nEnd-1 ));
}
+ else
+ rScrpt |= lcl_SetScriptFlags( pBreakIt->xBreak->
+ getScriptType( sExp, nEnd-1 ));
}
+
return bRet;
}
@@ -557,7 +597,7 @@ USHORT SwEditShell::GetScriptType( USHORT nFlags ) const
else
nScript = GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
- if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nPos, nRet, FALSE ))
+ if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nPos, nRet, FALSE, FALSE ))
nRet |= lcl_SetScriptFlags( nScript );
}
}
@@ -581,6 +621,7 @@ USHORT SwEditShell::GetScriptType( USHORT nFlags ) const
? pEnd->nContent.GetIndex()
: rTxt.Len(),
nSttPos = nChg;
+
ASSERT( nEndPos <= rTxt.Len(), "Index outside the range - endless loop!" );
if( nEndPos > rTxt.Len() )
nEndPos = rTxt.Len();
@@ -593,7 +634,8 @@ USHORT SwEditShell::GetScriptType( USHORT nFlags ) const
pBreakIt->xBreak->getScriptType(
rTxt, nChg );
- if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nChg, nRet, TRUE ) )
+ if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nChg, nRet, TRUE,
+ 0 == nChg && rTxt.Len() == nEndPos ) )
nRet |= lcl_SetScriptFlags( nScript );
if( (SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN |
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 62922b838f79..57282dbf4cf8 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editsh.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: os $ $Date: 2002-08-26 14:39:30 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -172,6 +172,9 @@
#ifndef _CRSSKIP_HXX
#include <crsskip.hxx>
#endif
+#ifndef _DRAWFONT_HXX
+#include <drawfont.hxx>
+#endif
#ifndef _UNOOBJ_HXX
#include <unoobj.hxx>
#endif
@@ -217,6 +220,57 @@ void SwEditShell::Insert(const String &rStr)
SaveTblBoxCntnt( PCURCRSR->GetPoint() );
FOREACHPAM_END()
+
+ // calculate cursor bidi level
+ SwCursor* pTmpCrsr = _GetCrsr();
+ const BOOL bDoNotSetBidiLevel = ! pTmpCrsr ||
+ ( 0 != (SwUnoCrsr*)*pTmpCrsr );
+
+ if ( ! bDoNotSetBidiLevel )
+ {
+ SwNode& rNode = pTmpCrsr->GetPoint()->nNode.GetNode();
+ if ( rNode.IsTxtNode() )
+ {
+ SwIndex& rIdx = pTmpCrsr->GetPoint()->nContent;
+ xub_StrLen nPos = rIdx.GetIndex();
+ xub_StrLen nPrevPos = nPos;
+ if ( nPrevPos )
+ --nPrevPos;
+
+ // If some day the font fallback works, we should do this here:
+ // 1. get script info
+ // 2. call InitScriptInfo( rNode, bRTL )
+ // This would avoid calling UpdateBidiInfo here, instead it would
+ // be called within InitScriptInfo and only if there are complex
+ // characters in the string.
+
+ SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( ((SwTxtNode&)rNode),
+ sal_True );
+
+ BYTE nLevel = 0;
+ if ( ! pSI )
+ {
+ // seems to be an empty paragraph.
+ Point aPt;
+ SwCntntFrm* pFrm =
+ ((SwTxtNode&)rNode).GetFrm( &aPt, pTmpCrsr->GetPoint(),
+ sal_False );
+
+ SwScriptInfo aScriptInfo;
+ aScriptInfo.SetDefaultDir( pFrm->IsRightToLeft() );
+ aScriptInfo.UpdateBidiInfo( ((SwTxtNode&)rNode).GetTxt() );
+ nLevel = aScriptInfo.DirType( nPrevPos );
+ }
+ else
+ {
+ pSI->UpdateBidiInfo( ((SwTxtNode&)rNode).GetTxt() );
+ nLevel = pSI->DirType( nPrevPos );
+ }
+
+ pTmpCrsr->SetCrsrBidiLevel( nLevel );
+ }
+ }
+
EndAllAction();
}
@@ -1071,7 +1125,14 @@ String SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, BOOL bInsText )
StartAllAction();
pDel->SetInsText( bInsText );
SetOverwriteCrsr( pDel->IsOverwriteCursor() );
+ const SwPosition aPos( *pDel->GetPoint() );
GetDoc()->DeleteExtTextInput( pDel );
+
+ // In this case, the "replace" function did not set the cursor
+ // to the original position. Therefore we have to do this manually.
+ if ( ! bInsText && IsOverwriteCrsr() )
+ *GetCrsr()->GetPoint() = aPos;
+
EndAllAction();
}
return sRet;
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 1eca7b181411..d8da67c80ef6 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: edsect.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: os $ $Date: 2001-05-08 08:58:18 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -371,140 +371,149 @@ USHORT SwEditShell::GetFullSelectedSectionCount() const
return nRet;
}
-// is the cursor at the last contentposition of any section and is the
-// insertposition not readonly?
-// The return have 3 values:
-// 0 - not at start or end of Section
-// 1 - at start of Section
-// 2 - at End of Section
-int SwEditShell::CanInsertNodeAtEndOfSection() const
+
+/**
+ * Find the suitable node for a special insert (alt-enter).
+ * This should enable inserting text before/after sections and tables.
+ *
+ * A node is found if:
+ * 1) the innermost table/section is not in a write-protected area
+ * 2) pCurrentPos is at or just before an end node
+ * (or at or just after a start node)
+ * 3) there are only start/end nodes between pCurrentPos and the innermost
+ * table/section
+ *
+ * If a suitable node is found, an SwNode* is returned; else it is NULL.
+ */
+const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
{
- int nRet = 0;
- if( !IsTableMode() )
+ const SwNode* pReturn = NULL;
+
+ // the current position
+ // const SwPosition* pCurrentPos = GetCrsr()->GetPoint();
+ DBG_ASSERT( pCurrentPos != NULL, "Strange, we have no position!" );
+ const SwNode& rCurrentNode = pCurrentPos->nNode.GetNode();
+
+
+ // find innermost section or table. At the end of this scope,
+ // pInntermostNode contain the section/table before/after which we should
+ // insert our empty paragraph, or it will be NULL if none is found.
+ const SwNode* pInnermostNode = NULL;
{
- const SwPosition& rPos = *GetCrsr()->GetPoint();
- const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode();
- if( pSectNd )
+ const SwNode* pTableNode = rCurrentNode.FindTableNode();
+ const SwNode* pSectionNode = rCurrentNode.FindSectionNode();
+
+ // find the table/section which is close
+ if( pTableNode == NULL )
+ pInnermostNode = pSectionNode;
+ else if ( pSectionNode == NULL )
+ pInnermostNode = pTableNode;
+ else
{
- BOOL bEnd = FALSE, bStart = FALSE;
- const SwCntntNode* pCntNd = rPos.nNode.GetNode().GetCntntNode();
-
- SwNodeIndex aEnd( rPos.nNode, 1 );
- while( aEnd.GetNode().IsEndNode() &&
- (const SwNode*)&aEnd.GetNode() !=
- pSectNd->EndOfSectionNode() )
- aEnd++;
-
- if( aEnd.GetNode().IsEndNode() &&
- ( !pCntNd || pCntNd->Len() == rPos.nContent.GetIndex() ))
- bEnd = TRUE;
- else
- {
- aEnd = rPos.nNode;
- aEnd--;
- while( aEnd.GetNode().IsStartNode() &&
- (const SwNode*)&aEnd.GetNode() != pSectNd )
- aEnd--;
-
- if( (const SwNode*)&aEnd.GetNode() == pSectNd &&
- ( !pCntNd || !rPos.nContent.GetIndex() ))
- bStart = TRUE;
- }
+ // compare and choose the larger one
+ pInnermostNode =
+ ( pSectionNode->GetIndex() > pTableNode->GetIndex() )
+ ? pSectionNode : pTableNode;
+ }
+ }
- if( bEnd || bStart )
- {
- // is the insertposition readonly?
- if( bEnd )
- {
- aEnd = *pSectNd->EndOfSectionNode();
- aEnd++;
- }
- else
- {
- aEnd = *pSectNd;
- aEnd--;
- // the IsProtect-Method of SwNode test by sectionnode
- // his parent!
- if( aEnd.GetNode().IsSectionNode() )
- aEnd = *pSectNd;
- }
+ // The previous version had a check to skip empty read-only sections. Those
+ // shouldn't occur, so we only need to check whether our pInnermostNode is
+ // inside a protected area.
- do {
- if( !aEnd.GetNode().IsProtect() )
- {
- nRet = bStart ? 1 : 2;
- break;
- }
- else
- {
- // skip protected sections without any content at
- // start or end
- if( bStart )
- {
- if( !aEnd.GetNode().IsSectionNode() ||
- !aEnd.GetNode().StartOfSectionIndex() )
- break;
- aEnd--;
- }
- else
- {
- if( !aEnd.GetNode().IsEndNode() ||
- !aEnd.GetNode().StartOfSectionNode()->
- IsSectionNode() )
- break;
- aEnd++;
- }
- }
- } while( TRUE );
- }
- }
+ // Now, pInnermostNode is NULL or the innermost section or table node.
+ if( (pInnermostNode != NULL) && !pInnermostNode->IsProtect() )
+ {
+ DBG_ASSERT( pInnermostNode->IsTableNode() ||
+ pInnermostNode->IsSectionNode(), "wrong node found" );
+ DBG_ASSERT( ( pInnermostNode->GetIndex() <= rCurrentNode.GetIndex() )&&
+ ( pInnermostNode->EndOfSectionNode()->GetIndex() >=
+ rCurrentNode.GetIndex() ), "wrong node found" );
+
+ // we now need to find the possible start/end positions
+
+ // we found a start if
+ // - we're at or just before a start node
+ // - there are only start nodes between the current and pInnermostNode
+ SwNodeIndex aBegin( pCurrentPos->nNode );
+ if( rCurrentNode.IsCntntNode() &&
+ (pCurrentPos->nContent.GetIndex() == 0))
+ aBegin--;
+ while( (aBegin != pInnermostNode->GetIndex()) &&
+ aBegin.GetNode().IsStartNode() )
+ aBegin--;
+ bool bStart = ( aBegin == pInnermostNode->GetIndex() );
+
+ // we found an end if
+ // - we're at or just before an end node
+ // - there are only end nodes between the current node and
+ // pInnermostNode's end node
+ SwNodeIndex aEnd( pCurrentPos->nNode );
+ if( rCurrentNode.IsCntntNode() &&
+ ( pCurrentPos->nContent.GetIndex() ==
+ rCurrentNode.GetCntntNode()->Len() ) )
+ aEnd++;
+ while( (aEnd != pInnermostNode->EndOfSectionNode()->GetIndex()) &&
+ aEnd.GetNode().IsEndNode() )
+ aEnd++;
+ bool bEnd = ( aEnd == pInnermostNode->EndOfSectionNode()->GetIndex() );
+
+ // evalutate result: if both start + end, end is preferred
+ if( bEnd )
+ pReturn = pInnermostNode->EndOfSectionNode();
+ else if ( bStart )
+ pReturn = pInnermostNode;
+ // else pReturn = NULL;
}
- return nRet;
+ // else: pReturn = NULL
+
+
+ DBG_ASSERT( ( pReturn == NULL ) || pReturn->IsStartNode() ||
+ pReturn->IsEndNode(),
+ "SpecialInsertNode failed" );
+ return pReturn;
}
-BOOL SwEditShell::AppendNodeInSection()
+
+/** a node can be special-inserted (alt-Enter) whenever lcl_SpecialInsertNode
+ finds a suitable position
+*/
+bool SwEditShell::CanSpecialInsert() const
+{
+ return NULL != lcl_SpecialInsertNode( GetCrsr()->GetPoint() );
+}
+
+
+/** check whether a node cen be special-inserted (alt-Enter), and do so. Return
+ whether insertion was possible.
+ */
+bool SwEditShell::DoSpecialInsert()
{
- int nRet = CanInsertNodeAtEndOfSection();
- if( nRet )
+ bool bRet = false;
+
+ // get current node
+ SwPosition* pCursorPos = GetCrsr()->GetPoint();
+ const SwNode* pInsertNode = lcl_SpecialInsertNode( pCursorPos );
+ if( pInsertNode != NULL )
{
StartAllAction();
- SwPosition& rPos = *GetCrsr()->GetPoint();
- const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode();
- SwPosition aPos( *pSectNd );
- if( 1 == nRet )
- {
- do {
- const SwNode* pPrvNd = &aPos.nNode.GetNode();
- aPos.nNode--;
- if( !aPos.nNode.GetNode().IsSectionNode() ||
- !pPrvNd->IsProtect() )
- break;
- } while( TRUE );
- }
- else
- {
- SwNodeIndex aIdx( *pSectNd->EndOfSectionNode(), 1 );
- do {
- if( !aIdx.GetNode().IsEndNode() ||
- !aIdx.GetNode().FindStartNode()->IsSectionNode() ||
- !aIdx.GetNode().IsProtect() )
- break;
- aIdx++;
- } while( TRUE );
- aIdx--;
- aPos.nNode = aIdx;
- }
+ // adjust insert position to insert before start nodes and after end
+ // nodes
+ SwNodeIndex aInsertIndex( *pInsertNode,
+ pInsertNode->IsStartNode() ? -1 : 0 );
+ SwPosition aInsertPos( aInsertIndex );
- GetDoc()->AppendTxtNode( aPos );
- rPos = aPos;
+ // insert a new text node, and set the cursor
+ bRet = GetDoc()->AppendTxtNode( aInsertPos );
+ *pCursorPos = aInsertPos;
- // rufe das AttrChangeNotify auf der UI-Seite.
+ // call AttrChangeNotify for the UI
CallChgLnk();
+
EndAllAction();
}
- return 0 != nRet;
-}
-
+ return bRet;
+}
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 017583b06693..e031972b937e 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: authfld.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: os $ $Date: 2002-10-30 10:38:14 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,15 @@
#ifndef _AUTHFLD_HXX
#include <authfld.hxx>
#endif
+#ifndef _EXPFLD_HXX
+#include <expfld.hxx>
+#endif
+#ifndef _PAM_HXX
+#include <pam.hxx>
+#endif
+#ifndef _CNTFRM_HXX
+#include <cntfrm.hxx>
+#endif
#ifndef _TOX_HXX
#include <tox.hxx>
#endif
@@ -531,12 +540,22 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
#endif
continue;
}
- const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- ULONG nPos = rTxtNode.GetIndex();
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
- rTxtNode.GetNodes().IsDocNodes() )
+ const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode();
+ SwPosition aFldPos(rFldTxtNode);
+ SwDoc& rDoc = *(SwDoc*)rFldTxtNode.GetDoc();
+ SwCntntFrm *pFrm = rFldTxtNode.GetFrm();
+ const SwTxtNode* pTxtNode = 0;
+ if(pFrm && !pFrm->IsInDocBody())
+ pTxtNode = GetBodyTxtNode( rDoc, aFldPos, *pFrm );
+ //if no text node could be found or the field is in the document
+ //body the directly available text node will be used
+ if(!pTxtNode)
+ pTxtNode = &rFldTxtNode;
+ ULONG nPos = pTxtNode->GetIndex();
+ if( pTxtNode->GetTxt().Len() && pTxtNode->GetFrm() &&
+ pTxtNode->GetNodes().IsDocNodes() )
{
- SwTOXAuthority* pNew = new SwTOXAuthority( rTxtNode,
+ SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode,
*pFmtFld, aIntl );
for(short i = 0; i < aSortArr.Count(); ++i)
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 565ce94eb4dd..04fc46d127ac 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fldbas.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: os $ $Date: 2002-11-15 11:43:50 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:39:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,8 +71,8 @@
#endif
#include <float.h>
-#ifndef _TOOLS_SOLMATH_HXX
-#include <tools/solmath.hxx>
+#ifndef INCLUDED_RTL_MATH_HXX
+#include <rtl/math.hxx>
#endif
#ifndef _ZFORLIST_HXX //autogen
#include <svtools/zforlist.hxx>
@@ -800,9 +800,8 @@ void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
nLng = LANGUAGE_SYSTEM;
pFormatter->ChangeIntl( nLng ); // Separator in der richtigen Sprache besorgen
- rValue.Erase();
- SolarMath::DoubleToString( rValue, rVal, 'F', 12,
- pFormatter->GetDecSep(), TRUE );
+ rValue = ::rtl::math::doubleToUString( rVal, rtl_math_StringFormat_F, 12,
+ pFormatter->GetDecSep(), true );
}
/*--------------------------------------------------------------------
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index f8a1f6f53e20..1fcaf5b76d6d 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fecopy.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fme $ $Date: 2002-09-16 08:46:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,6 +124,9 @@
#ifndef _SVDPAGE_HXX
#include <svx/svdpage.hxx>
#endif
+#ifndef _SVDOGRP_HXX
+#include <svx/svdogrp.hxx>
+#endif
#ifndef _XOUTBMP_HXX
#include <svx/xoutbmp.hxx>
#endif
@@ -389,9 +392,10 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
aSet.Put( aAnchor );
SdrObject* pNew = pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE );
+
//JP 07.01.00: why move??
// pNew->NbcMove( aSiz );
- pClpDoc->Insert( SwPaM( aPos ), *pNew, &aSet );
+ pClpDoc->Insert( SwPaM( aPos ), *pNew, &aSet );
}
else
{
@@ -953,7 +957,8 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc )
if( !Imp()->GetDrawView() )
MakeDrawView();
- Size aSiz( 0, GetCharRect().Top() );
+ // FME: removed for #105977#
+ // Size aSiz( 0, GetCharRect().Top() );
for ( USHORT i = 0; i < pClpDoc->GetSpzFrmFmts()->Count(); ++i )
{
BOOL bInsWithFmt = TRUE;
@@ -968,9 +973,40 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc )
{
SdrObject* pNew = GetDoc()->CloneSdrObj( *pSdrObj,
FALSE, FALSE );
- pNew->NbcMove( aSiz );
+
+ // FME: removed for #105977#
+ // pNew->NbcMove( aSiz );
+
+ // Insert object sets any anchor position to 0.
+ // Therefore we calculate the absolute position here
+ // and after the insert the anchor of the object
+ // is set to the anchor of the group object.
+ Rectangle aSnapRect = pNew->GetSnapRect();
+ if( pNew->GetAnchorPos().X() || pNew->GetAnchorPos().Y() )
+ {
+ const Point aPoint( 0, 0 );
+ pNew->NbcSetAnchorPos( aPoint );
+ pNew->NbcSetSnapRect( aSnapRect );
+ }
+
Imp()->GetDrawView()->InsertObject( pNew,
*Imp()->GetPageView() );
+
+ Point aGrpAnchor( 0, 0 );
+ SdrObjList* pList = pNew->GetObjList();
+ if ( pList )
+ {
+ SdrObject* pOwner = pList->GetOwnerObj();
+ if ( pOwner )
+ {
+ SdrObjGroup* pThisGroup = PTR_CAST(SdrObjGroup, pOwner);
+ aGrpAnchor = pThisGroup->GetAnchorPos();
+ }
+ }
+
+ pNew->NbcSetAnchorPos( aGrpAnchor );
+ pNew->NbcSetSnapRect( aSnapRect );
+
bInsWithFmt = FALSE;
}
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index ba22928cdc72..b8d3ffdcba97 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fefly1.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: fme $ $Date: 2002-09-16 08:46:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -321,6 +321,9 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
return bRet;
}
+//
+//! also used in unoframe.cxx
+//
sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
{
const SwFrmFmt& rFmt = *rFly.GetFmt();
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index d6163f34607c..70d309f53f13 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: feshview.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: od $ $Date: 2002-12-10 14:12:18 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1262,6 +1262,44 @@ int SwFEShell::IsObjSelectable( const Point& rPt )
#endif
}
+// #107513#
+// Test if there is a draw object at that position and if it should be selected.
+// The 'should' is aimed at Writer text fly frames which may be in front of
+// the draw object.
+sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
+{
+ SET_CURR_SHELL(this);
+ SwDrawView *pDrawView = Imp()->GetDrawView();
+ sal_Bool bRet(sal_False);
+
+ if(pDrawView)
+ {
+ SdrObject* pObj;
+ SdrPageView* pPV;
+ sal_uInt16 nOld(pDrawView->GetHitTolerancePixel());
+
+ pDrawView->SetHitTolerancePixel(pDrawView->GetMarkHdlSizePixel()/2);
+ bRet = pDrawView->PickObj(rPt, pObj, pPV, SDRSEARCH_PICKMARKABLE);
+ pDrawView->SetHitTolerancePixel(nOld);
+
+ if(bRet && pObj)
+ {
+ SdrPage* pPage = GetDoc()->GetDrawModel()->GetPage(0);
+
+ for(sal_uInt32 a(pObj->GetOrdNumDirect() + 1); bRet && a < pPage->GetObjCount(); a++)
+ {
+ SdrObject *pCandidate = pPage->GetObj(a);
+
+ if(pCandidate->IsWriterFlyFrame() && ((SwVirtFlyDrawObj*)pCandidate)->GetBoundRect().IsInside(rPt))
+ {
+ bRet = sal_False;
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
/*************************************************************************
|*
@@ -1464,6 +1502,10 @@ BOOL SwFEShell::GotoObj( BOOL bNext, GotoObjType eType )
if( pBest )
{
+ // OD 11.02.2003 #100556# - set flag value to avoid macro execution.
+ bool bSavedFlagValue = IsMacroExecAllowed();
+ SetMacroExecAllowed( false );
+
BOOL bFlyFrm = pBest->IsWriterFlyFrame();
if( bFlyFrm )
{
@@ -1479,6 +1521,10 @@ BOOL SwFEShell::GotoObj( BOOL bNext, GotoObjType eType )
if( !ActionPend() )
MakeVisible( pBest->GetBoundRect() );
}
+
+ // OD 11.02.2003 #100556# - reset flag value
+ SetMacroExecAllowed( bSavedFlagValue );
+
CallChgLnk();
bRet = TRUE;
}
@@ -2566,10 +2612,8 @@ BOOL SwFEShell::IsAlignPossible() const
{
SdrObject *pO = Imp()->GetDrawView()->GetMarkList().GetMark(0)->GetObj();
SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
- if (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AT_CNTNT)
- bRet = FALSE;
- else
- bRet = pC->GetAnchor() ? pC->GetAnchor()->IsInDocBody() : FALSE;
+ //only as character bound drawings can be aligned
+ bRet = pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_IN_CNTNT;
}
if ( bRet )
return Imp()->GetDrawView()->IsAlignPossible();
@@ -2947,8 +2991,6 @@ void SwFEShell::CreateDefaultShape(UINT16 eSdrObjectKind, const Rectangle& rRect
pObj->SetItemSet(aSet);
}
- String aText = SW_RESSTR(STR_POOLCOLL_LABEL_FRAME);
- ((SdrCaptionObj*)pObj)->SetText(aText);
((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
((SdrCaptionObj*)pObj)->SetTailPos(
aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index b8b771211be0..59e6a3057b49 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1,10 +1,18 @@
-/*************************************************************************
+ /*************************************************************************
*
* $RCSfile: fetab.cxx,v $
*
- * $Revision: 1.11 $
+<<<<<<< fetab.cxx
+ * $Revision: 1.12 $
+=======
+ * $Revision: 1.12 $
+>>>>>>> 1.4.2.6.2.1.20.2
*
- * last change: $Author: fme $ $Date: 2002-11-15 09:54:42 $
+<<<<<<< fetab.cxx
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:03 $
+=======
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:03 $
+>>>>>>> 1.4.2.6.2.1.20.2
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -166,7 +174,6 @@
#include <swerror.h>
#endif
-
//siehe auch swtable.cxx
#define COLFUZZY 20L
@@ -202,6 +209,89 @@ inline const SwCursor& GetShellCursor( const SwCrsrShell& rShell )
return *pCrsr;
}
+void SwFEShell::ParkCursorInTab()
+{
+ SwCursor * pSwCrsr = GetSwCrsr();
+
+ ASSERT(pSwCrsr, "no SwCursor");
+
+ SwPosition aStartPos = *pSwCrsr->GetPoint(), aEndPos = aStartPos;
+
+ SwCursor * pTmpCrsr = (SwCursor *) pSwCrsr;
+
+ /* Search least and greatest position in current cursor ring.
+ */
+ do
+ {
+ const SwPosition * pPt = pTmpCrsr->GetPoint(),
+ * pMk = pTmpCrsr->GetMark();
+
+ if (*pPt < aStartPos)
+ aStartPos = *pPt;
+
+ if (*pPt > aEndPos)
+ aEndPos = *pPt;
+
+ if (*pMk < aStartPos)
+ aStartPos = *pMk;
+
+ if (*pMk > aEndPos)
+ aEndPos = *pMk;
+
+ pTmpCrsr = (SwCursor *) pTmpCrsr->GetNext();
+ }
+ while (pTmpCrsr != pSwCrsr);
+
+ KillPams();
+
+ /* Set cursor to end of selection to ensure IsLastCellInRow works
+ properly. */
+ {
+ SwCursor aTmpCrsr(aEndPos);
+ *pSwCrsr = aTmpCrsr;
+ }
+
+ /* Move the cursor out of the columns to delete and stay in the
+ same row. If the table has only one column the cursor will
+ stay in the row and the shell will take care of it. */
+ if (IsLastCellInRow())
+ {
+ /* If the cursor is in the last row of the table, first
+ try to move it to the previous cell. If that fails move
+ it to the next cell. */
+
+ {
+ SwCursor aTmpCrsr(aStartPos);
+ *pSwCrsr = aTmpCrsr;
+ }
+
+ if (! pSwCrsr->GoPrevCell())
+ {
+ SwCursor aTmpCrsr(aEndPos);
+ *pSwCrsr = aTmpCrsr;
+ pSwCrsr->GoNextCell();
+ }
+ }
+ else
+ {
+ /* If the cursor is not in the last row of the table, first
+ try to move it to the next cell. If that fails move it
+ to the previous cell. */
+
+ {
+ SwCursor aTmpCrsr(aEndPos);
+ *pSwCrsr = aTmpCrsr;
+ }
+
+ if (! pSwCrsr->GoNextCell())
+ {
+ SwCursor aTmpCrsr(aStartPos);
+ *pSwCrsr = aTmpCrsr;
+ pSwCrsr->GoPrevCell();
+ }
+ }
+}
+
/***********************************************************************
#* Class : SwFEShell
#* Methoden : GetStartEndCell
@@ -301,6 +391,26 @@ BOOL SwFEShell::InsertCol( USHORT nCnt, BOOL bBehind )
#* Datum : MA 03. May. 93
#* Update : MA 19. Apr. 95
#***********************************************************************/
+
+/**
+ Determines if the current cursor is in the last row of the table.
+*/
+BOOL SwFEShell::IsLastCellInRow() const
+{
+ SwTabCols aTabCols;
+ GetTabCols( aTabCols );
+ BOOL bResult = FALSE;
+
+ if (IsTableRightToLeft())
+ /* If the table is right-to-left the last row is the most left one. */
+ bResult = 0 == GetCurTabColNum();
+ else
+ /* If the table is left-to-right the last row is the most right one. */
+ bResult = aTabCols.Count() == GetCurTabColNum();
+
+ return bResult;
+}
+
BOOL SwFEShell::DeleteCol()
{
// pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen
@@ -331,13 +441,16 @@ BOOL SwFEShell::DeleteCol()
// Dokument-Position werden sie dann immer an die alte Position gesetzt.
while( !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
- ParkCrsr( SwNodeIndex( *((SwCellFrm*)pFrm)->GetTabBox()->GetSttNd() ));
+
+ ParkCursorInTab();
// dann loesche doch die Spalten
bRet = GetDoc()->DeleteRowCol( aBoxes );
+
}
else
bRet = FALSE;
+
EndAllActionAndCall();
return bRet;
}
@@ -377,7 +490,12 @@ BOOL SwFEShell::DeleteRow()
SwTableNode* pTblNd = ((SwCntntFrm*)pFrm)->GetNode()->FindTableNode();
// suche alle Boxen / Lines
- _FndBox aFndBox( aBoxes );
+ _FndBox aFndBox( 0, 0 );
+ {
+ _FndPara aPara( aBoxes, &aFndBox );
+ pTblNd->GetTable().GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ }
+
if( !aFndBox.GetLines().Count() )
{
EndAllActionAndCall();
@@ -553,20 +671,30 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
if ( pLastTable == pTab->GetTable() )
{
bDel = FALSE;
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pTab )
-#endif
+
+ const SwPageFrm* pPage = pTab->FindPageFrm();
+ const ULONG nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+ const ULONG nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
+ (pPage->Frm().*fnRect->fnGetLeft)() +
+ DOCUMENTBORDER;
+
if ( pLastTabFrm != pTab )
{
//Wenn der TabFrm gewechselt hat, brauchen wir bei gleicher
//Breite nur ein wenig shiften.
-#ifdef VERTICAL_LAYOUT
SWRECTFNX( pLastTabFrm )
if( (pLastTabFrm->Frm().*fnRect->fnGetWidth)() ==
(pTab->Frm().*fnRect->fnGetWidth)() )
{
- pLastCols->SetLeftMin( (USHORT)
- (pTab->Frm().*fnRect->fnGetLeft)() );
+ pLastCols->SetLeftMin( nLeftMin );
+
+ ASSERT( bVert ||
+ pLastCols->GetLeftMin() == (pTab->Frm().*fnRect->fnGetLeft)(),
+ "GetTabCols: wrong result" )
+
pLastTabFrm = pTab;
}
else
@@ -574,28 +702,10 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
}
if ( !bDel &&
- pLastCols->GetLeftMin () == (USHORT)(pTab->Frm().*fnRect->fnGetLeft)() &&
+ pLastCols->GetLeftMin () == (USHORT)nLeftMin &&
pLastCols->GetLeft () == (USHORT)(pTab->Prt().*fnRect->fnGetLeft)() &&
pLastCols->GetRight () == (USHORT)(pTab->Prt().*fnRect->fnGetRight)()&&
- pLastCols->GetRightMax() ==
- (USHORT)(pTab->Frm().*fnRect->fnGetRight)() - pLastCols->GetLeftMin() )
-#else
- if ( pLastTabFrm->Frm().Width() == pTab->Frm().Width() )
- {
- pLastCols->SetLeftMin( (USHORT)pTab->Frm().Left() );
- pLastTabFrm = pTab;
- }
- else
- bDel = TRUE;
- }
-
- if ( !bDel &&
- pLastCols->GetLeftMin () == (USHORT)pTab->Frm().Left() &&
- pLastCols->GetLeft () == (USHORT)pTab->Prt().Left() &&
- pLastCols->GetRight () == (USHORT)pTab->Prt().Right()&&
- pLastCols->GetRightMax() ==
- (USHORT)pTab->Frm().Right() - pLastCols->GetLeftMin() )
-#endif
+ pLastCols->GetRightMax() == (USHORT)nRightMax - pLastCols->GetLeftMin() )
{
if ( pLastCellFrm != pBox )
{
@@ -894,7 +1004,7 @@ void SwFEShell::ProtectCells()
{
if( IsTableMode() )
ClearMark();
- ParkCrsr( GetCrsr()->GetPoint()->nNode );
+ ParkCursorInTab();
}
EndAllActionAndCall();
}
@@ -1240,27 +1350,43 @@ USHORT SwFEShell::GetCurTabColNum() const
// dem CellFrame vergleichen????
pFrm = pFrm->GetUpper();
} while ( !pFrm->IsCellFrm() );
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pFrm )
const long nX = (pFrm->Frm().*fnRect->fnGetLeft)();
-#else
- const long nX = pFrm->Frm().Left();
-#endif
//TabCols besorgen, den nur ueber diese erreichen wir die Position.
SwTabCols aTabCols;
GetTabCols( aTabCols );
- const long nLeft = aTabCols.GetLeftMin();
+ if( pFrm->FindTabFrm()->IsRightToLeft() )
+ {
+ long nX = (pFrm->Frm().*fnRect->fnGetRight)();
+ const long nRight = aTabCols.GetLeftMin() + aTabCols.GetRight();;
- if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
+ if ( !::IsSame( nX, nRight ) )
+ {
+ nX = nRight - nX + aTabCols.GetLeft();
+ for ( USHORT i = 0; i < aTabCols.Count(); ++i )
+ if ( ::IsSame( nX, aTabCols[i] ) )
+ {
+ nRet = i + 1;
+ break;
+ }
+ }
+ }
+ else
{
- for ( USHORT i = 0; i < aTabCols.Count(); ++i )
- if ( ::IsSame( nX, nLeft + aTabCols[i] ) )
- {
- nRet = i + 1;
- break;
- }
+ const long nX = (pFrm->Frm().*fnRect->fnGetLeft)();
+ const long nLeft = aTabCols.GetLeftMin();
+
+ if ( !::IsSame( nX, nLeft + aTabCols.GetLeft() ) )
+ {
+ for ( USHORT i = 0; i < aTabCols.Count(); ++i )
+ if ( ::IsSame( nX, nLeft + aTabCols[i] ) )
+ {
+ nRet = i + 1;
+ break;
+ }
+ }
}
}
return nRet;
@@ -1327,7 +1453,6 @@ const SwFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt, SwTwips nFu
pFrm = pFrm->GetUpper();
if ( pFrm )
{
-#ifdef VERTICAL_LAYOUT
if( pFrm->IsVertical() )
{
if ( ::IsSame(pFrm->Frm().Top(), rPt.Y()) ||
@@ -1340,13 +1465,6 @@ const SwFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt, SwTwips nFu
::IsSame(pFrm->Frm().Right(),rPt.X()) )
return pFrm;
}
-#else
- if ( ::IsSame(pFrm->Frm().Left(), rPt.X()) ||
- ::IsSame(pFrm->Frm().Right(),rPt.X()) )
- {
- return pFrm;
- }
-#endif
pFrm = pFrm->GetUpper();
}
} while ( pFrm );
@@ -1558,12 +1676,8 @@ BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
// sollte die Tabelle noch auf relativen Werten (USHRT_MAX) stehen
// dann muss es jetzt auf absolute umgerechnet werden.
const SwFmtFrmSize& rTblFrmSz = pTab->GetFmt()->GetFrmSize();
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pTab )
long nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)();
-#else
- long nPrtWidth = pTab->Prt().Width();
-#endif
if( TBLVAR_CHGABS == pTab->GetTable()->GetTblChgMode() &&
( eType & WH_COL_LEFT || eType & WH_COL_RIGHT ) &&
HORI_NONE == pTab->GetFmt()->GetHoriOrient().GetHoriOrient() &&
@@ -1576,11 +1690,7 @@ BOOL SwFEShell::SetColRowWidthHeight( USHORT eType, USHORT nDiff )
if( (eType & (WH_FLAG_BIGGER | WH_FLAG_INSDEL)) ==
(WH_FLAG_BIGGER | WH_FLAG_INSDEL) )
-#ifdef VERTICAL_LAYOUT
nDiff = USHORT((pFrm->Frm().*fnRect->fnGetWidth)());
-#else
- nDiff = USHORT(pFrm->Frm().Width());
-#endif
SwTwips nLogDiff = nDiff;
nLogDiff *= pTab->GetFmt()->GetFrmSize().GetWidth();
@@ -1762,7 +1872,7 @@ BOOL SwFEShell::GetAutoSum( String& rFml ) const
return TRUE;
}
-/* -----------------------------22.08.2002 12:37------------------------------
+/* -----------------------------22.08.2002 12:50------------------------------
---------------------------------------------------------------------------*/
BOOL SwFEShell::IsTableRightToLeft() const
@@ -1783,3 +1893,4 @@ BOOL SwFEShell::IsMouseTableRightToLeft(const Point &rPt) const
ASSERT( pTabFrm, "Table not found" );
return pTabFrm ? pTabFrm->IsRightToLeft() : FALSE;
}
+
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 4e40a6c9b087..448a8a38be3c 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tblsel.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fme $ $Date: 2002-09-26 13:17:23 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -159,7 +159,6 @@
//siehe auch swtable.cxx
#define COLFUZZY 20L
-
// defines, die bestimmen, wie Tabellen Boxen gemergt werden:
// - 1. alle leeren Zeilen entfernen, alle Boxen werden mit Blank,
// alle Lines mit ParaBreak getrennt
@@ -1575,7 +1574,11 @@ USHORT CheckMergeSel( const SwSelBoxes& rBoxes )
{
eRet = TBLMERGE_OK;
- _FndBox aFndBox( rBoxes );
+ _FndBox aFndBox( 0, 0 );
+ _FndPara aPara( rBoxes, &aFndBox );
+ const SwTableNode* pTblNd = aPara.rBoxes[0]->GetSttNd()->FindTableNode();
+ ((SwTable&)pTblNd->GetTable()).GetTabLines().ForEach(
+ &_FndLineCopyCol, &aPara );
if( aFndBox.GetLines().Count() )
{
BOOL bMergeSelOk = TRUE;
@@ -1616,8 +1619,8 @@ SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish,
#ifdef BIDI
const sal_Bool bRTL = pCell->IsRightToLeft();
SwTwips nRet = bRTL ?
- nAct - pCell->GetFmt()->GetFrmSize().GetWidth() * nAct / nWish :
- 0;
+ nAct - pCell->Frm().Width() :
+ 0;
#else
SwTwips nRet = 0;
#endif
@@ -2172,6 +2175,51 @@ void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
}
+BOOL _FndBoxCopyCol( const SwTableBox*& rpBox, void* pPara )
+{
+ _FndPara* pFndPara = (_FndPara*)pPara;
+ _FndBox* pFndBox = new _FndBox( (SwTableBox*)rpBox, pFndPara->pFndLine );
+ if( rpBox->GetTabLines().Count() )
+ {
+ _FndPara aPara( *pFndPara, pFndBox );
+ pFndBox->GetBox()->GetTabLines().ForEach( &_FndLineCopyCol, &aPara );
+ if( !pFndBox->GetLines().Count() )
+ {
+ delete pFndBox;
+ return TRUE;
+ }
+ }
+ else
+ {
+ SwTableBoxPtr pSrch = (SwTableBoxPtr)rpBox;
+ USHORT nFndPos;
+ if( !pFndPara->rBoxes.Seek_Entry( pSrch, &nFndPos ))
+ {
+ delete pFndBox;
+ return TRUE;
+ }
+ }
+ pFndPara->pFndLine->GetBoxes().C40_INSERT( _FndBox, pFndBox,
+ pFndPara->pFndLine->GetBoxes().Count() );
+ return TRUE;
+}
+
+BOOL _FndLineCopyCol( const SwTableLine*& rpLine, void* pPara )
+{
+ _FndPara* pFndPara = (_FndPara*)pPara;
+ _FndLine* pFndLine = new _FndLine( (SwTableLine*)rpLine, pFndPara->pFndBox );
+ _FndPara aPara( *pFndPara, pFndLine );
+ pFndLine->GetLine()->GetTabBoxes().ForEach( &_FndBoxCopyCol, &aPara );
+ if( pFndLine->GetBoxes().Count() )
+ {
+ pFndPara->pFndBox->GetLines().C40_INSERT( _FndLine, pFndLine,
+ pFndPara->pFndBox->GetLines().Count() );
+ }
+ else
+ delete pFndLine;
+ return TRUE;
+}
+
void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable )
{
//Pointer auf die Lines vor und hinter den zu verarbeitenden Bereich
@@ -2429,6 +2477,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
SwTabFrm *pTable;
for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
pTable = (SwTabFrm*)aTabIter.Next() )
+ {
if( !pTable->IsFollow() )
{
SwFrm *pSibling = 0;
@@ -2497,29 +2546,33 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
((SwTabFrm*)pUpper)->SetCalcLowers();
}
}
+ }
//Die Headlines mussen ggf. auch verarbeitet werden. Um gut arbeitenden
//Code nicht zu zerfasern wird hier nochmals iteriert.
if ( !bBehind && nBfPos == USHRT_MAX && rTable.IsHeadlineRepeat() )
{
- SwTabFrm *pTab = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) );
- if ( pTab->Lower() )
+ for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
+ pTable = (SwTabFrm*)aTabIter.Next() )
{
- if ( pTab->IsFollow() )
- {
- //Alte Headline vernichten
- SwFrm *pLow = pTab->Lower();
- pLow->Cut();
- delete pLow;
- }
- if ( ((SwRowFrm*)pTab->Lower())->GetTabLine() !=
- rTable.GetTabLines()[0] )
+ if ( pTable->Lower() )
{
- //Neue Headline einsetzen
- SwRowFrm *pRow = new SwRowFrm( *rTable.GetTabLines()[0]);
- pRow->Paste( pTab, pTab->Lower() );
- pRow->RegistFlys();
- pTab->SetCalcLowers();
+ if ( pTable->IsFollow() )
+ {
+ //Alte Headline vernichten
+ SwFrm *pLow = pTable->Lower();
+ pLow->Cut();
+ delete pLow;
+ }
+ if ( ((SwRowFrm*)pTable->Lower())->GetTabLine() !=
+ rTable.GetTabLines()[0] )
+ {
+ //Neue Headline einsetzen
+ SwRowFrm *pRow = new SwRowFrm( *rTable.GetTabLines()[0]);
+ pRow->Paste( pTable, pTable->Lower() );
+ pRow->RegistFlys();
+ pTable->SetCalcLowers();
+ }
}
}
}
@@ -2626,112 +2679,6 @@ const SwTableBox *lcl_FindLastBox( const SwTable &rTable )
return pBox;
}
- // fill the structure from the selection (the selboxes) into
- // his own structure. Works only if the box contains no data!
-_FndBox::_FndBox( const SwSelBoxes& rBoxes )
- : pBox( 0 ), pUpper( 0 ), pLineBefore( 0 ), pLineBehind( 0 )
-{
- if( 1 == rBoxes.Count() )
- {
- _FndBox *pTmp = this;
- AddToFndBox( pTmp, *rBoxes[0] );
- }
- else
- {
- SwSelBoxes aBoxes;
- aBoxes.Insert( &rBoxes );
- const SwTable &rTable = rBoxes[0]->GetSttNd()->FindTableNode()->GetTable();
- for( USHORT n = 0, nEnd = rTable.GetTabLines().Count();
- n < nEnd && aBoxes.Count(); ++n )
- _FndBox::AddSelLine( *this, *rTable.GetTabLines()[ n ], aBoxes );
- }
-}
-
-_FndBox::_FndBox( const SwTableLine& rLine )
- : pBox( 0 ), pUpper( 0 ), pLineBefore( 0 ), pLineBehind( 0 )
-{
- AppendLine( *this, rLine );
-}
-
-void _FndBox::AddToFndBox( _FndBox*& rpParent, const SwTableBox& rBox )
-{
- // search the toplevel parent
- if( rBox.GetUpper()->GetUpper() )
- _FndBox::AddToFndBox( rpParent, *rBox.GetUpper()->GetUpper() );
-
- _FndLine* pFndLine = new _FndLine( (SwTableLine*)rBox.GetUpper(),
- rpParent );
- rpParent->GetLines().C40_INSERT( _FndLine, pFndLine, 0 );
- _FndBox* pFndBox = new _FndBox( (SwTableBox*)&rBox, pFndLine );
- pFndLine->GetBoxes().C40_INSERT( _FndBox, pFndBox, 0 );
-
- rpParent = pFndBox;
-}
-
-
-void _FndBox::AppendLine( _FndBox& rBox, const SwTableLine& rLine )
-{
- USHORT n = 0, nEnd = rLine.GetTabBoxes().Count();
- if( nEnd )
- {
- _FndLine* pFndLine = new _FndLine( (SwTableLine*)&rLine, &rBox );
- rBox.GetLines().C40_INSERT( _FndLine, pFndLine, rBox.GetLines().Count() );
- for( ; n < nEnd; ++n )
- _FndBox::AppendBox( *pFndLine, *rLine.GetTabBoxes()[ n ] );
- }
-}
-
-void _FndBox::AppendBox( _FndLine& rLine, const SwTableBox& rBox )
-{
- _FndBox* pFndBox = new _FndBox( (SwTableBox*)&rBox, &rLine );
- rLine.GetBoxes().C40_INSERT( _FndBox, pFndBox, rLine.GetBoxes().Count() );
- for( USHORT n = 0, nEnd = rBox.GetTabLines().Count(); n < nEnd; ++n )
- _FndBox::AppendLine( *pFndBox, *rBox.GetTabLines()[ n ] );
-}
-
-void _FndBox::AddSelLine( _FndBox& rBox, const SwTableLine& rLine,
- SwSelBoxes& rBoxes )
-{
- _FndLine* pFndLine = new _FndLine( (SwTableLine*)&rLine, &rBox );
- for( USHORT n = 0, nEnd = rLine.GetTabBoxes().Count();
- n < nEnd && rBoxes.Count(); ++n )
- _FndBox::AddSelBox( *pFndLine, *rLine.GetTabBoxes()[ n ], rBoxes );
-
- if( pFndLine->GetBoxes().Count() )
- rBox.GetLines().C40_INSERT( _FndLine, pFndLine, rBox.GetLines().Count() );
- else
- delete pFndLine;
-}
-
-void _FndBox::AddSelBox( _FndLine& rLine, const SwTableBox& rBox,
- SwSelBoxes& rBoxes )
-{
- _FndBox* pFndBox;
- USHORT n = 0, nEnd = rBox.GetTabLines().Count();
- if( nEnd )
- {
- pFndBox = new _FndBox( (SwTableBox*)&rBox, &rLine );
- for( ; n < nEnd && rBoxes.Count(); ++n )
- _FndBox::AddSelLine( *pFndBox, *rBox.GetTabLines()[ n ], rBoxes );
- if( !pFndBox->GetLines().Count() )
- delete pFndBox, pFndBox = 0;
- }
- else
- {
- SwTableBoxPtr pSrch = (SwTableBoxPtr)&rBox;
- USHORT nFndPos;
- if( rBoxes.Seek_Entry( pSrch, &nFndPos ))
- {
- pFndBox = new _FndBox( pSrch, &rLine );
- rBoxes.Remove( nFndPos );
- }
- else
- pFndBox = 0;
- }
- if( pFndBox )
- rLine.GetBoxes().C40_INSERT( _FndBox, pFndBox, rLine.GetBoxes().Count() );
-}
-
//GPF bei Tab in letzer Zelle mit MSC4
#pragma optimize("",off)
@@ -2834,4 +2781,3 @@ void _FndBox::RestoreChartData( const SwTable &rTable )
#pragma optimize("",on)
-
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 7d5377c1f80d..9e1e5a95d835 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndgrf.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: od $ $Date: 2002-09-17 13:47:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -164,8 +164,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
: SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr )
{
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
- bInSwapIn = bChgTwipSize = bLoadLowResGrf = bFrameInPaint =
- bScaleImageMap = FALSE;
+ bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
+ bFrameInPaint = bScaleImageMap = FALSE;
bGrafikArrived = TRUE;
ReRead( rGrfName, rFltName, pGraphic, 0, FALSE );
}
@@ -179,8 +179,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
if( rGrfObj.HasUserData() && rGrfObj.IsSwappedOut() )
aGrfObj.SetSwapState();
- bInSwapIn = bChgTwipSize = bLoadLowResGrf = bFrameInPaint =
- bScaleImageMap = FALSE;
+ bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
+ bFrameInPaint = bScaleImageMap = FALSE;
bGrafikArrived = TRUE;
}
@@ -199,8 +199,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
Graphic aGrf; aGrf.SetDefaultType();
aGrfObj.SetGraphic( aGrf, rGrfName );
- bInSwapIn = bChgTwipSize = bLoadLowResGrf = bFrameInPaint =
- bScaleImageMap = FALSE;
+ bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
+ bFrameInPaint = bScaleImageMap = FALSE;
bGrafikArrived = TRUE;
InsertLink( rGrfName, rFltName );
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 462623d484c4..9c1f690bbb52 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: drawfont.hxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:27:19 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -153,20 +153,28 @@ private:
SvXub_StrLens aCompLen;
SvBytes aCompType;
xub_StrLen nInvalidityPos;
+ BYTE nDefaultDir;
+ sal_Bool bBidiInfoValid;
public:
enum CompType { KANA, SPECIAL_LEFT, SPECIAL_RIGHT, NONE };
- inline SwScriptInfo() : nInvalidityPos( 0 ) {};
+ inline SwScriptInfo() : nInvalidityPos( 0 ), nDefaultDir( 0 ),
+ bBidiInfoValid( sal_False ) {};
// determines script changes
void InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
const OutputDevice& rOut );
+ void UpdateBidiInfo( const String& rTxt );
// set/get position from which data is invalid
inline void SetInvalidity( const xub_StrLen nPos );
inline xub_StrLen GetInvalidity() const { return nInvalidityPos; };
+ // get default direction for paragraph
+ inline BYTE GetDefaultDir() const { return nDefaultDir; };
+ inline void SetDefaultDir( BYTE nNew ) { nDefaultDir = nNew; };
+
// array operations, nCnt refers to array position
inline USHORT CountScriptChg() const;
inline xub_StrLen GetScriptChg( const USHORT nCnt ) const;
@@ -263,13 +271,15 @@ public:
long* pScrArray, xub_StrLen nIdx,
xub_StrLen nLen, USHORT nSpace = 0 );
- static const SwScriptInfo* GetScriptInfo( const SwTxtNode& rNode );
+ static SwScriptInfo* GetScriptInfo( const SwTxtNode& rNode,
+ sal_Bool bAllowInvalid = sal_False );
};
inline void SwScriptInfo::SetInvalidity( const xub_StrLen nPos )
{
if ( nPos < nInvalidityPos )
nInvalidityPos = nPos;
+ bBidiInfoValid = sal_False;
};
inline USHORT SwScriptInfo::CountScriptChg() const { return aScriptChg.Count(); }
inline xub_StrLen SwScriptInfo::GetScriptChg( const USHORT nCnt ) const
@@ -356,6 +366,7 @@ class SwDrawTextInfo
short nSperren;
short nKern;
short nSpace;
+ BYTE nCursorBidiLevel;
BOOL bBullet : 1;
BOOL bUpper : 1; // Fuer Kapitaelchen: Grossbuchstaben-Flag
BOOL bDrawSpace : 1; // Fuer Kapitaelchen: Unter/Durchstreichung
@@ -396,239 +407,384 @@ public:
BOOL bOfst : 1;
BOOL bHyph : 1;
#endif
+
SwDrawTextInfo( ViewShell *pS, OutputDevice &rO, const SwScriptInfo* pSI,
const XubString &rSt, xub_StrLen nI, xub_StrLen nL,
- USHORT nW = 0, BOOL bB = FALSE)
- { pSh = pS; pOut = &rO; pScriptInfo = pSI; pText = &rSt; nIdx = nI;
- nLen = nL; nKern = 0; nCompress = 0; nWidth = nW;
- bBullet = bB; pUnderFnt = 0; bGreyWave = bSpaceStop =
-#ifdef BIDI
- bSnapToGrid = bIgnoreFrmRTL = FALSE;
-#else
+ USHORT nW = 0, BOOL bB = FALSE )
+ {
+ pFrm = NULL;
+ pSh = pS;
+ pOut = &rO;
+ pScriptInfo = pSI;
+ pText = &rSt;
+ nIdx = nI;
+ nLen = nL;
+ nKern = 0;
+ nCompress = 0;
+ nWidth = nW;
+ nCursorBidiLevel = 0;
+ bBullet = bB;
+ pUnderFnt = 0;
+ bGreyWave = FALSE;
+ bSpaceStop = FALSE;
bSnapToGrid = FALSE;
+#ifdef BIDI
+ bIgnoreFrmRTL = FALSE;
#endif
- pFrm = 0;
#ifndef PRODUCT
bOut = bText = bIdx = bLen = bWidth = bKern = bBull = bSpec =
- bGreyWv = TRUE;
+ bGreyWv = TRUE;
+
bPos = bWrong = bSize = bFnt = bAscent = bSpace = bUppr =
- bDrawSp = bLeft = bRight = bKana = bOfst = bHyph = FALSE;
+ bDrawSp = bLeft = bRight = bKana = bOfst = bHyph = FALSE;
#endif
}
- const SwTxtFrm* GetFrm() const { return pFrm; }
- void SetFrm( const SwTxtFrm* pNewFrm ) { pFrm = pNewFrm; }
+ const SwTxtFrm* GetFrm() const
+ {
+ return pFrm;
+ }
+
+ void SetFrm( const SwTxtFrm* pNewFrm )
+ {
+ pFrm = pNewFrm;
+ }
+
+ ViewShell *GetShell() const
+ {
+ return pSh;
+ }
- ViewShell *GetShell() const { return pSh; }
- OutputDevice& GetOut() const {
+ OutputDevice& GetOut() const
+ {
ASSERT( bOut, "DrawTextInfo: Undefined Outputdevice" );
return *pOut;
}
- OutputDevice *GetpOut() const {
+
+ OutputDevice *GetpOut() const
+ {
ASSERT( bOut, "DrawTextInfo: Undefined Outputdevice" );
return pOut;
}
- const SwScriptInfo* GetScriptInfo() const {
+
+ const SwScriptInfo* GetScriptInfo() const
+ {
return pScriptInfo;
}
- const Point &GetPos() const {
+
+ const Point &GetPos() const
+ {
ASSERT( bPos, "DrawTextInfo: Undefined Position" );
return *pPos;
}
- xub_StrLen *GetHyphPos() const {
+
+ xub_StrLen *GetHyphPos() const
+ {
ASSERT( bHyph, "DrawTextInfo: Undefined Hyph Position" );
return pHyphPos;
}
- const Fraction &GetZoom() const { return aZoom; }
- Fraction &GetZoom() { return aZoom; }
+ const Fraction &GetZoom() const
+ {
+ return aZoom;
+ }
+
+ Fraction &GetZoom()
+ {
+ return aZoom;
+ }
- const XubString &GetText() const {
+ const XubString &GetText() const
+ {
ASSERT( bText, "DrawTextInfo: Undefined String" );
return *pText;
}
- const SwWrongList* GetWrong() const {
+
+ const SwWrongList* GetWrong() const
+ {
ASSERT( bWrong, "DrawTextInfo: Undefined WrongList" );
return pWrong;
}
- const Size &GetSize() const {
+
+ const Size &GetSize() const
+ {
ASSERT( bSize, "DrawTextInfo: Undefined Size" );
return *pSize;
}
- SwFont* GetFont() const {
+
+ SwFont* GetFont() const
+ {
ASSERT( bFnt, "DrawTextInfo: Undefined Font" );
return pFnt;
}
- SwUnderlineFont* GetUnderFnt() const {
+
+ SwUnderlineFont* GetUnderFnt() const
+ {
ASSERT( bSpec, "DrawTextInfo: Undefined Underlinefont" );
return pUnderFnt;
}
- xub_StrLen GetIdx() const {
+
+ xub_StrLen GetIdx() const
+ {
ASSERT( bIdx, "DrawTextInfo: Undefined Index" );
return nIdx;
}
- xub_StrLen GetLen() const {
+
+ xub_StrLen GetLen() const
+ {
ASSERT( bLen, "DrawTextInfo: Undefined Length" );
return nLen;
}
- xub_StrLen GetOfst() const {
+
+ xub_StrLen GetOfst() const
+ {
ASSERT( bOfst, "DrawTextInfo: Undefined Offset" );
return nOfst;
}
- xub_StrLen GetEnd() const {
+
+ xub_StrLen GetEnd() const
+ {
ASSERT( bIdx, "DrawTextInfo: Undefined Index" );
ASSERT( bLen, "DrawTextInfo: Undefined Length" );
return nIdx + nLen;
}
- long GetLeft() const {
+
+ long GetLeft() const
+ {
ASSERT( bLeft, "DrawTextInfo: Undefined left range" );
return nLeft;
}
- long GetRight() const {
+
+ long GetRight() const
+ {
ASSERT( bRight, "DrawTextInfo: Undefined right range" );
return nRight;
}
- long GetKanaDiff() const {
+
+ long GetKanaDiff() const
+ {
ASSERT( bKana, "DrawTextInfo: Undefined kana difference" );
return nKanaDiff;
}
- USHORT GetWidth() const {
+
+ USHORT GetWidth() const
+ {
ASSERT( bWidth, "DrawTextInfo: Undefined Width" );
return nWidth;
}
- USHORT GetAscent() const {
+
+ USHORT GetAscent() const
+ {
ASSERT( bAscent, "DrawTextInfo: Undefined Ascent" );
return nAscent;
}
- USHORT GetKanaComp() const {
+
+ USHORT GetKanaComp() const
+ {
return nCompress;
}
- short GetSperren() const {
+
+ short GetSperren() const
+ {
ASSERT( bSperr, "DrawTextInfo: Undefined >Sperren<" );
return nSperren;
}
- short GetKern() const {
+
+ short GetKern() const
+ {
ASSERT( bKern, "DrawTextInfo: Undefined Kerning" );
return nKern;
}
- short GetSpace() const {
+
+ short GetSpace() const
+ {
ASSERT( bSpace, "DrawTextInfo: Undefined Spacing" );
return nSpace;
}
- BOOL GetBullet() const {
+
+ BYTE GetCursorBidiLevel() const
+ {
+ return nCursorBidiLevel;
+ }
+
+ BOOL GetBullet() const
+ {
ASSERT( bBull, "DrawTextInfo: Undefined Bulletflag" );
return bBullet;
}
- BOOL GetUpper() const {
+
+ BOOL GetUpper() const
+ {
ASSERT( bUppr, "DrawTextInfo: Undefined Upperflag" );
return bUpper;
}
- BOOL GetDrawSpace() const {
+
+ BOOL GetDrawSpace() const
+ {
ASSERT( bDrawSp, "DrawTextInfo: Undefined DrawSpaceflag" );
return bDrawSpace;
}
- BOOL GetGreyWave() const {
+
+ BOOL GetGreyWave() const
+ {
ASSERT( bGreyWv, "DrawTextInfo: Undefined GreyWave" );
return bGreyWave;
}
- BOOL IsSpaceStop() const {
+
+ BOOL IsSpaceStop() const
+ {
return bSpaceStop;
}
- BOOL SnapToGrid() const {
+
+ BOOL SnapToGrid() const
+ {
return bSnapToGrid;
}
- BOOL IsIgnoreFrmRTL() const {
+ BOOL IsIgnoreFrmRTL() const
+ {
return bIgnoreFrmRTL;
}
- void SetOut( OutputDevice &rNew ){ pOut = &rNew;
+ void SetOut( OutputDevice &rNew )
+ {
+ pOut = &rNew;
#ifndef PRODUCT
bOut = TRUE;
#endif
}
- void SetPos( const Point &rNew ){ pPos = &rNew;
+
+ void SetPos( const Point &rNew )
+ {
+ pPos = &rNew;
#ifndef PRODUCT
bPos = TRUE;
#endif
}
- void SetHyphPos( xub_StrLen *pNew ){ pHyphPos = pNew;
+
+ void SetHyphPos( xub_StrLen *pNew )
+ {
+ pHyphPos = pNew;
#ifndef PRODUCT
bHyph = TRUE;
#endif
}
- void SetText( const XubString &rNew ){ pText = &rNew;
+
+ void SetText( const XubString &rNew )
+ {
+ pText = &rNew;
#ifndef PRODUCT
bText = TRUE;
#endif
}
- void SetWrong( const SwWrongList* pNew ){ pWrong = pNew;
+
+ void SetWrong( const SwWrongList* pNew )
+ {
+ pWrong = pNew;
#ifndef PRODUCT
bWrong = TRUE;
#endif
}
- void SetSize( const Size &rNew ){ pSize = &rNew;
+
+ void SetSize( const Size &rNew )
+ {
+ pSize = &rNew;
#ifndef PRODUCT
bSize = TRUE;
#endif
}
- void SetFont( SwFont* pNew ){ pFnt = pNew;
+
+ void SetFont( SwFont* pNew )
+ {
+ pFnt = pNew;
#ifndef PRODUCT
bFnt = TRUE;
#endif
}
- void SetIdx( xub_StrLen nNew ){ nIdx = nNew;
+
+ void SetIdx( xub_StrLen nNew )
+ {
+ nIdx = nNew;
#ifndef PRODUCT
bIdx = TRUE;
#endif
}
- void SetLen( xub_StrLen nNew ){ nLen = nNew;
+
+ void SetLen( xub_StrLen nNew )
+ {
+ nLen = nNew;
#ifndef PRODUCT
bLen = TRUE;
#endif
}
- void SetOfst( xub_StrLen nNew ){ nOfst = nNew;
+
+ void SetOfst( xub_StrLen nNew )
+ {
+ nOfst = nNew;
#ifndef PRODUCT
bOfst = TRUE;
#endif
}
- void SetLeft( long nNew ){ nLeft = nNew;
+
+ void SetLeft( long nNew )
+ {
+ nLeft = nNew;
#ifndef PRODUCT
bLeft = TRUE;
#endif
}
- void SetRight( long nNew ){ nRight = nNew;
+
+ void SetRight( long nNew )
+ {
+ nRight = nNew;
#ifndef PRODUCT
bRight = TRUE;
#endif
}
- void SetKanaDiff( long nNew ){ nKanaDiff = nNew;
+
+ void SetKanaDiff( long nNew )
+ {
+ nKanaDiff = nNew;
#ifndef PRODUCT
bKana = TRUE;
#endif
}
- void SetWidth( USHORT nNew ){ nWidth = nNew;
+
+ void SetWidth( USHORT nNew )
+ {
+ nWidth = nNew;
#ifndef PRODUCT
bWidth = TRUE;
#endif
}
- void SetAscent( USHORT nNew ){ nAscent = nNew;
+
+ void SetAscent( USHORT nNew )
+ {
+ nAscent = nNew;
#ifndef PRODUCT
bAscent = TRUE;
#endif
}
- void SetKern( short nNew ){ nKern = nNew;
+
+ void SetKern( short nNew )
+ {
+ nKern = nNew;
#ifndef PRODUCT
bKern = TRUE;
#endif
}
- void SetSperren( short nNew ){ nSperren = nNew;
+
+ void SetSperren( short nNew )
+ {
+ nSperren = nNew;
#ifndef PRODUCT
bSperr = TRUE;
#endif
}
- void SetSpace( short nNew ){
+
+ void SetSpace( short nNew )
+ {
if( nNew < 0 )
{
SetSperren( -nNew );
@@ -643,40 +799,72 @@ public:
bSpace = TRUE;
#endif
}
- void SetKanaComp( short nNew ){
+
+ void SetCursorBidiLevel( BYTE nNew )
+ {
+ nCursorBidiLevel = nNew;
+ }
+
+ void SetKanaComp( short nNew )
+ {
nCompress = nNew;
}
- void SetBullet( BOOL bNew ){ bBullet = bNew;
+
+ void SetBullet( BOOL bNew )
+ {
+ bBullet = bNew;
#ifndef PRODUCT
bBull = TRUE;
#endif
}
- void SetUnderFnt( SwUnderlineFont* pFnt ){ pUnderFnt = pFnt;
+
+ void SetUnderFnt( SwUnderlineFont* pFnt )
+ {
+ pUnderFnt = pFnt;
#ifndef PRODUCT
bSpec = TRUE;
#endif
}
- void SetUpper( BOOL bNew ){ bUpper = bNew;
+
+ void SetUpper( BOOL bNew )
+ {
+ bUpper = bNew;
#ifndef PRODUCT
bUppr = TRUE;
#endif
}
- void SetDrawSpace( BOOL bNew ){ bDrawSpace = bNew;
+
+ void SetDrawSpace( BOOL bNew )
+ {
+ bDrawSpace = bNew;
#ifndef PRODUCT
bDrawSp = TRUE;
#endif
}
- void SetGreyWave( BOOL bNew ){ bGreyWave = bNew;
+
+ void SetGreyWave( BOOL bNew )
+ {
+ bGreyWave = bNew;
#ifndef PRODUCT
bGreyWv = TRUE;
#endif
}
- void SetSpaceStop( BOOL bNew ) { bSpaceStop = bNew; }
- void SetSnapToGrid( BOOL bNew ) { bSnapToGrid = bNew; }
+ void SetSpaceStop( BOOL bNew )
+ {
+ bSpaceStop = bNew;
+ }
+
+ void SetSnapToGrid( BOOL bNew )
+ {
+ bSnapToGrid = bNew;
+ }
#ifdef BIDI
- void SetIgnoreFrmRTL( BOOL bNew ) { bIgnoreFrmRTL = bNew; }
+ void SetIgnoreFrmRTL( BOOL bNew )
+ {
+ bIgnoreFrmRTL = bNew;
+ }
#endif
void Shift( USHORT nDir );
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 8ba389020e5c..e24d1d299d82 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmtool.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: od $ $Date: 2002-10-11 11:05:26 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:11 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,12 +95,20 @@ class SwCrsrShell;
#define GRFNUM_REPLACE 2
//Painten des Hintergrunds. Mit Brush oder Graphic.
-/// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
-/// consider background transparency, saved in the color of the brush item
+// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
+// consider background transparency, saved in the color of the brush item
void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *,
const SwRect &rOrg, const SwRect &rOut, const BYTE nGrfNum = GRFNUM_NO,
const sal_Bool bConsiderBackgroundTransparency = sal_False );
+// OD 24.01.2003 #106593# - 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
+// Created declaration here to avoid <extern> declarations
+void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
+
//Fly besorgen, wenn keine List hineingereicht wird, wir die der aktuellen
//Shell benutzt.
//Implementierung in feshview.cxx
@@ -239,6 +247,8 @@ 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
+// the stuff that belongs to it.
class SwBorderAttrs : public SwCacheObj
{
const SwAttrSet &rAttrSet;
@@ -247,7 +257,6 @@ class SwBorderAttrs : public SwCacheObj
const SvxBoxItem &rBox;
const SvxShadowItem &rShadow;
const Size aFrmSize; //Die FrmSize
- long nRight;
BOOL bBorderDist :1; //Ist's ein Frm der auch ohne Linie
//einen Abstand haben kann?
@@ -260,7 +269,6 @@ class SwBorderAttrs : public SwCacheObj
BOOL bRightLine :1;
BOOL bTop :1;
BOOL bBottom :1;
- BOOL bRight :1;
BOOL bLine :1;
BOOL bIsLine :1; //Umrandung an mind. einer Kante?
@@ -288,7 +296,6 @@ class SwBorderAttrs : public SwCacheObj
//Lines + Shadow + Abstaende
void _CalcTop();
void _CalcBottom();
- void _CalcRight();
void _IsLine();
@@ -318,10 +325,7 @@ public:
inline USHORT CalcTop() const;
inline USHORT CalcBottom() const;
long CalcLeft( const SwFrm *pCaller ) const;
-#ifdef BIDI
- long CalcRight( const SwFrm *pCaller );
-#endif
- inline long CalcRight() const;
+ long CalcRight( const SwFrm *pCaller ) const;
inline BOOL IsLine() const;
@@ -447,12 +451,6 @@ inline USHORT SwBorderAttrs::CalcBottom() const
((SwBorderAttrs*)this)->_CalcBottom();
return nBottom;
}
-inline long SwBorderAttrs::CalcRight() const
-{
- if ( bRight )
- ((SwBorderAttrs*)this)->_CalcRight();
- return nRight;
-}
inline BOOL SwBorderAttrs::IsLine() const
{
if ( bLine )
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 92891e48cf6d..d1e65e54188f 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pagefrm.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: od $ $Date: 2002-11-20 13:14:44 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -121,6 +121,11 @@ class SwPageFrm: public SwFtnBossFrm
#ifdef VERTICAL_LAYOUT
BOOL bHasGrid :1; // Grid for Asian layout
#endif
+
+ // OD 12.02.2003 #i9719#, #105645#
+ static const sal_Int8 mnBorderPxWidth;
+ static const sal_Int8 mnShadowPxWidth;
+
//Anpassung der RootSize und Benachrichtigungen beim Einsetzen,
//Entfernen und Groessenaenderungen der Seite.
void AdjustRootSize( const SwPageChg eChgType, const SwRect *pOld );
@@ -131,6 +136,75 @@ 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
+ */
+ void GetBorderRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBorderRect ) const;
+
+ /** determine rectangle for right page shadow
+
+ 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 _orRightShadowRect
+ output parameter - instance reference of the right shadow rectangle for
+ the given page rectangle
+ */
+ void GetRightShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orRightShadowRect ) const;
+
+ /** determine rectangle for bottom page shadow
+
+ 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 _orBottomShadowRect
+ output parameter - instance reference of the bottom shadow rectangle for
+ the given page rectangle
+ */
+ void GetBottomShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBottomShadowRect ) const;
+
protected:
virtual void MakeAll();
@@ -271,6 +345,58 @@ public:
*/
void PaintMarginArea( const SwRect& _rOutputRect,
ViewShell* _pViewShell ) const;
+
+ /** paint page border and shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+ 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
+ preview, this parameter is useful.
+
+ @param _pViewShell
+ input parameter - instance of the view shell, on which the output
+ has to be generated.
+ */
+ void PaintBorderAndShadow( const SwRect& _rPageRect,
+ ViewShell* _pViewShell ) const;
+
+ /** get bound rectangle of border and shadow for repaints
+
+ 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 _orBorderAndShadowBoundRect
+ output parameter - instance reference of the bounded border and shadow
+ rectangle for the given page rectangle
+ */
+ void GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBorderAndShadowBoundRect ) const;
+
+ // OD 12.02.2003 #i9719#, #105645#
+ inline sal_Int8 BorderPxWidth() const
+ {
+ return mnBorderPxWidth;
+ }
+ inline sal_Int8 ShadowPxWidth() const
+ {
+ return mnShadowPxWidth;
+ }
};
inline SwCntntFrm *SwPageFrm::FindFirstBodyCntnt()
diff --git a/sw/source/core/inc/prevwpage.hxx b/sw/source/core/inc/prevwpage.hxx
new file mode 100644
index 000000000000..65dc4542557d
--- /dev/null
+++ b/sw/source/core/inc/prevwpage.hxx
@@ -0,0 +1,38 @@
+#ifndef _PREVIEWPAGES_HXX
+#define _PREVIEWPAGES_HXX
+
+// classes <Point>, <Size> and <Rectangle>
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+
+class SwPageFrm;
+
+/** data structure for a preview page in the current preview layout
+
+ OD 12.12.2002 #103492# - struct <PrevwPage>
+
+ @author OD
+*/
+struct PrevwPage
+{
+ const SwPageFrm* pPage;
+ bool bVisible;
+ Size aPageSize;
+ Point aPrevwWinPos;
+ Point aLogicPos;
+ Point aMapOffset;
+
+ inline PrevwPage();
+};
+
+inline PrevwPage::PrevwPage()
+ : pPage( 0 ),
+ bVisible( false ),
+ aPageSize( Size(0,0) ),
+ aPrevwWinPos( Point(0,0) ),
+ aLogicPos( Point(0,0) ),
+ aMapOffset( Point(0,0) )
+{};
+
+#endif
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 62907753f669..8f344b079661 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: rootfrm.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: ama $ $Date: 2002-05-06 10:04:06 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -324,6 +324,22 @@ public:
void AddAccessibleShell() { ++nAccessibleShells; }
void RemoveAccessibleShell() { --nAccessibleShells; }
#endif
+
+ /** get page frame by phyiscal page number
+
+ OD 14.01.2003 #103492#
+ looping through the lowers, which are page frame, in order to find the
+ page frame with the given physical page number.
+ if no page frame is found, 0 is returned.
+ Note: Empty page frames are also returned.
+
+ @param _nPageNum
+ input parameter - physical page number of page frame to be searched and
+ returned.
+
+ @return pointer to the page frame with the given physical page number
+ */
+ SwPageFrm* GetPageByPageNum( sal_uInt16 _nPageNum ) const;
};
inline long SwRootFrm::GetBrowseWidth() const
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 21d417d6c8e7..4ce78723c2be 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.hxx,v $
*
- * $Revision: 1.30 $
+ * $Revision: 1.31 $
*
- * last change: $Author: fme $ $Date: 2002-11-14 08:54:53 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -145,7 +145,7 @@ class SwSubFont : public SvxFont
inline void SetStrikeout( const FontStrikeout eStrikeout );
inline void SetItalic( const FontItalic eItalic );
inline void SetOutline( const BOOL bOutline );
- inline void SetVertical( const USHORT nDir );
+ inline void SetVertical( const USHORT nDir, const BOOL bVertFormat );
inline void SetShadow( const BOOL bShadow );
inline void SetAutoKern( const BYTE nAutoKern );
inline void SetWordLineMode( const BOOL bWordLineMode );
@@ -836,10 +836,10 @@ inline void SwFont::SetNoCol( const BOOL bNew )
bNoColReplace = bNew;
}
-inline void SwSubFont::SetVertical( const USHORT nDir )
+inline void SwSubFont::SetVertical( const USHORT nDir, const BOOL bVertFormat )
{
pMagic = 0;
- Font::SetVertical( nDir > 1000 );
+ Font::SetVertical( bVertFormat );
Font::SetOrientation( nDir );
}
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index d16e1c325c22..6eec5990a0fa 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtfrm.hxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:27:42 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -272,7 +272,10 @@ public:
sal_Bool _UnitDown(SwPaM *, const SwTwips nOffset = 0,
sal_Bool bSetInReadOnly = sal_False ) const;
- void PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel, sal_Bool& bRight );
+ // Prepares the cursor position for a visual cursor move (BiDi).
+ // The behaviour is different for insert and overwrite cursors
+ void PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
+ sal_Bool& bRight, sal_Bool bInsertCrsr );
// Methoden zur Verwaltung von FolgeFrames
SwCntntFrm *SplitFrm( const xub_StrLen nTxtPos );
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 0e9d3a6d2864..2b2cad189bf6 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewimp.hxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: od $ $Date: 2002-12-10 14:16:07 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,8 +70,6 @@
#endif
#include "swtypes.hxx"
#include "swrect.hxx"
-// OD 04.12.2002 #103492#
-#include "previewdata.hxx"
class ViewShell;
class SwFlyFrm;
@@ -94,6 +92,14 @@ class SwAccessibleMap;
class SdrObject;
class Fraction;
#endif
+// OD 12.12.2002 #103492#
+class SwPagePreviewLayout;
+// OD 15.01.2003 #103492#
+#ifndef _PREVWPAGE_HXX
+#include <prevwpage.hxx>
+#endif
+// OD 15.01.2003 #103492#
+#include <vector>
class SwViewImp
{
@@ -102,6 +108,9 @@ 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
+ friend class SwPagePreviewLayout;
+
ViewShell *pSh; //Falls jemand einen Imp durchreicht und doch
//mal eine ViewShell braucht hier die
//Rueckwaertsverkettung.
@@ -143,8 +152,8 @@ class SwViewImp
USHORT nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO)
SwRect aSmoothRect;
- // OD 27.11.2002 #103492#
- CurrentPreviewData* mpCurrPreviewData;
+ // OD 12.12.2002 #103492#
+ SwPagePreviewLayout* mpPgPrevwLayout;
/**
Signal whether to stop printing.
@@ -284,16 +293,13 @@ public:
void SetRestoreActions(USHORT nSet){nRestoreActions = nSet;}
USHORT GetRestoreActions() const{return nRestoreActions;}
- // OD 04.12.2002 #103492#
- inline void InitPreviewData()
- {
- mpCurrPreviewData = new CurrentPreviewData;
- }
+ // OD 12.12.2002 #103492#
+ void InitPagePreviewLayout();
- // OD 04.12.2002 #103492#
- inline CurrentPreviewData* CurrPrevwData()
+ // OD 12.12.2002 #103492#
+ inline SwPagePreviewLayout* PagePreviewLayout()
{
- return mpCurrPreviewData;
+ return mpPgPrevwLayout;
}
#ifdef ACCESSIBLE_LAYOUT
@@ -340,12 +346,12 @@ public:
const SwFlyFrm *pFollow );
// update data for accessible preview
- void UpdateAccessiblePreview( sal_uInt8 nRow, sal_uInt8 nColumn,
- sal_Int16 nStartPage,
- const Size& rPageSize,
- const Point& rFreePoint,
- const Fraction& rScale,
- USHORT nSelectedPage );
+ // OD 15.01.2003 #103492# - change method signature due to new page preview
+ // functionality
+ void UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
+ const Fraction& _rScale,
+ const SwPageFrm* _pSelectedPageFrm,
+ const Size& _rPrevwWinSize );
void InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index e94437df50d8..99a1d65d94be 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: atrfrm.cxx,v $
*
- * $Revision: 1.36 $
+ * $Revision: 1.37 $
*
- * last change: $Author: od $ $Date: 2002-10-11 11:39:45 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -569,7 +569,7 @@ BOOL SwFmtFrmSize::PutValue( const uno::Any& rVal, BYTE nMemberId )
{
sal_Int16 nSet;
rVal >>= nSet;
- if(nSet >= 0 && nSet <= 100)
+ if(nSet >= 0 && nSet <= 0xfe)
SetHeightPercent((BYTE)nSet);
else
bRet = sal_False;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 5495398e4a2e..5095c65d200b 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: calcmove.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: od $ $Date: 2002-11-11 09:40:33 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,6 +96,10 @@
#ifndef _FMTANCHR_HXX //autogen
#include <fmtanchr.hxx>
#endif
+#ifndef _FMTCLBL_HXX
+#include <fmtclbl.hxx>
+#endif
+
#include "tabfrm.hxx"
#include "ftnfrm.hxx"
#include "txtfrm.hxx"
@@ -979,7 +983,18 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
//4. Der Abstand fuer TextFrms entspricht mindestens dem Durchschuss
nUpper = CalcUpperSpace( &rAttrs, NULL );
- SwTwips nLower = rAttrs.GetBottomLine( this );
+ // in balanced columned section frames we do not want the
+ // common border
+ sal_Bool bCommonBorder = sal_True;
+ if ( IsInSct() && GetUpper()->IsColBodyFrm() )
+ {
+ const SwSectionFrm* pSct = FindSctFrm();
+ bCommonBorder = pSct->GetFmt()->GetBalancedColumns().GetValue();
+ }
+ SwTwips nLower = bCommonBorder ?
+ rAttrs.GetBottomLine( this ) :
+ rAttrs.CalcBottomLine();
+
(Prt().*fnRect->fnSetPosY)( (!bVert || bReverse) ? nUpper : nLower);
nUpper += nLower;
nUpper -= (Frm().*fnRect->fnGetHeight)() -
@@ -1453,10 +1468,25 @@ void SwCntntFrm::MakeAll()
((SwSectionFrm*)pOldUp->GetUpper()->GetUpper())->MoveAllowed(this) )
bMovedFwd = FALSE;
+ const sal_Bool bCheckForGrownBody = pOldUp->IsBodyFrm();
+ const long nOldBodyHeight = (pOldUp->Frm().*fnRect->fnGetHeight)();
+
if ( !bMovedFwd && !MoveFwd( bMakePage, FALSE ) )
bMakePage = FALSE;
SWREFRESHFN( this )
- bMovedFwd = TRUE;
+
+ // If MoveFwd moves the paragraph to the next page, a following
+ // paragraph, which contains footnotes can can cause the old upper
+ // frame to grow. In this case we explicitely allow a new check
+ // for MoveBwd. Robust: We also check the bMovedBwd flag again.
+ // If pOldUp was a footnote frame, it has been deleted inside MoveFwd.
+ // Therefore we only check for growing body frames.
+ if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() &&
+ (pOldUp->Frm().*fnRect->fnGetHeight)() > nOldBodyHeight )
+ bMovedFwd = FALSE;
+ else
+ bMovedFwd = TRUE;
+
bFormatted = FALSE;
if ( bMoveOrFit && GetUpper() == pOldUp )
{
@@ -1649,7 +1679,17 @@ BOOL SwCntntFrm::_WouldFit( SwTwips nSpace, SwLayoutFrm *pNewUpper, BOOL bTstMov
nUpper = CalcUpperSpace( NULL, pPrev );
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pFrm );
const SwBorderAttrs &rAttrs = *aAccess.Get();
- nUpper += rAttrs.GetBottomLine( pFrm );
+ // in balanced columned section frames we do not want the
+ // common border
+ sal_Bool bCommonBorder = sal_True;
+ if ( pFrm->IsInSct() && pFrm->GetUpper()->IsColBodyFrm() )
+ {
+ const SwSectionFrm* pSct = pFrm->FindSctFrm();
+ bCommonBorder = pSct->GetFmt()->GetBalancedColumns().GetValue();
+ }
+ nUpper += bCommonBorder ?
+ rAttrs.GetBottomLine( pFrm ) :
+ rAttrs.CalcBottomLine();
}
else
{
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 003b6de4a3ea..3ae5574e7ba9 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: findfrm.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: od $ $Date: 2002-11-11 09:36:02 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -736,6 +736,13 @@ SwFrm *SwFrm::_FindNext()
if( ((SwCntntFrm*)this)->GetFollow() )
return ((SwCntntFrm*)this)->GetFollow();
}
+ else if ( IsRowFrm() )
+ {
+ SwFrm* pUpper = GetUpper();
+ if ( pUpper->IsTabFrm() && ((SwTabFrm*)pUpper)->GetFollow() )
+ return ((SwTabFrm*)pUpper)->GetFollow()->GetLower();
+ else return NULL;
+ }
else
return NULL;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index c1dd7c23ed46..638670e7e1b5 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: flowfrm.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: fme $ $Date: 2002-11-13 09:40:43 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1070,7 +1070,7 @@ BOOL SwFlowFrm::IsPrevObjMove() const
pPreUp = pPreUp->GetUpper();
else if( pPreUp->IsColBodyFrm() &&
pPreUp->GetUpper()->GetUpper()->IsSctFrm() )
- pPreUp = pPreUp->GetUpper()->GetUpper();
+ pPreUp = pPreUp->GetUpper()->GetUpper()->GetUpper();
}
const long nBottom = pPreUp->Frm().Bottom();
const long nRight = pPreUp->Frm().Right();
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 24ecaa6587bf..a863e146b0de 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fly.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: fme $ $Date: 2002-11-05 12:30:42 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1461,6 +1461,7 @@ void CalcCntnt( SwLayoutFrm *pLay, BOOL bNoColl )
if ( ((SwTabFrm*)pFrm)->IsFollow() )
((SwTabFrm*)pFrm)->bLockBackMove = FALSE;
}
+
pFrm = pFrm->FindNext();
if( pFrm && pFrm->IsSctFrm() && pSect )
{
@@ -2180,12 +2181,15 @@ void SwFrm::CalcFlys( BOOL bPosOnly )
{
// change anchor position
pO->SetAnchorPos( GetAnchorPos() );
- SwPageFrm* pPage = FindPageFrm();
- if ( pPage )
+ if ( GetValidPosFlag() )
{
- // check if the new position
- // would not exceed the margins of the page
- CaptureDrawObj( *pO, pPage->Frm() );
+ SwPageFrm* pPage = FindPageFrm();
+ if ( pPage && ! pPage->IsInvalidLayout() )
+ {
+ // check if the new position
+ // would not exceed the margins of the page
+ CaptureDrawObj( *pO, pPage->Frm() );
+ }
}
((SwDrawContact*)GetUserCall(pO))->ChkPage();
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index cdda6682195e..d585f2fb3135 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: flycnt.cxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: fme $ $Date: 2002-10-30 15:04:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1100,11 +1100,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
const SwRect aOld( AddSpacesToFrm() );
Point aNew( rNew );
-#ifdef BIDI
if( GetAnchor()->IsVertical() || GetAnchor()->IsRightToLeft() )
-#else
- if( GetAnchor()->IsVertical() )
-#endif
aNew.X() += Frm().Width();
SwCntntFrm *pCnt = (SwCntntFrm*)::FindAnchor( GetAnchor(), aNew );
@@ -1113,7 +1109,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
SwPageFrm *pPage = 0;
SWRECTFN( pCnt )
-#ifdef BIDI
const sal_Bool bRTL = pCnt->IsRightToLeft();
if( ( bVert != GetAnchor()->IsVertical() ) ||
@@ -1124,15 +1119,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
else
aNew.X() -= Frm().Width();
}
-#else
- if( ( bVert != GetAnchor()->IsVertical() )
- {
- if( bVert )
- aNew.X() += Frm().Width();
- else
- aNew.X() -= Frm().Width();
- }
-#endif
if ( pCnt->IsInDocBody() )
{
@@ -1214,20 +1200,16 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
{
if( !pFrm )
{
-#ifdef BIDI
if ( pCnt->IsRightToLeft() )
nX += pCnt->Frm().Right() - rNew.X() - Frm().Width();
else
-#endif
nX += rNew.X() - pCnt->Frm().Left();
}
else
{
-#ifdef BIDI
if ( pFrm->IsRightToLeft() )
nX += pFrm->Frm().Right() - rNew.X() - Frm().Width();
else
-#endif
nX = rNew.X() - pFrm->Frm().Left();
}
}
@@ -1479,6 +1461,22 @@ void SwFlyAtCntFrm::AssertPage()
if ( Frm().Top() < pNewPage->Frm().Top() && pNewPage->GetPrev() )
{
pNewPage = (SwPageFrm*)pNewPage->GetPrev();
+ // OD 19.02.2003 #105643# - skip empty page and consider empty
+ // page at the beginning of the document.
+ // Assumption about document layout:
+ // No two empty pages following each other.
+ if ( pNewPage->IsEmptyPage() )
+ {
+ if ( pNewPage->GetPrev() )
+ {
+ pNewPage = static_cast<SwPageFrm*>(pNewPage->GetPrev());
+ }
+ else
+ {
+ bFound = TRUE;
+ pNewPage = static_cast<SwPageFrm*>(pNewPage->GetNext());
+ }
+ }
if ( nDir == 2 )
{
bFound = TRUE;
@@ -2127,12 +2125,8 @@ void SwFlyAtCntFrm::MakeFlyPos()
nRelPosX += aHori.GetPos();
}
else if( bToggle || ( !aHori.IsPosToggle() && bR2L ) )
-#ifdef BIDI
nRelPosX = nWidth - aFrm.Width() - aHori.GetPos() +
( bR2L ? nAdd : 0 );
-#else
- nRelPosX = nWidth - aFrm.Width() - aHori.GetPos();
-#endif
else
nRelPosX += aHori.GetPos();
//Da die relative Position immer zum Anker relativ ist,
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 4fda29b450f4..bdad954d2e90 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmtool.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: fme $ $Date: 2002-12-09 10:37:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1630,7 +1630,7 @@ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor )
//Muessen alle einmal berechnet werden:
bTopLine = bBottomLine = bLeftLine = bRightLine =
- bTop = bBottom = bRight = bLine = TRUE;
+ bTop = bBottom = bLine = TRUE;
bCacheGetLine = bCachedGetTopLine = bCachedGetBottomLine = FALSE;
@@ -1668,56 +1668,49 @@ void SwBorderAttrs::_CalcBottom()
bBottom = FALSE;
}
-void SwBorderAttrs::_CalcRight()
+long SwBorderAttrs::CalcRight( const SwFrm* pCaller ) const
{
- nRight = CalcRightLine() + rLR.GetRight();
- bRight = FALSE;
-}
-
+ long nRight;
-#ifdef BIDI
+ // 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() )
+ nRight = CalcLeftLine();
+ else
+ nRight = CalcRightLine();
-long SwBorderAttrs::CalcRight( const SwFrm* pCaller )
-{
// for paragraphs, "left" is "before text" and "right" is "after text"
- nRight = CalcRightLine() +
- ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() ?
- rLR.GetLeft() :
- rLR.GetRight() );
+ if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
+ nRight += rLR.GetLeft();
+ else
+ nRight += rLR.GetRight();
return nRight;
}
long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
{
- // for paragraphs, "left" is "before text" and "right" is "after text"
- long nLeft = CalcLeftLine() +
- ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() ?
- rLR.GetRight() :
- rLR.GetLeft() );
+ long nLeft;
-#ifdef NUM_RELSPACE
- if ( pCaller->IsTxtFrm() )
- nLeft += ((SwTxtFrm*)pCaller)->GetTxtNode()->GetLeftMarginWithNum();
-#endif
- return nLeft;
-}
+ // 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();
-#else
+ // for paragraphs, "left" is "before text" and "right" is "after text"
+ if ( pCaller->IsTxtFrm() && pCaller->IsRightToLeft() )
+ nLeft += rLR.GetRight();
+ else
+ nLeft += rLR.GetLeft();
-long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
-{
- long nLeft = rLR.GetLeft() + CalcLeftLine();
-#ifdef NUM_RELSPACE
if ( pCaller->IsTxtFrm() )
nLeft += ((SwTxtFrm*)pCaller)->GetTxtNode()->GetLeftMarginWithNum();
-#endif
+
return nLeft;
}
-#endif
-
-
/*************************************************************************
|*
|* SwBorderAttrs::CalcTopLine(), CalcBottomLine(),
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 3bce18e8f25b..98a96d6bacac 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: hffrm.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: fme $ $Date: 2002-10-23 11:16:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -237,7 +237,8 @@ void SwHeadFootFrm::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
nUL = pAttrs->CalcBottom() + nSpace;
/* set print area */
- SwTwips nLR = pAttrs->CalcLeft(this) + pAttrs->CalcRight();
+ // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
+ SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
aPrt.Left(pAttrs->CalcLeft(this));
@@ -266,7 +267,8 @@ void SwHeadFootFrm::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
//Sizes einstellen; die Groesse gibt der umgebende Frm vor, die
//die Raender werden einfach abgezogen.
- SwTwips nLR = pAttrs->CalcLeft(this) + pAttrs->CalcRight();
+ // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
+ SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
aPrt.Width ( aFrm.Width() - nLR );
aPrt.Height( aFrm.Height()- nUL );
@@ -313,6 +315,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
}
nRemaining = 0;
pFrm = Lower();
+
while ( pFrm )
{
nRemaining += pFrm->Frm().Height();
@@ -372,6 +375,18 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
pTmpFrm->Prepare(PREP_ADJUST_FRM);
}
}
+ /* #i3568# Undersized sections need to be
+ invalidated too. */
+ else if (pFrm->IsSctFrm())
+ {
+ SwSectionFrm * pTmpFrm =
+ (SwSectionFrm*) pFrm;
+ if (pTmpFrm->IsUndersized() )
+ {
+ pTmpFrm->InvalidateSize();
+ pTmpFrm->Prepare(PREP_ADJUST_FRM);
+ }
+ }
pFrm = pFrm->GetNext();
}
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 125e76073ccd..2d52c361df48 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: layact.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: od $ $Date: 2002-11-15 10:46:47 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1536,13 +1536,21 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) )
{
SwRect aPaint( pLay->Frm() );
- // OD 11.11.2002 #104414# - not necessary to enlarge paint area
- /*
- aPaint.Pos().Y() -= 1;
- aPaint.Pos().X() -= 1;
- aPaint.SSize().Height() += 2;
- aPaint.SSize().Width() += 2;
- */
+ // OD 13.02.2003 #i9719#, #105645# - consider border and shadow for
+ // page frames -> enlarge paint rectangle correspondingly.
+ if ( pLay->IsPageFrm() )
+ {
+ SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
+ const nBorderWidth =
+ pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->BorderPxWidth(), 0 ) ).Width();
+ const nShadowWidth =
+ pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->ShadowPxWidth(), 0 ) ).Width();
+ aPaint.Left( aPaint.Left() - nBorderWidth );
+ aPaint.Top( aPaint.Top() - nBorderWidth );
+ aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth );
+ aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth );
+ }
+
if ( pLay->IsPageFrm() &&
pLay->GetFmt()->GetDoc()->IsBrowseMode() )
{
@@ -1567,22 +1575,6 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
pImp->GetShell()->AddPaintRect( aRegion[i] );
}
- //ggf. die Zwischenraeume mit invalidieren.
- if ( pLay->GetPrev() )
- {
- SwRect aTmp( aPaint );
- long nTmp = aTmp.Top() - DOCUMENTBORDER/2;
- if ( nTmp >= 0 )
- aTmp.Top( nTmp );
- aTmp.Bottom( pLay->Frm().Top() );
- pImp->GetShell()->AddPaintRect( aTmp );
- }
- if ( pLay->GetNext() )
- {
- aPaint.Bottom( aPaint.Bottom() + DOCUMENTBORDER/2 );
- aPaint.Top( pLay->Frm().Bottom() );
- pImp->GetShell()->AddPaintRect( aPaint );
- }
}
else
{
@@ -1591,6 +1583,29 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
// OD 11.11.2002 #104414# - remember frame at complete paint
aFrmAtCompletePaint = pLay->Frm();
}
+
+ // OD 13.02.2003 #i9719#, #105645# - provide paint of spacing
+ // between pages (not only for in online mode).
+ if ( pLay->IsPageFrm() )
+ {
+ if ( pLay->GetPrev() )
+ {
+ SwRect aSpaceToPrevPage( pLay->Frm() );
+ SwTwips nTop = aSpaceToPrevPage.Top() - DOCUMENTBORDER/2;
+ if ( nTop >= 0 )
+ aSpaceToPrevPage.Top( nTop );
+ aSpaceToPrevPage.Bottom( pLay->Frm().Top() );
+ pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
+ }
+ if ( pLay->GetNext() )
+ {
+ SwRect aSpaceToNextPage( pLay->Frm() );
+ aSpaceToNextPage.Bottom( aSpaceToNextPage.Bottom() + DOCUMENTBORDER/2 );
+ aSpaceToNextPage.Top( pLay->Frm().Bottom() );
+ pImp->GetShell()->AddPaintRect( aSpaceToNextPage );
+ }
+ }
+
}
pLay->ResetCompletePaint();
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 3fd57b8fbbf1..1fc5e788d781 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pagechg.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: od $ $Date: 2002-11-01 11:10:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -341,6 +341,11 @@ SwPageFrm::~SwPageFrm()
pImp->SetFirstVisPageInvalid();
if ( pImp->IsAction() )
pImp->GetLayAction().SetAgain();
+ // OD 12.02.2003 #i9719#, #105645# - retouche area of page
+ // including border and shadow area.
+ SwRect aRetoucheRect;
+ GetBorderAndShadowBoundRect( Frm(), pSh, aRetoucheRect );
+ pSh->AddPaintRect( aRetoucheRect );
}
}
}
@@ -636,7 +641,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
/* kein break hier */
case RES_FRM_SIZE:
{
- const SwRect aOldRect( Frm() );
+ const SwRect aOldPageFrmRect( Frm() );
if ( GetFmt()->GetDoc()->IsBrowseMode() )
{
bValidSize = FALSE;
@@ -659,14 +664,20 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
Frm().Height( Max( rSz.GetHeight(), long(MINLAY) ) );
Frm().Width ( Max( rSz.GetWidth(), long(MINLAY) ) );
- AdjustRootSize( CHG_CHGPAGE, &aOldRect );
+ AdjustRootSize( CHG_CHGPAGE, &aOldPageFrmRect );
}
//Window aufraeumen.
ViewShell *pSh;
- if ( 0 != (pSh = GetShell()) && pSh->GetWin() && aOldRect.HasArea() )
- pSh->InvalidateWindows( aOldRect );
+ if ( 0 != (pSh = GetShell()) && pSh->GetWin() && aOldPageFrmRect.HasArea() )
+ {
+ // OD 12.02.2003 #i9719#, #105645# - consider border and shadow of
+ // page frame for determine 'old' rectangle - it's used for invalidating.
+ SwRect aOldRectWithBorderAndShadow;
+ GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, aOldRectWithBorderAndShadow );
+ pSh->InvalidateWindows( aOldRectWithBorderAndShadow );
+ }
rInvFlags |= 0x03;
- if ( aOldRect.Height() != Frm().Height() )
+ if ( aOldPageFrmRect.Height() != Frm().Height() )
rInvFlags |= 0x04;
}
break;
@@ -1886,7 +1897,8 @@ void SwRootFrm::ImplCalcBrowseWidth()
switch ( rHori.GetHoriOrient() )
{
case HORI_NONE:
- nWidth += rAttrs.CalcLeft( pFrm ) + rAttrs.CalcRight();
+ // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)>
+ nWidth += rAttrs.CalcLeft( pFrm ) + rAttrs.CalcRight( pFrm );
break;
case HORI_LEFT_AND_WIDTH:
nWidth += rAttrs.CalcLeft( pFrm );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ed0cae1bf92f..d8d2ba18fddc 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: paintfrm.cxx,v $
*
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
- * last change: $Author: od $ $Date: 2002-12-10 14:24:00 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -209,6 +209,14 @@
#ifndef _ACCESSIBILITYOPTIONS_HXX
#include <accessibilityoptions.hxx>
#endif
+// OD 20.12.2002 #94627#
+#ifndef _DOCSH_HXX
+#include <docsh.hxx>
+#endif
+// OD 28.02.2003 #b4779636#, #107692#
+#ifndef _SWTABLE_HXX
+#include <swtable.hxx>
+#endif
#define GETOBJSHELL() ((SfxObjectShell*)rSh.GetDoc()->GetDocShell())
@@ -298,12 +306,6 @@ public:
static ViewShell *pGlobalShell = 0;
-/// OD 05.09.2002 #102912# - <bPageOnly> no longer needed
-/*
-//Fuer PaintBackground, eigentlich lokal, aber fuer SwSavePaintStatics jetzt global
-static FASTBOOL bPageOnly = FALSE;
-*/
-
//Wenn durchsichtige FlyInCnts im PaintBackground gepainted werden so soll der
//Hintergrund nicht mehr retouchiert werden.
//static FASTBOOL bLockFlyBackground = FALSE;
@@ -411,13 +413,10 @@ public:
};
SwSavePaintStatics::SwSavePaintStatics() :
-// bSLockFlyBackground ( bLockFlyBackground),
bSFlyMetafile ( bFlyMetafile ),
bSPixelHeightOdd ( bPixelHeightOdd ),
bSPixelWidthOdd ( bPixelWidthOdd ),
bSOneBeepOnly ( bOneBeepOnly ),
-/// OD 05.09.2002 #102912# - <bPageOnly> no longer needed
-// bSPageOnly ( bPageOnly ),
pSGlobalShell ( pGlobalShell ),
pSFlyMetafileOut ( pFlyMetafileOut ),
pSRetoucheFly ( pRetoucheFly ),
@@ -436,8 +435,7 @@ SwSavePaintStatics::SwSavePaintStatics() :
aSScaleX ( aScaleX ),
aSScaleY ( aScaleY )
{
- /// OD 05.09.2002 #102912# - <bPageOnly> no longer needed
- /*bPageOnly = *//*bLockFlyBackground = */bFlyMetafile = FALSE;
+ bFlyMetafile = FALSE;
pFlyMetafileOut = 0;
pRetoucheFly = 0;
pRetoucheFly2 = 0;
@@ -455,14 +453,11 @@ SwSavePaintStatics::SwSavePaintStatics() :
SwSavePaintStatics::~SwSavePaintStatics()
{
-// bLockFlyBackground = bSLockFlyBackground;
pGlobalShell = pSGlobalShell;
bFlyMetafile = bSFlyMetafile;
bPixelHeightOdd = bSPixelHeightOdd;
bPixelWidthOdd = bSPixelWidthOdd;
bOneBeepOnly = bSOneBeepOnly;
-/// OD 05.09.2002 #102912# - <bPageOnly> no longer needed
-// bPageOnly = bSPageOnly;
pFlyMetafileOut = pSFlyMetafileOut;
pRetoucheFly = pSRetoucheFly;
pRetoucheFly2 = pSRetoucheFly2;
@@ -742,7 +737,10 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
// an <insert> may destroy the object due to a necessary array resize.
const SwLineRect aSubsLineRect = SwLineRect( operator[](i) );
- if ( aSubsLineRect.IsPainted() )
+ // OD 19.12.2002 #106318# - add condition <aSubsLineRect.IsLocked()>
+ // in order to consider only border lines, which are *not* locked.
+ if ( aSubsLineRect.IsPainted() ||
+ aSubsLineRect.IsLocked() )
continue;
const bool bVerticalSubs = aSubsLineRect.Height() > aSubsLineRect.Width();
@@ -761,6 +759,12 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
{
SwLineRect &rLine = rRects[k];
+ // OD 20.12.2002 #106318# - do *not* consider painted or locked
+ // border lines.
+ // OD 20.01.2003 #i1837# - locked border lines have to be considered.
+ if ( rLine.IsLocked () )
+ continue;
+
if ( !bVerticalSubs == rLine.Height() > rLine.Width() ) //gleiche Ausrichtung?
continue;
@@ -996,10 +1000,24 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
{
pOut->Push( PUSH_FILLCOLOR );
+ // OD 14.01.2003 #106660# - reset draw mode in high contrast
+ // mode in order to get fill color set at output device.
+ // Recover draw mode after draw of lines.
+ // Necessary for the subsidiary lines painted by the fly frames.
+ ULONG nOldDrawMode = pOut->GetDrawMode();
+ if( pGlobalShell->GetWin() &&
+ Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ pOut->SetDrawMode( 0 );
+ }
+
for ( USHORT i = 0; i < Count(); ++i )
{
SwLineRect &rLRect = operator[](i);
- if ( !rLRect.IsPainted() )
+ // OD 19.12.2002 #106318# - add condition <!rLRect.IsLocked()>
+ // to prevent paint of locked subsidiary lines.
+ if ( !rLRect.IsPainted() &&
+ !rLRect.IsLocked() )
{
const Color *pCol;
switch ( rLRect.GetSubColor() )
@@ -1010,12 +1028,18 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
case SUBCOL_SECT: pCol = &SwViewOption::GetSectionBoundColor(); break;
case SUBCOL_BREAK: pCol = &SwViewOption::GetPageBreakColor(); break;
}
+
if ( pOut->GetFillColor() != *pCol )
pOut->SetFillColor( *pCol );
pOut->DrawRect( rLRect.SVRect() );
+
rLRect.SetPainted();
}
}
+
+ // OD 14.01.2003 #106660# - recovering draw mode
+ pOut->SetDrawMode( nOldDrawMode );
+
pOut->Pop();
}
}
@@ -1024,6 +1048,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
//-------------------------------------------------------------------------
//Diverse Functions die in diesem File so verwendet werden.
+// OD 20.02.2003 - Note: function <SwAlignRect(..)> also used outside this file.
void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh )
{
if( !rRect.HasArea() )
@@ -1158,7 +1183,15 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
const SwBorderAttrs &rAttrs,
const BOOL bShadow )
{
- if( pFrm->IsSctFrm() )
+ // OD 23.01.2003 #106386# - special handling for cell frames.
+ // The printing area of a cell frame is completely enclosed in the frame area
+ // and a cell frame has no shadow. Thus, for cell frames the calculated
+ // area equals the frame area.
+ // Notes: Borders of cell frames in R2L text direction will switch its side
+ // - left border is painted on the right; right border on the left.
+ // See <lcl_PaintLeftLine> and <lcl_PaintRightLine>.
+ if( pFrm->IsSctFrm() ||
+ pFrm->IsCellFrm() )
rRect = pFrm->Frm();
else
{
@@ -1176,7 +1209,9 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
SwTwips nDiff = rBox.GetTop() ?
rBox.CalcLineSpace( BOX_LINE_TOP ) :
( rAttrs.IsBorderDist() ?
- rBox.GetDistance( BOX_LINE_TOP ) + 1 : 0 );
+ // OD 23.01.2003 #106386# - increase of distance by
+ // one twip is incorrect.
+ rBox.GetDistance( BOX_LINE_TOP ) : 0 );
if( nDiff )
(rRect.*fnRect->fnSubTop)( nDiff );
}
@@ -1187,20 +1222,24 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
SwTwips nDiff = rBox.GetBottom() ?
rBox.CalcLineSpace( BOX_LINE_BOTTOM ) :
( rAttrs.IsBorderDist() ?
- rBox.GetDistance( BOX_LINE_BOTTOM ) + 1 : 0 );
+ // OD 23.01.2003 #106386# - increase of distance by
+ // one twip is incorrect.
+ rBox.GetDistance( BOX_LINE_BOTTOM ) : 0 );
if( nDiff )
(rRect.*fnRect->fnAddBottom)( nDiff );
}
if ( rBox.GetLeft() )
- (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace(BOX_LINE_LEFT) );
+ (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace( BOX_LINE_LEFT ) );
else if ( rAttrs.IsBorderDist() )
- (rRect.*fnRect->fnSubLeft)(rBox.GetDistance( BOX_LINE_LEFT )+1);
+ // OD 23.01.2003 #106386# - increase of distance by one twip is incorrect.
+ (rRect.*fnRect->fnSubLeft)( rBox.GetDistance( BOX_LINE_LEFT ) );
if ( rBox.GetRight() )
- (rRect.*fnRect->fnAddRight)(rBox.CalcLineSpace(BOX_LINE_RIGHT));
+ (rRect.*fnRect->fnAddRight)( rBox.CalcLineSpace( BOX_LINE_RIGHT ) );
else if ( rAttrs.IsBorderDist() )
- (rRect.*fnRect->fnAddRight)(rBox.GetDistance(BOX_LINE_RIGHT)+1);
+ // OD 23.01.2003 #106386# - increase of distance by one twip is incorrect.
+ (rRect.*fnRect->fnAddRight)( rBox.GetDistance( BOX_LINE_RIGHT ) );
if ( bShadow && rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE )
{
@@ -1407,32 +1446,6 @@ inline FASTBOOL IsShortCut( const SwRect &rRect, const SwRect &rFrmRect )
(rFrmRect.Left() > rRect.Right()) );
}
-
-void lcl_PaintShadow( const SwRect& aFrm, ViewShell* pSh )
-{
- const Color& rColor = SwViewOption::GetFontColor();
- Color aFill( pSh->GetOut()->GetFillColor() );
- Color aLine( pSh->GetOut()->GetLineColor() );
- pSh->GetOut()->SetFillColor( Color( COL_TRANSPARENT ) );
- pSh->GetOut()->SetLineColor( rColor );
- Rectangle aPageRect( aFrm.SVRect() );
- pSh->GetOut()->DrawRect( aPageRect );
- aPageRect = pSh->GetOut()->LogicToPixel( aPageRect );
- Rectangle aShadow( aPageRect.Left()+2, aPageRect.Bottom()+1,
- aPageRect.Right()+2, aPageRect.Bottom()+2 );
- pSh->GetOut()->SetFillColor( rColor );
- aShadow = pSh->GetOut()->PixelToLogic( aShadow );
- pSh->GetOut()->DrawRect( aShadow );
- aShadow.Left() = aPageRect.Right() + 1;
- aShadow.Right() = aShadow.Left() + 1;
- aShadow.Top() = aPageRect.Top() + 2;
- aShadow.Bottom() = aPageRect.Bottom();
- aShadow = pSh->GetOut()->PixelToLogic( aShadow );
- pSh->GetOut()->DrawRect( aShadow );
- pSh->GetOut()->SetFillColor( aFill );
- pSh->GetOut()->SetLineColor( aLine );
-}
-
//---------------- Ausgabe fuer das BrushItem ----------------
/** lcl_DrawGraphicBackgrd - local help method to draw a background for a graphic
@@ -2122,8 +2135,17 @@ void SwRootFrm::Paint( const SwRect& rRect ) const
}
pPage->Paint( aPaintRect );
- if( pSh->GetWin() )
- lcl_PaintShadow( pPage->Frm(), pSh );
+
+ // OD 20.12.2002 #94627# - no paint of page border and shadow, if
+ // writer is in place mode.
+ if( pSh->GetWin() &&
+ !pSh->GetDoc()->GetDocShell()->GetProtocol().IsInPlaceActive() )
+ {
+ // OD 12.02.2003 #i9719#, #105645# - use new method
+ // <SwPageFrm::PaintBorderAndShadow(..)>.
+ pPage->PaintBorderAndShadow( pPage->Frm(), pSh );
+ }
+
pLines->PaintLines( pSh->GetOut() );
BOOL bControlExtra = FALSE;
@@ -2311,7 +2333,7 @@ void SwLayoutFrm::Paint( const SwRect& rRect ) const
if ( pFrm->IsRetoucheFrm() && bWin && !pFrm->GetNext() )
{ if ( !pPage )
pPage = FindPageFrm();
- pFrm->Retouche( pPage, rRect );
+ pFrm->Retouche( pPage, rRect );
}
pFrm->ResetRetouche();
}
@@ -2579,10 +2601,10 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
SwRect aRect( rRect );
aRect._Intersection( Frm() );
- OutputDevice *pOut = pGlobalShell->GetOut();
+ OutputDevice* pOut = pGlobalShell->GetOut();
pOut->Push( PUSH_CLIPREGION );
pOut->SetClipRegion();
- const SwPageFrm *pPage = FindPageFrm();
+ const SwPageFrm* pPage = FindPageFrm();
const SwNoTxtFrm *pNoTxt = Lower() && Lower()->IsNoTxtFrm()
? (SwNoTxtFrm*)Lower() : 0;
@@ -2640,31 +2662,14 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this );
const SwBorderAttrs &rAttrs = *aAccess.Get();
-/* //Das Paint der FlyInCnt's wird vom Paint der Lines gerufen. Damit
- //der Rand (UL-/LRSpace) mit der richtigen Farbe retouchiert wird,
- //muss Das Paint an den Anker weitergereicht werden.
- FASTBOOL bUnlock = FALSE;
- if ( IsFlyInCntFrm() )
- {
- bLockFlyBackground = bUnlock = TRUE;
- SwBorderAttrAccess aAccess( SwFrm::GetCache(), GetAnchor());
- const SwBorderAttrs &rAttrs = *aAccess.Get();
- GetAnchor()->PaintBackground( aRect, pPage, rAttrs, FALSE );
- }
-*/
-
- /// OD 06.08.2002 #99657# - paint border before painting background
- /// paint border
+ // OD 06.08.2002 #99657# - paint border before painting background
+ // paint border
{
SwRect aTmp( rRect );
-//?? aTmp._Intersection( Frm() );
PaintBorder( aTmp, pPage, rAttrs );
-/* if ( bUnlock )
- bLockFlyBackground = FALSE;
-*/
}
- /// paint background
+ // paint background
{
SwRegionRects aRegion( aRect );
if ( pNoTxt && !bIsGraphicTransparent )
@@ -2694,11 +2699,65 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
}
}
+ // OD 19.12.2002 #106318# - fly frame will paint it's subsidiary lines and
+ // the subsidiary lines of its lowers on its own, due to overlapping with
+ // other fly frames or other objects.
+ if( pGlobalShell->GetWin() )
+ {
+ bool bSubsLineRectsCreated;
+ if ( pSubsLines )
+ {
+ // Lock already existing subsidiary lines
+ pSubsLines->LockLines( TRUE );
+ bSubsLineRectsCreated = false;
+ }
+ else
+ {
+ // create new subsidiardy lines
+ pSubsLines = new SwSubsRects;
+ bSubsLineRectsCreated = true;
+ }
+
+ bool bSpecSubsLineRectsCreated;
+ if ( pSpecSubsLines )
+ {
+ // Lock already existing special subsidiary lines
+ pSpecSubsLines->LockLines( TRUE );
+ bSpecSubsLineRectsCreated = false;
+ }
+ else
+ {
+ // create new special subsidiardy lines
+ pSpecSubsLines = new SwSubsRects;
+ bSpecSubsLineRectsCreated = true;
+ }
+ // Add subsidiary lines of fly frame and its lowers
+ RefreshLaySubsidiary( pPage, aRect );
+ // paint subsidiary lines of fly frame and its lowers
+ pSpecSubsLines->PaintSubsidiary( pOut, NULL );
+ pSubsLines->PaintSubsidiary( pOut, pLines );
+ if ( !bSubsLineRectsCreated )
+ // unlock subsidiary lines
+ pSubsLines->LockLines( FALSE );
+ else
+ // delete created subsidiary lines container
+ DELETEZ( pSubsLines );
+
+ if ( !bSpecSubsLineRectsCreated )
+ // unlock special subsidiary lines
+ pSpecSubsLines->LockLines( FALSE );
+ else
+ // delete created special subsidiary lines container
+ DELETEZ( pSpecSubsLines );
+ }
+
SwLayoutFrm::Paint( aRect );
Validate();
- pLines->LockLines( FALSE );
+ // OD 19.12.2002 #106318# - first paint lines added by fly frame paint
+ // and then unlock other lines.
pLines->PaintLines( pOut );
+ pLines->LockLines( FALSE );
pOut->Pop();
@@ -2716,12 +2775,20 @@ void SwFlyFrm::Paint( const SwRect& rRect ) const
void SwTabFrm::Paint( const SwRect& rRect ) const
{
- if( pGlobalShell->GetViewOptions()->IsTable() )
+ if ( pGlobalShell->GetViewOptions()->IsTable() )
+ {
SwLayoutFrm::Paint( rRect );
- else if( pGlobalShell->GetWin() )
+ }
+ // OD 10.01.2003 #i6467# - no light grey rectangle for page preview
+ else if ( pGlobalShell->GetWin() && !pGlobalShell->IsPreView() )
{
+ // OD 10.01.2003 #i6467# - intersect output rectangle with table frame
+ SwRect aTabRect( Prt() );
+ aTabRect.Pos() += Frm().Pos();
+ SwRect aTabOutRect( rRect );
+ aTabOutRect.Intersection( aTabRect );
pGlobalShell->GetViewOptions()->
- DrawRect( pGlobalShell->GetOut(), rRect, COL_LIGHTGRAY );
+ DrawRect( pGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
}
((SwTabFrm*)this)->ResetComplete();
}
@@ -2922,12 +2989,12 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
{
SwRect &rOut = aRegion[i];
aOut = rOut;
- /// OD 30.09.2002 #103636# - no SwAlign of shadow rectangle
- /// no alignment necessary, because (1) <rRect> is already aligned
- /// and because (2) paint of border and background will occur later.
- /// Thus, (1) assures that no conflicts with neighbour object will occure
- /// and (2) assures that border and background is not affected by the
- /// shadow paint.
+ // OD 30.09.2002 #103636# - no SwAlign of shadow rectangle
+ // no alignment necessary, because (1) <rRect> is already aligned
+ // and because (2) paint of border and background will occur later.
+ // Thus, (1) assures that no conflicts with neighbour object will occure
+ // and (2) assures that border and background is not affected by the
+ // shadow paint.
/*
::SwAlignRect( aOut, pGlobalShell );
*/
@@ -3163,6 +3230,144 @@ void MA_FASTCALL lcl_PaintBottomLine( const SwFrm *pFrm, const SwPageFrm *pPage,
|*
|*************************************************************************/
+/** local method to determine cell frame, from which the border attributes
+ for paint of top/bottom border has to be used.
+
+ OD 21.02.2003 #b4779636#, #107692#
+
+ @author OD
+
+
+ @param _pCellFrm
+ input parameter - constant pointer to cell frame for which the cell frame
+ for the border attributes has to be determined.
+
+ @param _rCellBorderAttrs
+ input parameter - constant reference to the border attributes of cell frame
+ <_pCellFrm>.
+
+ @param _bTop
+ input parameter - boolean, that controls, if cell frame for top border or
+ for bottom border has to be determined.
+
+ @return constant pointer to cell frame, for which the border attributes has
+ to be used
+*/
+const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
+ const SwBorderAttrs& _rCellBorderAttrs,
+ const bool _bTop )
+{
+ // determine, if cell frame is at bottom/top border of a table frame and
+ // the table frame has/is a follow.
+ const SwFrm* pTmpFrm = _pCellFrm;
+ bool bCellAtBorder = true;
+ while( !pTmpFrm->IsRowFrm() || !pTmpFrm->GetUpper()->IsTabFrm() )
+ {
+ pTmpFrm = pTmpFrm->GetUpper();
+ if ( pTmpFrm->IsRowFrm() &&
+ (_bTop ? pTmpFrm->GetPrev() : pTmpFrm->GetNext())
+ )
+ {
+ bCellAtBorder = false;
+ }
+ }
+ ASSERT( pTmpFrm && pTmpFrm->IsRowFrm(), "No RowFrm available" );
+
+ const SwLayoutFrm* pParentRowFrm = static_cast<const SwLayoutFrm*>(pTmpFrm);
+ const SwTabFrm* pParentTabFrm =
+ static_cast<const SwTabFrm*>(pParentRowFrm->GetUpper());
+
+ const bool bCellNeedsAttribute = bCellAtBorder &&
+ ( _bTop ?
+ // bCellInFirstRowWithMaster
+ ( !pParentRowFrm->GetPrev() &&
+ pParentTabFrm->IsFollow() &&
+ !pParentTabFrm->GetTable()->IsHeadlineRepeat() ) :
+ // bCellInLastRowWithFollow
+ ( !pParentRowFrm->GetNext() &&
+ pParentTabFrm->GetFollow() )
+ );
+
+ const SwFrm* pRet = _pCellFrm;
+ if ( bCellNeedsAttribute )
+ {
+ // determine, if cell frame has no borders inside the table.
+ const SvxBoxItem aBorderBox = _rCellBorderAttrs.GetBox();
+ const bool bNoBordersInside =
+ ( !aBorderBox.GetTop() || !pParentRowFrm->GetPrev() ) &&
+ ( !aBorderBox.GetLeft() || !_pCellFrm->GetPrev() ) &&
+ ( !aBorderBox.GetRight() || !_pCellFrm->GetNext() ) &&
+ ( !aBorderBox.GetBottom() || !pParentRowFrm->GetNext() );
+
+ if ( bNoBordersInside )
+ {
+ if ( _bTop && !_rCellBorderAttrs.GetBox().GetTop() )
+ {
+ // #b4779636#-hack:
+ // Cell frame has no top border and no border inside the table, but
+ // it is at the top border of a table frame, which is a follow.
+ // Thus, use border attributes of cell frame in first row of complete table.
+ // First, determine first table frame of complete table.
+ SwTabFrm* pMasterTabFrm = const_cast<SwTabFrm*>(pParentTabFrm->FindMaster());
+ while ( pMasterTabFrm->IsFollow() )
+ {
+ pMasterTabFrm = pMasterTabFrm->FindMaster();
+ }
+ // determine first row of complete table.
+ const SwFrm* pFirstRow = pMasterTabFrm->GetLower();
+ // return first cell in first row
+ SwFrm* pTmpFrm = const_cast<SwFrm*>(pFirstRow->GetLower());
+ while ( !pTmpFrm->IsCellFrm() ||
+ ( pTmpFrm->GetLower() && pTmpFrm->GetLower()->IsLayoutFrm() )
+ )
+ {
+ pTmpFrm = pTmpFrm->GetLower();
+ }
+ ASSERT( pTmpFrm && pTmpFrm->IsCellFrm(), "No CellFrm available" );
+ pRet = pTmpFrm;
+ }
+ else if ( !_bTop && !_rCellBorderAttrs.GetBox().GetBottom() )
+ {
+ // #b4779636#-hack:
+ // Cell frame has no bottom border and no border inside the table,
+ // but it is at the bottom border of a table frame, which has a follow.
+ // Thus, use border attributes of cell frame in last row of complete table.
+ // First, determine last table frame of complete table.
+ SwTabFrm* pLastTabFrm = const_cast<SwTabFrm*>(pParentTabFrm->GetFollow());
+ while ( pLastTabFrm->GetFollow() )
+ {
+ pLastTabFrm = pLastTabFrm->GetFollow();
+ }
+ // determine last row of complete table.
+ SwFrm* pLastRow = pLastTabFrm->GetLower();
+ while ( pLastRow->GetNext() )
+ {
+ pLastRow = pLastRow->GetNext();
+ }
+ // return first bottom border cell in last row
+ SwFrm* pTmpFrm = const_cast<SwFrm*>(pLastRow->GetLower());
+ while ( !pTmpFrm->IsCellFrm() ||
+ ( pTmpFrm->GetLower() && pTmpFrm->GetLower()->IsLayoutFrm() )
+ )
+ {
+ if ( pTmpFrm->IsRowFrm() )
+ {
+ while ( pTmpFrm->GetNext() )
+ {
+ pTmpFrm = pTmpFrm->GetNext();
+ }
+ }
+ pTmpFrm = pTmpFrm->GetLower();
+ }
+ ASSERT( pTmpFrm && pTmpFrm->IsCellFrm(), "No CellFrm available" );
+ pRet = pTmpFrm;
+ }
+ }
+ }
+
+ return pRet;
+}
+
void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
const SwBorderAttrs &rAttrs ) const
{
@@ -3175,9 +3380,29 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
!pGlobalShell->GetViewOptions()->IsTable() )
return;
- const FASTBOOL bLine = rAttrs.IsLine();
- const FASTBOOL bShadow = rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE;
- if ( bLine || bShadow )
+ const bool bLine = rAttrs.IsLine() ? true : false;
+ const bool bShadow = rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE;
+
+ // OD 24.02.2003 #b4779636#, #107692# - flag to control,
+ // if #b4779636#-hack has to be used.
+ const bool bb4779636HackActive = true;
+ // OD 21.02.2003 #b4779636#, #107692#
+ const SwFrm* pCellFrmForBottomBorderAttrs = 0;
+ const SwFrm* pCellFrmForTopBorderAttrs = 0;
+ bool bFoundCellForTopOrBorderAttrs = false;
+ if ( bb4779636HackActive && IsCellFrm() )
+ {
+ pCellFrmForBottomBorderAttrs = lcl_GetCellFrmForBorderAttrs( this, rAttrs, false );
+ if ( pCellFrmForBottomBorderAttrs != this )
+ bFoundCellForTopOrBorderAttrs = true;
+ pCellFrmForTopBorderAttrs = lcl_GetCellFrmForBorderAttrs( this, rAttrs, true );
+ if ( pCellFrmForTopBorderAttrs != this )
+ bFoundCellForTopOrBorderAttrs = true;
+ }
+
+ // OD 24.02.2003 #b4779636#, #107692# - add condition <bFoundCellForTopOrBorderAttrs>
+ // for #b4779636#-hack
+ if ( bLine || bShadow || bFoundCellForTopOrBorderAttrs )
{
//Wenn das Rechteck vollstandig innerhalb der PrtArea liegt,
//so braucht kein Rand gepainted werden.
@@ -3186,21 +3411,21 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
SwRect aRect( Prt() );
aRect += Frm().Pos();
::SwAlignRect( aRect, pGlobalShell );
- /// OD 27.09.2002 #103636# - new local boolean variable in order to
- /// suspend border paint under special cases - see below.
- /// NOTE: This is a fix for the implementation of feature #99657#.
+ // OD 27.09.2002 #103636# - new local boolean variable in order to
+ // suspend border paint under special cases - see below.
+ // NOTE: This is a fix for the implementation of feature #99657#.
bool bDrawOnlyShadowForTransparentFrame = false;
if ( aRect.IsInside( rRect ) )
{
- /// OD 27.09.2002 #103636# - paint shadow, if background is transparent.
- /// Because of introduced transparent background for fly frame #99657#,
- /// the shadow have to be drawn if the background is transparent,
- /// in spite the fact that the paint rectangle <rRect> lies fully
- /// in the printing area.
- /// NOTE to chosen solution:
- /// On transparent background, continue processing, but suspend
- /// drawing of border by setting <bDrawOnlyShadowForTransparentFrame>
- /// to true.
+ // OD 27.09.2002 #103636# - paint shadow, if background is transparent.
+ // Because of introduced transparent background for fly frame #99657#,
+ // the shadow have to be drawn if the background is transparent,
+ // in spite the fact that the paint rectangle <rRect> lies fully
+ // in the printing area.
+ // NOTE to chosen solution:
+ // On transparent background, continue processing, but suspend
+ // drawing of border by setting <bDrawOnlyShadowForTransparentFrame>
+ // to true.
if ( IsLayoutFrm() &&
static_cast<const SwLayoutFrm*>(this)->GetFmt()->IsBackgroundTransparent() )
{
@@ -3219,17 +3444,50 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
rAttrs.SetGetCacheLine( TRUE );
if ( bShadow )
PaintShadow( rRect, aRect, pPage, rAttrs );
- /// OD 27.09.2002 #103636# - suspend drawing of border
- /// add condition < NOT bDrawOnlyShadowForTransparentFrame > - see above
- if ( bLine && !bDrawOnlyShadowForTransparentFrame )
+ // OD 27.09.2002 #103636# - suspend drawing of border
+ // add condition < NOT bDrawOnlyShadowForTransparentFrame > - see above
+ // OD 24.02.2003 #b4779636#, #107692# - add condition <bFoundCellForTopOrBorderAttrs>
+ // for #b4779636#-hack.
+ if ( ( bLine || bFoundCellForTopOrBorderAttrs ) &&
+ !bDrawOnlyShadowForTransparentFrame )
{
SWRECTFN( this )
::lcl_PaintLeftLine ( this, pPage, aRect, rRect, rAttrs, fnRect );
::lcl_PaintRightLine ( this, pPage, aRect, rRect, rAttrs, fnRect );
if ( !IsCntntFrm() || rAttrs.GetTopLine( this ) )
- ::lcl_PaintTopLine( this, pPage, aRect, rRect, rAttrs, fnRect );
+ {
+ // OD 21.02.2003 #b4779636#, #107692# -
+ // #b4779636#-hack: If another cell frame for top border
+ // paint is found, paint its top border.
+ if ( IsCellFrm() && pCellFrmForTopBorderAttrs != this )
+ {
+ SwBorderAttrAccess aAccess( SwFrm::GetCache(),
+ pCellFrmForTopBorderAttrs );
+ const SwBorderAttrs &rTopAttrs = *aAccess.Get();
+ ::lcl_PaintTopLine( this, pPage, aRect, rRect, rTopAttrs, fnRect );
+ }
+ else
+ {
+ ::lcl_PaintTopLine( this, pPage, aRect, rRect, rAttrs, fnRect );
+ }
+ }
if ( !IsCntntFrm() || rAttrs.GetBottomLine( this ) )
- ::lcl_PaintBottomLine(this, pPage, aRect, rRect, rAttrs,fnRect);
+ {
+ // OD 21.02.2003 #b4779636#, #107692# -
+ // #b4779636#-hack: If another cell frame for bottom border
+ // paint is found, paint its bottom border.
+ if ( IsCellFrm() && pCellFrmForBottomBorderAttrs != this )
+ {
+ SwBorderAttrAccess aAccess( SwFrm::GetCache(),
+ pCellFrmForBottomBorderAttrs );
+ const SwBorderAttrs &rBottomAttrs = *aAccess.Get();
+ ::lcl_PaintBottomLine(this, pPage, aRect, rRect, rBottomAttrs, fnRect);
+ }
+ else
+ {
+ ::lcl_PaintBottomLine(this, pPage, aRect, rRect, rAttrs, fnRect);
+ }
+ }
}
rAttrs.SetGetCacheLine( FALSE );
}
@@ -3379,7 +3637,7 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const
{
SwRect aGrid( pBody->Prt() );
aGrid += pBody->Frm().Pos();
- // ::SwAlignRect( aGrid, pGlobalShell );
+
SwRect aInter( aGrid );
aInter.Intersection( rRect );
if( aInter.HasArea() )
@@ -3712,6 +3970,149 @@ 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
+*/
+void SwPageFrm::GetBorderRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBorderRect ) const
+{
+ 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;
+
+ _orBorderRect =
+ SwRect( _pViewShell->GetOut()->PixelToLogic( aBorderPxRect ) );
+}
+
+/** determine rectangle for right page shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ @author OD
+*/
+void SwPageFrm::GetRightShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orRightShadowRect ) const
+{
+ SwRect aAlignedPageRect( _rPageRect );
+ SwAlignRect( aAlignedPageRect, _pViewShell );
+ Rectangle aPagePxRect =
+ _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+
+ Rectangle aRightShadowPxRect(
+ aPagePxRect.Right() + mnShadowPxWidth,
+ aPagePxRect.Top() + 1,
+ aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
+ aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+
+ _orRightShadowRect =
+ SwRect( _pViewShell->GetOut()->PixelToLogic( aRightShadowPxRect ) );
+}
+
+/** determine rectangle for bottom page shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ @author OD
+*/
+void SwPageFrm::GetBottomShadowRect( const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBottomShadowRect ) const
+{
+ SwRect aAlignedPageRect( _rPageRect );
+ SwAlignRect( aAlignedPageRect, _pViewShell );
+ Rectangle aPagePxRect =
+ _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+
+ Rectangle aBottomShadowPxRect(
+ aPagePxRect.Left() + 1,
+ aPagePxRect.Bottom() + mnShadowPxWidth,
+ aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
+ aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
+
+ _orBottomShadowRect =
+ SwRect( _pViewShell->GetOut()->PixelToLogic( aBottomShadowPxRect ) );
+}
+
+/** paint page border and shadow
+
+ OD 12.02.2003 for #i9719# and #105645#
+ implement paint of page border and shadow
+
+ @author OD
+*/
+void SwPageFrm::PaintBorderAndShadow( const SwRect& _rPageRect,
+ ViewShell* _pViewShell ) const
+{
+ // get color for page border and shadow paint
+ const Color& rColor = SwViewOption::GetFontColor();
+
+ // save current fill and line color of output device
+ Color aFill( _pViewShell->GetOut()->GetFillColor() );
+ Color aLine( _pViewShell->GetOut()->GetLineColor() );
+
+ // paint page border
+ _pViewShell->GetOut()->SetFillColor(); // OD 20.02.2003 #107369# - no fill color
+ _pViewShell->GetOut()->SetLineColor( rColor );
+ SwRect aPaintRect;
+ GetBorderRect( _rPageRect, _pViewShell, aPaintRect );
+ _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+
+ // paint shadow
+ _pViewShell->GetOut()->SetFillColor( rColor );
+ GetRightShadowRect( _rPageRect, _pViewShell, aPaintRect );
+ _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+ GetBottomShadowRect( _rPageRect, _pViewShell, aPaintRect );
+ _pViewShell->GetOut()->DrawRect( aPaintRect.SVRect() );
+
+ _pViewShell->GetOut()->SetFillColor( aFill );
+ _pViewShell->GetOut()->SetLineColor( aLine );
+
+}
+
+/** get bound rectangle of border and shadow for repaints
+
+ OD 12.02.2003 for #i9719# and #105645#
+
+ author OD
+*/
+void SwPageFrm::GetBorderAndShadowBoundRect(
+ const SwRect& _rPageRect,
+ ViewShell* _pViewShell,
+ SwRect& _orBorderAndShadowBoundRect ) const
+{
+ SwRect aTmpRect;
+ GetBorderRect( _rPageRect, _pViewShell, _orBorderAndShadowBoundRect );
+ GetRightShadowRect( _rPageRect, _pViewShell, aTmpRect );
+ _orBorderAndShadowBoundRect.Union( aTmpRect );
+ GetBottomShadowRect( _rPageRect, _pViewShell, aTmpRect );
+ _orBorderAndShadowBoundRect.Union( aTmpRect );
+}
+
/*************************************************************************
|*
|* SwFrm::PaintBaBo()
@@ -3788,6 +4189,14 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const BOOL bLowerMode,
const BOOL bLowerBorder ) const
{
+ // OD 20.01.2003 #i1837# - no paint of table background, if corresponding
+ // option is *not* set.
+ if( IsTabFrm() &&
+ !pGlobalShell->GetViewOptions()->IsTable() )
+ {
+ return;
+ }
+
ViewShell *pSh = pGlobalShell;
const FASTBOOL bWin = pSh->GetWin() ? TRUE : FALSE;
const SvxBrushItem* pItem;
@@ -3804,19 +4213,34 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm();
if ( bNoFlyBackground )
{
- /// OD 05.09.2002 #102912# - Fly frame has no background.
- /// Try to find background brush at parents, if previous call of
- /// <GetBackgroundBrush> disabled this option with the parameter <bLowerMode>
+ // OD 05.09.2002 #102912# - Fly frame has no background.
+ // Try to find background brush at parents, if previous call of
+ // <GetBackgroundBrush> disabled this option with the parameter <bLowerMode>
if ( bLowerMode )
{
bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, false );
}
- /// If still no background found for the fly frame, initialize the
- /// background brush <pItem> with global retouche color and set <bBack>
- /// to TRUE, that fly frame will paint its background using this color.
+ // If still no background found for the fly frame, initialize the
+ // background brush <pItem> with global retouche color and set <bBack>
+ // to TRUE, that fly frame will paint its background using this color.
if ( !bBack )
{
- pTmpBackBrush = new SvxBrushItem( aGlobalRetoucheColor );
+ // OD 10.01.2003 #i6467# - on print output, pdf output and
+ // in embedded mode not editing color COL_WHITE is used instead of
+ // the global retouche color.
+ if ( pSh->GetOut()->GetOutDevType() == OUTDEV_PRINTER ||
+ pSh->GetViewOptions()->IsPDFExport() ||
+ ( pSh->GetDoc()->GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED &&
+ !pSh->GetDoc()->GetDocShell()->GetProtocol().IsInPlaceActive()
+ )
+ )
+ {
+ pTmpBackBrush = new SvxBrushItem( Color( COL_WHITE ) );
+ }
+ else
+ {
+ pTmpBackBrush = new SvxBrushItem( aGlobalRetoucheColor );
+ }
pItem = pTmpBackBrush;
bBack = true;
}
@@ -3950,7 +4374,9 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
if ( IS_SUBS || IS_SUBS_TABLE || IS_SUBS_SECTION || IS_SUBS_FLYS )
{
SwRect aRect( rRect );
- ::SwAlignRect( aRect, pGlobalShell );
+ // OD 18.02.2003 #104989# - Not necessary and incorrect alignment of
+ // the output rectangle.
+ //::SwAlignRect( aRect, pGlobalShell );
if ( aRect.HasArea() )
{
//Beim Paint ueber die Root wird das Array von dort gesteuert.
@@ -3959,30 +4385,20 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const
if ( !pSubsLines )
{
pSubsLines = new SwSubsRects;
+ // OD 20.12.2002 #106318# - create container for special subsidiary lines
+ pSpecSubsLines = new SwSubsRects;
bDelSubs = TRUE;
}
RefreshLaySubsidiary( this, aRect );
- if ( GetSortedObjs() )
- {
- const SwSortDrawObjs &rObjs = *GetSortedObjs();
- for ( USHORT i = 0; i < rObjs.Count(); ++i )
- {
- SdrObject *pO = rObjs[i];
- if ( pO->IsWriterFlyFrame() )
- {
- const SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
- if ( pFly->Frm().IsOver( aRect ) )
- {
- if ( !pFly->Lower() || !pFly->Lower()->IsNoTxtFrm() ||
- !((SwNoTxtFrm*)pFly->Lower())->HasAnimation())
- pFly->RefreshLaySubsidiary( this, aRect );
- }
- }
- }
- }
+
if ( bDelSubs )
{
+ // OD 20.12.2002 #106318# - paint special subsidiary lines
+ // and delete its container
+ pSpecSubsLines->PaintSubsidiary( pGlobalShell->GetOut(), NULL );
+ DELETEZ( pSpecSubsLines );
+
pSubsLines->PaintSubsidiary( pGlobalShell->GetOut(), pLines );
DELETEZ( pSubsLines );
}
@@ -4132,7 +4548,16 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
//Mir selbst weiche ich natuerlich nicht aus. Auch wenn ich
//_in_ dem Fly sitze weiche ich nicht aus.
if ( !pFly || (pFly == pLay || pFly->IsAnLower( pLay )) )
- { aIter.Next();
+ {
+ aIter.Next();
+ continue;
+ }
+
+ // OD 19.12.2002 #106318# - do *not* consider fly frames with
+ // a transparent background.
+ if ( pFly->IsBackgroundTransparent() )
+ {
+ aIter.Next();
continue;
}
@@ -4174,9 +4599,21 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
const bool bCell = IsCellFrm() ? true : false;
// use frame area for cells
- SwRect aOriginal( bCell ? Frm() : Prt() );
- if ( !bCell )
+ // OD 13.02.2003 #i3662# - for section use also frame area
+ const bool bUseFrmArea = bCell || IsSctFrm();
+ SwRect aOriginal( bUseFrmArea ? Frm() : Prt() );
+ if ( !bUseFrmArea )
aOriginal.Pos() += Frm().Pos();
+ // OD 13.02.2003 #i3662# - enlarge top of column body frame's printing area
+ // in sections to top of section frame.
+ const bool bColBodyInSection = IsBodyFrm() &&
+ !IsPageBodyFrm() &&
+ GetUpper()->GetUpper()->IsSctFrm();
+ if ( bColBodyInSection )
+ {
+ aOriginal.Top( GetUpper()->GetUpper()->Frm().Top() );
+ }
+
::SwAlignRect( aOriginal, pGlobalShell );
if ( !aOriginal.IsOver( rRect ) )
@@ -4184,7 +4621,13 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
SwRect aOut( aOriginal );
aOut._Intersection( rRect );
- aOut.Intersection( PaintArea() );
+ // OD 13.02.2003 #i3662# - do not intersect *enlarged* column body frame's
+ // printing area with the paint area of the body frame. Otherwise enlargement
+ // will get lost.
+ if ( !bColBodyInSection )
+ {
+ aOut.Intersection( PaintArea() );
+ }
const SwTwips nRight = aOut.Right();
const SwTwips nBottom= aOut.Bottom();
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index dfa982ed3942..d0ea64989fa7 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sectfrm.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: od $ $Date: 2002-11-15 11:00:24 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1214,6 +1214,13 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
//Inhalt selbst verantwortlich.
BOOL bMaximize = ToMaximize( FALSE );
+ // Column widths have to be adjusted before calling _CheckClipping.
+ // _CheckClipping can cause the formatting of the lower frames
+ // which still have a width of 0.
+ const sal_Bool bHasColumns = Lower() && Lower()->IsColumnFrm();
+ if ( bHasColumns && Lower()->GetNext() )
+ AdjustColumns( 0, FALSE );
+
if( GetUpper() )
{
long nWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
@@ -1228,13 +1235,8 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
}
//Breite der Spalten pruefen und ggf. einstellen.
- if ( Lower() && Lower()->IsColumnFrm() )
- {
- if( Lower()->GetNext() )
- AdjustColumns( 0, FALSE );
- else if( bMaximize )
- ((SwColumnFrm*)Lower())->Lower()->Calc();
- }
+ if ( bHasColumns && ! Lower()->GetNext() && bMaximize )
+ ((SwColumnFrm*)Lower())->Lower()->Calc();
if ( !bMaximize )
{
@@ -1674,7 +1676,12 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType eMakeFtn )
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
else if ( bBody && pLayLeaf->IsInDocBody() )
{
- if ( pLayLeaf->Lower() )
+ // If there is a pLayLeaf has a lower pLayLeaf is the frame we are looking for.
+ // Exception: pLayLeaf->Lower() is a zombie section frame
+ const SwFrm* pTmp = pLayLeaf->Lower();
+ if ( pTmp &&
+ ( ! pTmp->IsSctFrm() ||
+ ((SwSectionFrm*)pTmp)->GetSection() ) )
break;
pPrevLeaf = pLayLeaf;
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 5bbdf5d615f8..edbf5086c01a 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabfrm.cxx,v $
*
- * $Revision: 1.31 $
+ * $Revision: 1.32 $
*
- * last change: $Author: fme $ $Date: 2002-11-13 09:45:35 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -238,16 +238,11 @@ void SwTabFrm::RegistFlys()
|*************************************************************************/
SwTwips SwTabFrm::Split( const SwTwips nCutPos )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
ASSERT( bVert ? nCutPos >= Frm().Left()
&& nCutPos <= Frm().Left() + Frm().Width() :
nCutPos >= Frm().Top() && nCutPos <= Frm().Bottom(),
"SplitLine out of table." );
-#else
- ASSERT( nCutPos >= Frm().Top() && nCutPos <= Frm().Bottom(),
- "SplitLine ausserhalb der Tabelle." );
-#endif
//Um die Positionen der Zellen mit der CutPos zu vergleichen muessen sie
//ausgehend von der Tabelle nacheinander berechnet werden. Sie koennen
@@ -256,22 +251,14 @@ SwTwips SwTabFrm::Split( const SwTwips nCutPos )
SwFrm *pRow = Lower();
if( !pRow )
return 0;
-#ifdef VERTICAL_LAYOUT
SwTwips nCut = (*fnRect->fnYDiff)( nCutPos, (Frm().*fnRect->fnGetTop)() );
nCut -= (this->*fnRect->fnGetTopMargin)();
SwTwips nRowPos = (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- SwTwips nRowPos = Frm().Top() + Prt().Top() + pRow->Frm().Height();
-#endif
const BOOL bRepeat = GetTable()->IsHeadlineRepeat();
pRow = pRow->GetNext();
if( pRow && bRepeat )
{
-#ifdef VERTICAL_LAYOUT
nRowPos += (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- nRowPos += pRow->Frm().Height();
-#endif
pRow = pRow->GetNext();
}
// No break before the first row and, in case of repeated headlines,
@@ -279,15 +266,9 @@ SwTwips SwTabFrm::Split( const SwTwips nCutPos )
if( !pRow )
return 0;
-#ifdef VERTICAL_LAYOUT
while( pRow && nCut >= ( nRowPos + (pRow->Frm().*fnRect->fnGetHeight)() ) )
{
nRowPos += (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- while ( pRow && nCutPos > (nRowPos + pRow->Frm().Height() - 1) )
- {
- nRowPos += pRow->Frm().Height();
-#endif
pRow = pRow->GetNext();
}
@@ -354,11 +335,7 @@ SwTwips SwTabFrm::Split( const SwTwips nCutPos )
while ( pRow )
{
pNxt = pRow->GetNext();
-#ifdef VERTICAL_LAYOUT
nRet += (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- nRet += pRow->Frm().Height();
-#endif
pRow->Remove();
pRow->InsertBehind( pFoll, pPrv );
pRow->_InvalidateAll();
@@ -374,7 +351,6 @@ SwTwips SwTabFrm::Split( const SwTwips nCutPos )
while ( pRow )
{
pNxt = pRow->GetNext();
-#ifdef VERTICAL_LAYOUT
nRet += (pRow->Frm().*fnRect->fnGetHeight)();
pRow->Remove();
pRow->Paste( pFoll, pPrv );
@@ -385,16 +361,6 @@ SwTwips SwTabFrm::Split( const SwTwips nCutPos )
ASSERT( !bNewFollow || !(pFoll->Frm().*fnRect->fnGetHeight)(),
"Dont care about Performance");
Shrink( nRet );
-#else
- nRet += pRow->Frm().Height();
- pRow->Remove();
- pRow->Paste( pFoll, pPrv );
- pRow = pNxt;
- }
- }
- ASSERT( !bNewFollow || !pFoll->Frm().Height(), "Dont care about Performance");
- Shrink( nRet PHEIGHT );
-#endif
return nRet;
}
@@ -405,9 +371,7 @@ SwTwips SwTabFrm::Join()
if ( !pFoll->IsJoinLocked() )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
-#endif
pFoll->Cut(); //Erst ausschneiden um unuetze Benachrichtigungen zu
//minimieren.
@@ -423,17 +387,11 @@ SwTwips SwTabFrm::Join()
while ( pRow )
{
pNxt = pRow->GetNext();
-#ifdef VERTICAL_LAYOUT
nHeight += (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- nHeight += pRow->Frm().Height();
-#endif
pRow->Remove();
pRow->_InvalidateAll();
pRow->InsertBehind( this, pPrv );
-#ifdef VERTICAL_LAYOUT
pRow->CheckDirChange();
-#endif
pPrv = pRow;
pRow = pNxt;
}
@@ -454,9 +412,9 @@ SwTwips SwTabFrm::Join()
|*************************************************************************/
void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
{
-#ifdef VERTICAL_LAYOUT
+ // LONG_MAX == nBottom means we have to calculate all
+ BOOL bAll = LONG_MAX == nBottom;
SWRECTFN( pFrm )
-#endif
do
{ pFrm->_InvalidatePos();
pFrm->_InvalidateSize();
@@ -468,32 +426,25 @@ void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
else
pFrm->Prepare( PREP_ADJUST_FRM );
pFrm = pFrm->GetNext();
-#ifdef VERTICAL_LAYOUT
- } while ( pFrm && (*fnRect->fnYDiff)( (pFrm->Frm().*fnRect->fnGetTop)(),
- nBottom ) < 0 );
-#else
- } while ( pFrm && pFrm->Frm().Top() < nBottom );
-#endif
+ } while ( pFrm &&
+ ( bAll ||
+ (*fnRect->fnYDiff)( (pFrm->Frm().*fnRect->fnGetTop)(), nBottom ) < 0 ) );
}
BOOL MA_FASTCALL lcl_CalcLowers( SwLayoutFrm *pLay, long nBottom )
{
+ // LONG_MAX == nBottom means we have to calculate all
+ BOOL bAll = LONG_MAX == nBottom;
BOOL bRet = FALSE;
SwCntntFrm *pCnt = pLay->ContainsCntnt();
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pLay )
-#endif
while ( pCnt && pLay->GetUpper()->IsAnLower( pCnt ) )
{
bRet |= !pCnt->IsValid();
pCnt->CalcFlys( FALSE );
pCnt->Calc();
pCnt->GetUpper()->Calc();
-#ifdef VERTICAL_LAYOUT
- if( (*fnRect->fnYDiff)((pCnt->Frm().*fnRect->fnGetTop)(), nBottom) > 0 )
-#else
- if ( pCnt->Frm().Top() > nBottom )
-#endif
+ if( ! bAll && (*fnRect->fnYDiff)((pCnt->Frm().*fnRect->fnGetTop)(), nBottom) > 0 )
break;
pCnt = pCnt->GetNextCntntFrm();
}
@@ -502,6 +453,8 @@ BOOL MA_FASTCALL lcl_CalcLowers( SwLayoutFrm *pLay, long nBottom )
BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm, long nBottom )
{
+ // LONG_MAX == nBottom means we have to calculate all
+ BOOL bAll = LONG_MAX == nBottom;
BOOL bRet = FALSE;
const SwFrm* pOldUp = pFrm->GetUpper();
SWRECTFN( pFrm )
@@ -516,7 +469,8 @@ BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm, long nBottom )
}
pFrm = pFrm->GetNext();
} while( pFrm &&
- (*fnRect->fnYDiff)((pFrm->Frm().*fnRect->fnGetTop)(), nBottom) < 0
+ ( bAll ||
+ (*fnRect->fnYDiff)((pFrm->Frm().*fnRect->fnGetTop)(), nBottom) < 0 )
&& pFrm->GetUpper() == pOldUp );
return bRet;
}
@@ -540,7 +494,6 @@ void MA_FASTCALL lcl_CalcLayout( SwLayoutFrm *pLay, long nBottom )
void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pTab )
if ( !pTab->IsFollow() && !pTab->GetTable()->IsTblComplex() )
{
@@ -582,53 +535,6 @@ void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab )
if ( pTab->GetFmt()->GetDoc()->IsBrowseMode() )
nBottom += pUp->Grow( LONG_MAX, TRUE );
lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), nBottom );
-#else
- //Ersteinmal koennen wir die Strukturen auf die richtige Groesse
- //bringen.
- if ( !pTab->IsFollow() && !pTab->GetTable()->IsTblComplex() )
- {
- SwLayoutFrm *pRow = (SwLayoutFrm*)pTab->Lower();
- do
- {
- SwLayoutFrm *pCell = (SwLayoutFrm*)pRow->Lower();
- SwFrm *pCnt = pCell->Lower();
- pCnt->Calc();
- const long nCellHeight = pCell->Frm().Height();
- const long nCellY = pCell->Frm().Top()-1;
- const long nCntHeight = pCnt->Frm().Height();
- const long nCntY = pCnt->Frm().Top()-1;
- if ( 0 != (pCell = (SwLayoutFrm*)pCell->GetNext()) )
- do
- { pCell->Frm().SSize().Height() =
- pCell->Prt().SSize().Height() = nCellHeight;
- pCell->Frm().Pos().Y() = nCellY;
- pCell->_InvalidateAll();
-
- pCnt = pCell->Lower();
- pCnt->Frm().SSize().Height() =
- pCnt->Prt().SSize().Height() = nCntHeight;
- pCnt->Frm().Pos().Y() = nCntY;
- pCnt->_InvalidateAll();
-
- pCell = (SwLayoutFrm*)pCell->GetNext();
- } while ( pCell );
-
- SwTwips nRowTop = pRow->Frm().Top();
- SwTwips nUpBot = pTab->GetUpper()->Frm().Bottom();
- if( nUpBot < nRowTop )
- break;
- pRow = (SwLayoutFrm*)pRow->GetNext();
-
- } while ( pRow );
- }
- //MA 28. Nov. 95: einen weiteren habe ich noch: Es braucht
- //nur soweit formatiert werden, wie Platz vorhanden ist.
- SwFrm *pUp = pTab->GetUpper();
- long nBottom = pUp->Prt().Bottom() + pUp->Frm().Top();
- if ( pTab->GetFmt()->GetDoc()->IsBrowseMode() )
- nBottom += pUp->Grow( LONG_MAX PHEIGHT, TRUE );
- lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), nBottom );
-#endif
}
void MA_FASTCALL lcl_Recalc( SwTabFrm *pTab,
@@ -637,7 +543,6 @@ void MA_FASTCALL lcl_Recalc( SwTabFrm *pTab,
{
if ( pTab->Lower() )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pTab )
const SwTwips nOldHeight = (pTab->Frm().*fnRect->fnGetHeight)();
const SwTwips nOldWidth = (pTab->Frm().*fnRect->fnGetWidth)();
@@ -658,25 +563,6 @@ void MA_FASTCALL lcl_Recalc( SwTabFrm *pTab,
rNotify.AddWidthOfst( nNew - nOldWidth );
else if ( nOldWidth > nNew )
rNotify.SubtractWidthOfst( nOldWidth - nNew );
-#else
- const SwTwips nOldHeight = pTab->Frm().Height();
- const SwTwips nOldWidth = pTab->Frm().Width();
- if ( !pFirstRow )
- {
- pFirstRow = (SwLayoutFrm*)pTab->Lower();
- rNotify.SetLowersComplete( TRUE );
- }
- ::SwInvalidatePositions( pFirstRow, LONG_MAX );
- ::lcl_CalcLayout( pFirstRow, LONG_MAX );
- if ( nOldHeight < pTab->Frm().Height() )
- rNotify.AddHeightOfst( pTab->Frm().Height() - nOldHeight );
- else if ( nOldHeight > pTab->Frm().Height() )
- rNotify.SubtractHeightOfst( nOldHeight - pTab->Frm().Height() );
- if ( nOldWidth < pTab->Frm().Width() )
- rNotify.AddWidthOfst( pTab->Frm().Width() - nOldWidth );
- else if ( nOldWidth > pTab->Frm().Width() )
- rNotify.SubtractWidthOfst( nOldWidth - pTab->Frm().Width() );
-#endif
}
}
@@ -767,7 +653,7 @@ void SwTabFrm::MakeAll()
delete pAccess;
bCalcLowers |= pLayout->Resize(
pLayout->GetBrowseWidthByTabFrm( *this ), FALSE );
- pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
+ pAccess = new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
@@ -1146,6 +1032,8 @@ void SwTabFrm::MakeAll()
//Follow gleich gueltig gemacht werden.
if ( GetFollow() )
{
+ SWRECTFN( GetFollow() )
+
static BYTE nStack = 0;
if ( !StackHack::IsLocked() && nStack < 4 )
{
@@ -1158,7 +1046,7 @@ void SwTabFrm::MakeAll()
pAttrs = pAccess->Get();
((SwTabFrm*)GetFollow())->SetLowersFormatted(FALSE);
::lcl_CalcLayout((SwLayoutFrm*)GetFollow()->Lower(),
- GetFollow()->GetUpper()->Frm().Bottom() );
+ (GetFollow()->GetUpper()->Frm().*fnRect->fnGetBottom)() );
if ( !GetFollow()->GetFollow() )
{
SwFrm *pNxt = ((SwFrm*)GetFollow())->FindNext();
@@ -1255,7 +1143,6 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
const SwFlyFrm* pMyFly = FindFlyFrm();
if ( pPage->GetSortedObjs() )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
long nPrtPos = (Frm().*fnRect->fnGetTop)();
nPrtPos = (*fnRect->fnYInc)( nPrtPos, rUpper );
@@ -1272,9 +1159,10 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
const SwRect aFlyRect = pFly->AddSpacesToFrm();
if ( WEIT_WECH != (pFly->Frm().*fnRect->fnGetTop)() &&
pFly->IsFlyAtCntFrm() && aFlyRect.IsOver( aRect ) &&
+ // OD 25.02.2003 #i9040# - use '<=' instead of '<'
(*fnRect->fnYDiff)(
(pFly->GetAnchor()->Frm().*fnRect->fnGetBottom)(),
- (Frm().*fnRect->fnGetTop)() ) < 0 &&
+ (Frm().*fnRect->fnGetTop)() ) <= 0 &&
!IsAnLower( pFly ) && !pFly->IsAnLower( this ) &&
( !pMyFly || pMyFly->IsAnLower( pFly ) ) &&
pPage->GetPhyPageNum() >=
@@ -1313,58 +1201,6 @@ BOOL SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
}
}
rUpper = (*fnRect->fnYDiff)( nPrtPos, (Frm().*fnRect->fnGetTop)() );
-#else
- long nPrtPos = Frm().Top() + rUpper;
- SwRect aRect( Frm() );
- if ( Prt().Top() - rUpper > 0 )
- aRect.SSize().Height() -= Prt().Top() - rUpper;
- for ( USHORT i = 0; i < pPage->GetSortedObjs()->Count(); ++i )
- {
- SdrObject *pObj = (*pPage->GetSortedObjs())[i];
- if ( pObj->IsWriterFlyFrame() )
- {
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
- const SwRect aFlyRect = pFly->AddSpacesToFrm();
- if ( WEIT_WECH != pFly->Frm().Top() &&
- pFly->IsFlyAtCntFrm() && aFlyRect.IsOver( aRect ) &&
- pFly->GetAnchor()->Frm().Bottom() < Frm().Top() &&
- !IsAnLower( pFly ) && !pFly->IsAnLower( this ) &&
- ( !pMyFly || pMyFly->IsAnLower( pFly ) ) &&
- pPage->GetPhyPageNum() >=
- pFly->GetAnchor()->FindPageFrm()->GetPhyPageNum() )
- {
- const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- const SwFmtHoriOrient &rHori= pFly->GetFmt()->GetHoriOrient();
- if ( SURROUND_NONE == rSur.GetSurround() )
- {
- nPrtPos = Max( nPrtPos, aFlyRect.Bottom() + 1L );
- bInvalidatePrtArea = TRUE;
- }
- if ( (SURROUND_RIGHT == rSur.GetSurround() ||
- SURROUND_PARALLEL == rSur.GetSurround())&&
- HORI_LEFT == rHori.GetHoriOrient() )
- {
- //Der Rahmen kann auch noch einem anderen Rahmen
- //ausgewichen sein.
- const long nWidth = aFlyRect.Width() +
- aFlyRect.Left() - pFly->GetAnchor()->Frm().Left();
- rLeftOffset = Max( rLeftOffset, nWidth );
- bInvalidatePrtArea = TRUE;
- }
- if ( (SURROUND_LEFT == rSur.GetSurround() ||
- SURROUND_PARALLEL == rSur.GetSurround())&&
- HORI_RIGHT == rHori.GetHoriOrient() )
- {
- const long nWidth = aFlyRect.Width() +
- pFly->GetAnchor()->Frm().Right() - aFlyRect.Right();
- rRightOffset = Max( rRightOffset, nWidth );
- bInvalidatePrtArea = TRUE;
- }
- }
- }
- }
- rUpper = nPrtPos - Frm().Top();
-#endif
}
return bInvalidatePrtArea;
@@ -1384,7 +1220,6 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
{
ASSERT( pAttrs, "TabFrm::Format, pAttrs ist 0." );
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
if ( !bValidSize )
{
@@ -1393,11 +1228,6 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
if( nDiff )
(aFrm.*fnRect->fnAddRight)( nDiff );
}
-#else
- //FixSize einstellen
- if ( !bValidSize )
- aFrm.Width( GetUpper()->Prt().Width() );
-#endif
//VarSize ist immer die Hoehe.
//Fuer den oberen/unteren Rand gelten die selben Regeln wie fuer
@@ -1429,13 +1259,8 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
//Wenn das Adjustment 0 ist, so werden die Rander anhand des
//Randattributes eingestellt.
-#ifdef VERTICAL_LAYOUT
const SwTwips nOldHeight = (Prt().*fnRect->fnGetHeight)();
const SwTwips nMax = (aFrm.*fnRect->fnGetWidth)();
-#else
- const SwTwips nOldHeight = Prt().Height();
- const SwTwips nMax = aFrm.Width();
-#endif
SwTwips nLeft = pAttrs->CalcLeftLine();
SwTwips nRight = pAttrs->CalcRightLine();
@@ -1515,7 +1340,8 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
nLeft = 0;
nLeft += nLeftOffset;
}
- nRight = pAttrs->CalcRight();
+ // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)>
+ nRight = pAttrs->CalcRight( this );
if( nRightOffset )
{
if( nRight < 0 )
@@ -1541,26 +1367,12 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
default:
ASSERT( FALSE, "Ungueltige orientation fuer Table." );
}
-#ifdef VERTICAL_LAYOUT
(this->*fnRect->fnSetYMargins)( nUpper, nLower );
if( (nMax - MINLAY) < (nLeft + nRight) )
(this->*fnRect->fnSetXMargins)( 0, 0 );
else
(this->*fnRect->fnSetXMargins)( nLeft, nRight );
-#else
- Prt().Top( nUpper );
- Prt().Height( aFrm.Height() - (nUpper + nLower) );
- if ( (nMax - MINLAY) < (nLeft + nRight) )
- { //Wenn die Raender garnicht passen lasse ich sie lieber gleich weg.
- Prt().Left( 0 );
- Prt().Width( nMax );
- }
- else
- {
- Prt().Left( nLeft );
- Prt().Width( nMax - (nLeft + nRight) );
- }
-#endif
+
ViewShell *pSh;
if ( bCheckBrowseWidth && GetFmt()->GetDoc()->IsBrowseMode() &&
GetUpper()->IsPageBodyFrm() && // nur PageBodyFrms, nicht etwa ColBodyFrms
@@ -1576,11 +1388,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
Prt().Width( Min( nWidth, Prt().Width() ) );
}
-#ifdef VERTICAL_LAYOUT
if ( nOldHeight != (Prt().*fnRect->fnGetHeight)() )
-#else
- if ( nOldHeight != Prt().Height() )
-#endif
bValidSize = FALSE;
}
@@ -1592,21 +1400,14 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
SwTwips nRemaining = 0, nDiff;
SwFrm *pFrm = pLower;
while ( pFrm )
-#ifdef VERTICAL_LAYOUT
- { nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)();
-#else
- { nRemaining += pFrm->Frm().Height();
-#endif
+ {
+ nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)();
pFrm = pFrm->GetNext();
}
//Jetzt noch die Raender addieren
nRemaining += nUpper + nLower;
-#ifdef VERTICAL_LAYOUT
nDiff = (Frm().*fnRect->fnGetHeight)() - nRemaining;
-#else
- nDiff = Frm().Height() - nRemaining;
-#endif
if ( nDiff > 0 )
Shrink( nDiff PHEIGHT );
else if ( nDiff < 0 )
@@ -1621,24 +1422,12 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
|* Letzte Aenderung MA 23. Sep. 96
|*
|*************************************************************************/
-#ifdef VERTICAL_LAYOUT
SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
SWRECTFN( this )
SwTwips nHeight =(Frm().*fnRect->fnGetHeight)();
if( nHeight > 0 && nDist > ( LONG_MAX - nHeight ) )
nDist = LONG_MAX - nHeight;
-#else
-SwTwips SwTabFrm::GrowFrm( SwTwips nDist, const SzPtr pDirection,
- BOOL bTst, BOOL bInfo )
-{
- if( pDirection == pWidth )
- return 0;
-
- if ( Frm().SSize().*pDirection > 0 &&
- nDist > (LONG_MAX - Frm().SSize().*pDirection) )
- nDist = LONG_MAX - Frm().SSize().*pDirection;
-#endif
//Tabelle waechst immer (sie kann ja ggf. aufgespalten werden).
if ( !bTst )
@@ -1647,7 +1436,6 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, const SzPtr pDirection,
{
//Der Upper wird nur soweit wie notwendig gegrowed. In nReal wird erstmal
//die bereits zur Verfuegung stehende Strecke bereitgestellt.
-#ifdef VERTICAL_LAYOUT
SwTwips nReal = (GetUpper()->Prt().*fnRect->fnGetHeight)();
SwFrm *pFrm = GetUpper()->Lower();
while ( pFrm )
@@ -1655,9 +1443,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, const SzPtr pDirection,
pFrm = pFrm->GetNext();
}
-#ifdef ACCESSIBLE_LAYOUT
SwRect aOldFrm( Frm() );
-#endif
nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight + nDist );
if( IsVertical() && !IsReverse() )
@@ -1665,52 +1451,27 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, const SzPtr pDirection,
if ( nReal < nDist )
GetUpper()->Grow( nDist - (nReal>0 ? nReal : 0), bTst, bInfo );
-#ifdef ACCESSIBLE_LAYOUT
SwRootFrm *pRootFrm = FindRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( this, aOldFrm );
}
-#endif
}
else
{
ASSERT( !this, "Table without Upper" );
-#ifdef ACCESSIBLE_LAYOUT
SwRect aOldFrm( Frm() );
-#endif
nHeight = (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnSetHeight)( nHeight + nDist );
if( IsVertical() && !IsReverse() )
Frm().Pos().X() -= nDist;
-#ifdef ACCESSIBLE_LAYOUT
SwRootFrm *pRootFrm = FindRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( this, aOldFrm );
}
-#endif
-#else
- SwTwips nReal = GetUpper()->Prt().SSize().*pDirection;
- SwFrm *pFrm = GetUpper()->Lower();
- while ( pFrm )
- { nReal -= pFrm->Frm().SSize().*pDirection;
- pFrm = pFrm->GetNext();
- }
-
- Frm().SSize().*pDirection += nDist;
-
- if ( nReal < nDist )
- GetUpper()->Grow( nDist - (nReal > 0 ? nReal : 0),
- pDirection, bTst, bInfo );
- }
- else
- {
- ASSERT( !this, "Table without Upper" );
- Frm().SSize().*pDirection += nDist;
-#endif
}
SwPageFrm *pPage = FindPageFrm();
@@ -2032,7 +1793,6 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReform
BOOL bMoveAnyway = FALSE;
SwTwips nSpace = 0;
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
if ( !SwFlowFrm::IsMoveBwdJump() )
{
@@ -2077,41 +1837,6 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReform
nHeight += (Lower()->Frm().*fnRect->fnGetHeight)();
return nHeight <= nSpace;
}
-#else
- if ( !SwFlowFrm::IsMoveBwdJump() &&
- Abs(pNewUpper->Prt().Width() - GetUpper()->Prt().Width()) < 2 )
- {
- if ( FALSE == (bMoveAnyway = BwdMoveNecessary( pOldPage, Frm() ) > 1) )
- {
- //Das Rechteck, in dem ich landen wuerde berechenen.
- SwRect aRect( pNewUpper->Prt() );
- aRect.Pos() += pNewUpper->Frm().Pos();
- const SwFrm *pPrevFrm = pNewUpper->Lower();
- while ( pPrevFrm )
- {
- aRect.Top( pPrevFrm->Frm().Bottom() );
- pPrevFrm = pPrevFrm->GetNext();
- }
- bMoveAnyway = BwdMoveNecessary( pNewPage, aRect) > 1;
- nSpace = aRect.Height();
- if ( GetFmt()->GetDoc()->IsBrowseMode() )
- nSpace += pNewUpper->Grow( LONG_MAX PHEIGHT, TRUE );
- }
- }
- else if ( SwFlowFrm::IsMoveBwdJump() || !bLockBackMove )
- bMoveAnyway = TRUE;
-
- if ( bMoveAnyway )
- return rReformat = TRUE;
- else if ( !bLockBackMove )
- { const BOOL bRepeat = GetTable()->IsHeadlineRepeat();
- SwTwips nHeight = bRepeat && Lower()->GetNext() ?
- Lower()->GetNext()->Frm().Height() : Lower()->Frm().Height();
- if ( bHead && bRepeat && Lower()->GetNext() )
- nHeight += Lower()->Frm().Height();
- return nHeight <= nSpace;
- }
-#endif
}
return FALSE;
}
@@ -2180,9 +1905,7 @@ void SwTabFrm::Cut()
//Erst removen, dann Upper Shrinken.
SwLayoutFrm *pUp = GetUpper();
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
-#endif
Remove();
if ( pUp )
{
@@ -2197,12 +1920,30 @@ void SwTabFrm::Cut()
pSct->_InvalidateSize();
}
}
-#ifdef VERTICAL_LAYOUT
else if( (Frm().*fnRect->fnGetHeight)() )
-#else
- else if ( Frm().Height() )
-#endif
+ {
+ // OD 24.02.2003 #104992# - unlock section the table frame was in.
+ // Otherwise, the section will not shrink.
+ // The section will be locked in this situation, if table is
+ // converted to text and the table was the only content in the
+ // section beside a footnote.
+ // Note: lock state will be restored.
+ bool bOldLock;
+ if ( pSct )
+ {
+ bOldLock = pSct->IsColLocked() ? true : false;
+ pSct->ColUnlock();
+ }
pUp->Shrink( Frm().Height() PHEIGHT );
+ // OD 24.02.2003 #104992# - restore section lock state.
+ if ( pSct )
+ {
+ if ( bOldLock )
+ {
+ pSct->ColLock();
+ }
+ }
+ }
}
if ( pPage && !IsFollow() && pPage->GetUpper() )
@@ -2241,20 +1982,12 @@ void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
GetNext()->InvalidatePage( pPage );
}
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
if( (Frm().*fnRect->fnGetHeight)() )
pParent->Grow( (Frm().*fnRect->fnGetHeight)() );
if( (Frm().*fnRect->fnGetWidth)() != (pParent->Prt().*fnRect->fnGetWidth)() )
Prepare( PREP_FIXSIZE_CHG );
-#else
- if ( Frm().Height() )
- pParent->Grow( Frm().Height() PHEIGHT );
-
- if ( Frm().Width() != pParent->Prt().Width() )
- Prepare( PREP_FIXSIZE_CHG );
-#endif
if ( GetPrev() )
{
if ( !IsFollow() )
@@ -2286,7 +2019,6 @@ void SwTabFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
}
}
-#ifdef VERTICAL_LAYOUT
/*************************************************************************
|*
|* SwTabFrm::Prepare()
@@ -2300,7 +2032,6 @@ void SwTabFrm::Prepare( const PrepareHint eHint, const void *, BOOL )
if( PREP_BOSS_CHGD == eHint )
CheckDirChange();
}
-#endif
/*************************************************************************
|*
@@ -2323,9 +2054,6 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine ):
{
SwCellFrm *pNew = new SwCellFrm( *rBoxes[i] );
pNew->InsertBehind( this, pPrev );
-#ifndef VERTICAL_LAYOUT
- pNew->bVarHeight = FALSE;
-#endif
pPrev = pNew;
}
}
@@ -2413,9 +2141,7 @@ void SwRowFrm::MakeAll()
|*************************************************************************/
long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pFrm )
-#endif
long nHeight = 0;
const SwFrm* pTmp = pFrm->IsSctFrm() ?
((SwSectionFrm*)pFrm)->ContainsCntnt() : pFrm;
@@ -2466,9 +2192,7 @@ SwTwips MA_FASTCALL lcl_CalcMinRowHeight( SwLayoutFrm *pRow );
SwTwips MA_FASTCALL lcl_CalcMinCellHeight( SwLayoutFrm *pCell,
const SwBorderAttrs *pAttrs = 0 )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pCell )
-#endif
SwTwips nHeight = 0;
SwFrm *pLow = pCell->Lower();
if ( pLow )
@@ -2478,14 +2202,9 @@ SwTwips MA_FASTCALL lcl_CalcMinCellHeight( SwLayoutFrm *pCell,
{
if( pLow->IsCntntFrm() || pLow->IsSctFrm() )
{
-#ifdef VERTICAL_LAYOUT
long nLowHeight = (pLow->Frm().*fnRect->fnGetHeight)();
nHeight += nLowHeight;
nFlyAdd = Max( 0L, nFlyAdd - nLowHeight );
-#else
- nHeight += pLow->Frm().Height();
- nFlyAdd = Max( 0L, nFlyAdd - pLow->Frm().Height() );
-#endif
nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) );
}
else
@@ -2512,14 +2231,9 @@ SwTwips MA_FASTCALL lcl_CalcMinCellHeight( SwLayoutFrm *pCell,
SwTwips MA_FASTCALL lcl_CalcMinRowHeight( SwLayoutFrm *pRow )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pRow )
if ( pRow->HasFixSize() )
return (pRow->Frm().*fnRect->fnGetHeight)();
-#else
- if ( pRow->HasFixSize( pHeight ) )
- return pRow->Frm().Height();
-#endif
SwTwips nHeight = 0;
SwLayoutFrm *pLow = (SwLayoutFrm*)pRow->Lower();
@@ -2538,9 +2252,7 @@ SwTwips MA_FASTCALL lcl_CalcMinRowHeight( SwLayoutFrm *pRow )
void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
-#endif
ASSERT( pAttrs, "SwRowFrm::Format ohne Attrs." );
const BOOL bFix = BFIXHEIGHT;
@@ -2560,7 +2272,6 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
{
bValidSize = TRUE;
-#ifdef VERTICAL_LAYOUT
#ifndef PRODUCT
if ( HasFixSize() )
{
@@ -2571,18 +2282,6 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
const SwTwips nDiff = (Frm().*fnRect->fnGetHeight)() - (HasFixSize() ?
pAttrs->GetSize().Height() :
::lcl_CalcMinRowHeight( this ));
-#else
-#ifndef PRODUCT
- if ( HasFixSize( pHeight ) )
- {
- const SwFmtFrmSize &rFrmSize = GetFmt()->GetFrmSize();
- ASSERT( rFrmSize.GetSize().Height() > 0, "Hat ihn" );
- }
-#endif
- const SwTwips nDiff = Frm().Height() - (HasFixSize( pHeight ) ?
- pAttrs->GetSize().Height() :
- ::lcl_CalcMinRowHeight( this ));
-#endif
if ( nDiff )
{
BFIXHEIGHT = FALSE;
@@ -2596,17 +2295,10 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
if ( !GetNext() )
{
//Der letzte fuellt den verbleibenden Raum im Upper aus.
-#ifdef VERTICAL_LAYOUT
SwTwips nDiff = (GetUpper()->Prt().*fnRect->fnGetHeight)();
SwFrm *pSibling = GetUpper()->Lower();
do
{ nDiff -= (pSibling->Frm().*fnRect->fnGetHeight)();
-#else
- SwTwips nDiff = GetUpper()->Prt().Height();
- SwFrm *pSibling = GetUpper()->Lower();
- do
- { nDiff -= pSibling->Frm().Height();
-#endif
pSibling = pSibling->GetNext();
} while ( pSibling );
if ( nDiff > 0 )
@@ -2632,21 +2324,15 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const BOOL bHeight )
SwFrm *pFrm = Lower();
if ( bHeight )
{
-#ifdef ACCESSIBLE_LAYOUT
SwRootFrm *pRootFrm = 0;
-#endif
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
while ( pFrm )
{
long nDiff = nHeight - (pFrm->Frm().*fnRect->fnGetHeight)();
if( nDiff )
{
-#ifdef ACCESSIBLE_LAYOUT
SwRect aOldFrm( pFrm->Frm() );
-#endif
(pFrm->Frm().*fnRect->fnAddBottom)( nDiff );
-#ifdef ACCESSIBLE_LAYOUT
if( !pRootFrm )
pRootFrm = FindRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
@@ -2654,13 +2340,6 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const BOOL bHeight )
{
pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( pFrm, aOldFrm );
}
-#endif
-#else
- while ( pFrm )
- { if ( pFrm->Frm().Height() != nHeight )
- {
- pFrm->Frm().Height( nHeight );
-#endif
pFrm->_InvalidatePrt();
}
pFrm = pFrm->GetNext();
@@ -2705,7 +2384,6 @@ void SwRowFrm::Cut()
|*
|*************************************************************************/
-#ifdef VERTICAL_LAYOUT
SwTwips SwRowFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
@@ -2820,118 +2498,6 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
return nReal;
}
-#else
-
-SwTwips SwRowFrm::GrowFrm( SwTwips nDist, const SzPtr pDirection,
- BOOL bTst, BOOL bInfo )
-{
- const SwTwips nReal = SwLayoutFrm::GrowFrm( nDist, pDirection, bTst, bInfo);
-
- //Hoehe der Zellen auf den neuesten Stand bringen.
- if ( !bTst )
- {
- AdjustCells( Prt().SSize().*pDirection + nReal,
- pDirection == pHeight ? TRUE : FALSE );
- if ( nReal )
- SetCompletePaint();
- }
- return nReal;
-}
-/*************************************************************************
-|*
-|* SwRowFrm::ShrinkFrm()
-|*
-|* Ersterstellung MA 15. Mar. 93
-|* Letzte Aenderung MA 20. Jun. 96
-|*
-|*************************************************************************/
-SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, const SzPtr pDirection,
- BOOL bTst, BOOL bInfo )
-{
- BOOL bVariable =
- pDirection == pHeight;
- if ( HasFixSize( pDirection ) )
- {
- AdjustCells( Prt().SSize().*pDirection, bVariable );
- return 0L;
- }
-
- //bInfo wird ggf. vom SwRowFrm::Format auf TRUE gesetzt, hier muss dann
- //entsprechend reagiert werden
- const BOOL bShrinkAnyway = bInfo;
-
- //Nur soweit Shrinken, wie es der Inhalt der groessten Zelle zulaesst.
- SwTwips nRealDist = nDist;
- if ( bVariable )
- {
- const SwFmtFrmSize &rSz = GetFmt()->GetFrmSize();
- SwTwips nMinHeight = rSz.GetSizeType() == ATT_MIN_SIZE ? rSz.GetHeight() : 0;
- SwLayoutFrm *pCell = (SwLayoutFrm*)Lower();
- if ( nMinHeight < Frm().SSize().*pDirection )
- {
- SwLayoutFrm *pCell = (SwLayoutFrm*)Lower();
- while ( pCell )
- {
- SwTwips nAct = ::lcl_CalcMinCellHeight( pCell );
- if ( nAct > nMinHeight )
- nMinHeight = nAct;
- if ( nMinHeight >= Frm().SSize().*pDirection )
- break;
- pCell = (SwLayoutFrm*)pCell->GetNext();
- }
- }
- if ( (Frm().SSize().*pDirection - nRealDist) < nMinHeight )
- nRealDist = Frm().SSize().*pDirection - nMinHeight;
- }
- if ( nRealDist < 0 )
- nRealDist = 0;
-
- SwTwips nReal = nRealDist;
- if ( nReal )
- {
- if ( !bTst )
- Frm().SSize().*pDirection -= nReal;
-
- SwTwips nTmp = GetUpper()->Shrink( nReal, pDirection, bTst );
- if ( !bShrinkAnyway && !GetNext() && nTmp != nReal )
- {
- //Der letzte bekommt den Rest im Upper und nimmt deshalb
- //ggf. Ruecksichten (sonst: Endlosschleife)
- if ( !bTst )
- {
- nReal -= nTmp;
- Frm().SSize().*pDirection += nReal;
- }
- nReal = nTmp;
- }
- }
-
- //Geeignet invalidieren und die Hoehe der Zellen auf den neuesten
- //Stand bringen.
- if ( !bTst )
- {
- if ( nReal )
- {
- if ( GetNext() )
- GetNext()->_InvalidatePos();
- _InvalidateAll();
- SetCompletePaint();
-
- SwTabFrm *pTab = FindTabFrm();
- if ( pTab->IsFollow() &&
- (!GetPrev() ||
- (pTab->GetTable()->IsHeadlineRepeat() && !GetPrev()->GetPrev())))
- {
- pTab->FindMaster()->InvalidatePos();
- }
- }
- AdjustCells( Prt().SSize().*pDirection - nReal, bVariable );
- }
- return nReal;
-}
-
-
-#endif
/*************************************************************************
|*
@@ -2972,7 +2538,6 @@ SwCellFrm::~SwCellFrm()
SwModify* pMod = GetFmt();
if( pMod )
{
-#ifdef ACCESSIBLE_LAYOUT
// At this stage the lower frames aren't destroyed already,
// therfor we have to do a recursive dispose.
SwRootFrm *pRootFrm = FindRootFrm();
@@ -2981,7 +2546,7 @@ SwCellFrm::~SwCellFrm()
{
pRootFrm->GetCurrShell()->Imp()->DisposeAccessibleFrm( this, sal_True );
}
-#endif
+
pMod->Remove( this ); // austragen,
if( !pMod->GetDepends() )
delete pMod; // und loeschen
@@ -3001,7 +2566,6 @@ BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva )
BOOL bRet = FALSE;
SwFrm *pFrm = pLay->Lower();
SwPageFrm* pPg = NULL;
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pLay )
while ( pFrm )
{
@@ -3063,95 +2627,26 @@ BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva )
(pFrm->Frm().*fnRect->fnGetHeight)() );
pFrm = pFrm->GetNext();
}
-#else
- while ( pFrm )
- {
- if ( pFrm->Frm().Top() != lYStart )
- {
- bRet = TRUE;
- const long lDiff = lYStart - pFrm->Frm().Top();
- pFrm->Frm().Pos().Y() = lYStart;
- pFrm->SetCompletePaint();
- if ( !pFrm->GetNext() )
- pFrm->SetRetouche();
- if( bInva )
- pFrm->Prepare( PREP_POS_CHGD );
- if ( pFrm->IsLayoutFrm() && ((SwLayoutFrm*)pFrm)->Lower() )
- lcl_ArrangeLowers( (SwLayoutFrm*)pFrm,
- ((SwLayoutFrm*)pFrm)->Lower()->Frm().Top()+lDiff, bInva );
- if ( pFrm->GetDrawObjs() )
- {
- for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
- {
- SdrObject *pO = (*pFrm->GetDrawObjs())[i];
- if ( pO->IsWriterFlyFrame() )
- {
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
- if ( WEIT_WECH != pFly->Frm().Top() )
- pFly->Frm().Pos().Y() += lDiff;
- pFly->GetVirtDrawObj()->_SetRectsDirty();
- if ( pFly->IsFlyInCntFrm() )
- ((SwFlyInCntFrm*)pFly)->AddRefOfst( lDiff );
- else
- {
- if( !pPg )
- pPg = pLay->FindPageFrm();
- SwPageFrm* pOld = pFly->FindPageFrm();
- if( pPg != pOld )
- pOld->MoveFly( pFly, pPg );
- if( pFly->IsAutoPos() )
- ((SwFlyAtCntFrm*)pFly)->AddLastCharY( lDiff );
- }
- if ( ::lcl_ArrangeLowers( pFly, pFly->Frm().Top() +
- pFly->Prt().Top(), bInva ) )
- pFly->SetCompletePaint();
- }
- else
- pO->SetAnchorPos( pFrm->Frm().Pos() );
- }
- }
- }
- // Columns and cells are ordered horizontal, not vertical
- if( !pFrm->IsColumnFrm() && !pFrm->IsCellFrm() )
- lYStart += pFrm->Frm().Height();
- pFrm = pFrm->GetNext();
- }
-#endif
return bRet;
}
void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
{
ASSERT( pAttrs, "CellFrm::Format, pAttrs ist 0." );
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
if ( !bValidPrtArea )
{
bValidPrtArea = TRUE;
//Position einstellen.
- long nTmp1 = pAttrs->CalcLeft( this );
- long nTmp2 = pAttrs->CalcRight();
- (this->*fnRect->fnSetXMargins)( nTmp1, nTmp2 );
- nTmp1 = pAttrs->CalcTop();
- nTmp2 = pAttrs->CalcBottom();
- (this->*fnRect->fnSetYMargins)( nTmp1, nTmp2 );
+ long nLeftSpace = pAttrs->CalcLeft( this );
+ // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)>
+ long nRightSpace = pAttrs->CalcRight( this );
+ (this->*fnRect->fnSetXMargins)( nLeftSpace, nRightSpace );
+ long nTopSpace = pAttrs->CalcTop();
+ long nBottomSpace = pAttrs->CalcBottom();
+ (this->*fnRect->fnSetYMargins)( nTopSpace, nBottomSpace );
}
-#else
- if ( !bValidPrtArea )
- {
- bValidPrtArea = TRUE;
-
- //Position einstellen.
- aPrt.Left( pAttrs->CalcLeft( this ) );
- aPrt.Top( pAttrs->CalcTop() );
-
- //Sizes einstellen; die Groesse gibt der umgebende Frm vor, die
- //die Raender werden einfach abgezogen.
- aPrt.Width ( aFrm.Width() - (aPrt.Left() + pAttrs->CalcRight()) );
- aPrt.Height( aFrm.Height()- (aPrt.Top() + pAttrs->CalcBottom()));
- }
-#endif
long nRemaining = ::lcl_CalcMinCellHeight( this, pAttrs );
if ( !bValidSize )
{
@@ -3178,7 +2673,6 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
ASSERT( nWidth <= nWish, "Zelle breiter als Tabelle." );
ASSERT( nWidth > 0, "Box without width" );
-#ifdef VERTICAL_LAYOUT
long nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)();
if ( nWish != nPrtWidth )
{
@@ -3206,31 +2700,6 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
//Jetzt die Hoehe einstellen, sie wird vom Inhalt und den Raendern
//bestimmt.
const long nDiffHeight = nRemaining - (Frm().*fnRect->fnGetHeight)();
-#else
- if ( nWish != pTab->Prt().Width() )
- {
- nWidth *= pTab->Prt().Width();
- nWidth /= nWish;
- }
- }
- else
- {
- ASSERT( pAttrs->GetSize().Width() > 0, "Box without width" );
- nWidth = GetUpper()->Prt().Width();
- SwFrm *pPre = GetUpper()->Lower();
- while ( pPre != this )
- { nWidth -= pPre->Frm().Width();
- pPre = pPre->GetNext();
- }
- }
- const long nDiff = nWidth - Frm().Width();
- Frm().Width( nWidth );
- Prt().Width( Prt().Width() + nDiff );
-
- //Jetzt die Hoehe einstellen, sie wird vom Inhalt und den Raendern
- //bestimmt.
- const long nDiffHeight = nRemaining - Frm().Height();
-#endif
if ( nDiffHeight )
{
if ( nDiffHeight > 0 )
@@ -3295,7 +2764,6 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
}
}
}
-#ifdef VERTICAL_LAYOUT
long nPrtHeight = (Prt().*fnRect->fnGetHeight)();
if( ( bVertDir && ( nRemaining -= (pAttrs->CalcTop() +
pAttrs->CalcBottom())) < nPrtHeight ) ||
@@ -3304,14 +2772,6 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
{
long lTopOfst = 0,
nDiff = (Prt().*fnRect->fnGetHeight)() - nRemaining;
-#else
- if ( (bVertDir &&
- (nRemaining -= (pAttrs->CalcTop() + pAttrs->CalcBottom())) < Prt().Height()) ||
- Lower()->Frm().Top() > Frm().Top()+Prt().Top() )
- {
- long lTopOfst = 0,
- nDiff = Prt().Height() - nRemaining;
-#endif
if ( nDiff >= 0 )
{
if ( bVertDir )
@@ -3322,14 +2782,9 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
case VERT_BOTTOM: lTopOfst = nDiff; break;
};
}
-#ifdef VERTICAL_LAYOUT
long nTmp = (*fnRect->fnYInc)(
(this->*fnRect->fnGetPrtTop)(), lTopOfst );
if ( lcl_ArrangeLowers( this, nTmp, !bVertDir ) )
-#else
- if ( lcl_ArrangeLowers( this, Frm().Top()+Prt().Top()+lTopOfst,
- !bVertDir ) )
-#endif
SetCompletePaint();
}
}
@@ -3339,11 +2794,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
//Ist noch eine alte Ausrichtung beruecksichtigt worden?
if ( Lower()->IsCntntFrm() )
{
-#ifdef VERTICAL_LAYOUT
const long lYStart = (this->*fnRect->fnGetPrtTop)();
-#else
- const long lYStart = Frm().Top()+Prt().Top();
-#endif
lcl_ArrangeLowers( this, lYStart, TRUE );
}
}
@@ -3373,12 +2824,8 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
if ( VERT_NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient() &&
Lower()->IsCntntFrm() )
{
-#ifdef VERTICAL_LAYOUT
SWRECTFN( this )
const long lYStart = (this->*fnRect->fnGetPrtTop)();
-#else
- const long lYStart = Frm().Top()+Prt().Top();
-#endif
bInva = lcl_ArrangeLowers( this, lYStart, FALSE );
}
if ( bInva )
@@ -3388,7 +2835,6 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-#ifdef ACCESSIBLE_LAYOUT
if( (bAttrSetChg &&
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, FALSE )) ||
RES_PROTECT == pNew->Which() )
@@ -3397,8 +2843,6 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
}
-#endif
SwLayoutFrm::Modify( pOld, pNew );
}
-
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 6d0ce935bba7..d8e89f10d8c2 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: trvlfrm.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: fme $ $Date: 2002-11-15 15:58:53 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -238,7 +238,6 @@ BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
BOOL bRet = FALSE;
const SwPageFrm *pPage = this;
-#ifdef VERTICAL_LAYOUT
Point aStPoint( rPoint );
Point aPoint;
while ( !bRet && pPage )
@@ -276,56 +275,6 @@ BOOL SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
aPoint.X() = nVarA;
else if ( nVarB < aPoint.X() )
aPoint.X() = nVarB;
-#else
- const PtPtr pFix = pFIXPOS;
- const PtPtr pVar = pVARPOS;
- Point aStPoint( rPoint );
- Point aPoint;
- while ( !bRet && pPage )
- {
- aPoint = aStPoint;
-
- //Wenn der Point in der VarRichtung zwischen zwei Seiten liegt
- //erhaelt die Seite die dem Point naeher steht den Zuschlag.
- SwTwips nTmp = bVarHeight ? pPage->Frm().Top() :
- pPage->Frm().Left();
- if ( pPage->GetPrev() )
- {
- const SwTwips nPreTmp = bVarHeight ?
- pPage->GetPrev()->Frm().Bottom() :
- pPage->GetPrev()->Frm().Right();
- if ( (aPoint.*pVar > nPreTmp) &&
- (aPoint.*pVar < nTmp) &&
- ((aPoint.*pVar - nPreTmp) >= (nTmp - aPoint.*pVar)) )
- aPoint.*pVar = nTmp;
- }
- else if ( aPoint.*pVar < nTmp )
- aPoint.*pVar = nTmp;
-
- nTmp = bVarHeight ? pPage->Frm().Bottom() : pPage->Frm().Right();
- if ( pPage->GetNext() )
- {
- const SwTwips nNxtTmp = bVarHeight ?
- pPage->GetNext()->Frm().Top() :
- pPage->GetNext()->Frm().Left();
- if ( (aPoint.*pVar > nTmp) &&
- (aPoint.*pVar < nNxtTmp) &&
- ((nNxtTmp - aPoint.*pVar) >= (aPoint.*pVar - nTmp)) )
- aPoint.*pVar = nTmp;
- }
- else if ( aPoint.*pVar > nTmp )
- aPoint.*pVar = nTmp;
-
- //Wenn der Punkt in der Fix-Richtung neben der Seite liegt wird er
- //hineingezogen.
- const SwTwips nVarA = pPage->Frm().Pos().*pFix;
- const SwTwips nVarB = bVarHeight ? pPage->Frm().Right() :
- pPage->Frm().Bottom();
- if ( nVarA > aPoint.*pFix )
- aPoint.*pFix = nVarA;
- else if ( nVarB < aPoint.*pFix )
- aPoint.*pFix = nVarB;
-#endif
//Weitere versuche mit der aktuellen Seite nur dann, wenn sich der
//Point innerhalb der Seite befindet.
@@ -1075,6 +1024,31 @@ BOOL GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
return FALSE;
else
{
+ // repeated headlines in tables
+ if ( pCnt->IsInTab() && fnPosPage == GetFirstSub )
+ {
+ const SwTabFrm* pTab = pCnt->FindTabFrm();
+ if ( pTab->IsFollow() && pTab->GetTable()->IsHeadlineRepeat() )
+ {
+ const SwFrm* pTmpFrm = pCnt;
+ while( !pTmpFrm->IsRowFrm() || !pTmpFrm->GetUpper()->IsTabFrm() )
+ pTmpFrm = pTmpFrm->GetUpper();
+
+ ASSERT( pTmpFrm && pTmpFrm->IsRowFrm(), "No RowFrm available" )
+
+ if ( ! pTmpFrm->GetPrev() && pTmpFrm->GetNext() )
+ {
+ // We are in the first line of a follow table
+ // with repeated headings.
+ // To actually make a "real" move we take the first content
+ // of the next row
+ pCnt = ((SwLayoutFrm*)pTmpFrm->GetNext())->ContainsCntnt();
+ if ( ! pCnt )
+ return FALSE;
+ }
+ }
+ }
+
SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode();
pPam->GetPoint()->nNode = *pCNd;
xub_StrLen nIdx;
@@ -1570,6 +1544,31 @@ Point SwRootFrm::GetPagePos( USHORT nPageNum ) const
return pPage->Frm().Pos();
}
+/** get page frame by phyiscal page number
+
+ OD 14.01.2003 #103492#
+
+ @return pointer to the page frame with the given physical page number
+*/
+SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const
+{
+ for ( const SwPageFrm* pPageFrm = static_cast<const SwPageFrm*>( Lower() );
+ pPageFrm && pPageFrm->GetPhyPageNum() < _nPageNum;
+ pPageFrm = static_cast<const SwPageFrm*>( pPageFrm->GetNext() ) )
+ {
+ // empty body of for-loop
+ }
+
+ if ( pPageFrm && pPageFrm->GetPhyPageNum() == _nPageNum )
+ {
+ return const_cast<SwPageFrm*>( pPageFrm );
+ }
+ else
+ {
+ return 0;
+ }
+}
+
/*************************************************************************
|*
|* SwRootFrm::IsDummyPage(USHORT)
@@ -2060,11 +2059,15 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.b2Lines = sal_True;
aTmpState.bNoScroll = sal_True;
+ aTmpState.nCursorBidiLevel = pStartFrm->IsRightToLeft() ? 1 : 0;
+
//CntntRects zu Start- und EndFrms.
SwRect aStRect, aEndRect;
pStartFrm->GetCharRect( aStRect, *pStartPos, &aTmpState );
Sw2LinesPos *pSt2Pos = aTmpState.p2Lines;
aTmpState.p2Lines = NULL;
+ aTmpState.nCursorBidiLevel = pEndFrm->IsRightToLeft() ? 1 : 0;
+
pEndFrm->GetCharRect ( aEndRect, *pEndPos, &aTmpState );
Sw2LinesPos *pEnd2Pos = aTmpState.p2Lines;
@@ -2074,9 +2077,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
pEndFrm->UnionFrm( sal_True ) );
if( pStartFrm != pEndFrm )
aEndFrm.Intersection( pEndFrm->PaintArea() );
-#ifdef VERTICAL_LAYOUT
SWRECTFN( pStartFrm )
- BOOL bR2L = pStartFrm->IsRightToLeft();
+ const BOOL bR2L = pStartFrm->IsRightToLeft();
+ const BOOL bEndR2L = pEndFrm->IsRightToLeft();
+
// If there's no doubleline portion involved or start and end are both
// in the same doubleline portion, all works fine, but otherwise
// we need the following...
@@ -2090,21 +2094,51 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
if( pSt2Pos )
{
SwRect aTmp( aStRect );
+
// BiDi-Portions are swimming against the current.
- BOOL bPorR2L = (MT_BIDI == pSt2Pos->nMultiType) ? !bR2L : bR2L;
- if( bPorR2L )
- (aTmp.*fnRect->fnSetLeft)(
- (pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
+ const sal_Bool bPorR2L = ( MT_BIDI == pSt2Pos->nMultiType ) ?
+ ! bR2L :
+ bR2L;
+
+ if( MT_BIDI == pSt2Pos->nMultiType &&
+ (pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
+ {
+ // nested bidi portion
+ long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
+ nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
+ long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
+
+ (aTmp.*fnRect->fnSetRight)( nRightAbs );
+
+ if ( ! pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion )
+ {
+ SwRect aTmp2( pSt2Pos->aPortion );
+ (aTmp2.*fnRect->fnSetRight)( nLeftAbs );
+ aTmp2.Intersection( aEndFrm );
+ Sub( aRegion, aTmp2 );
+ }
+ }
else
- (aTmp.*fnRect->fnSetRight)(
- (pSt2Pos->aPortion.*fnRect->fnGetRight)() );
+ {
+ if( bPorR2L )
+ (aTmp.*fnRect->fnSetLeft)(
+ (pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
+ else
+ (aTmp.*fnRect->fnSetRight)(
+ (pSt2Pos->aPortion.*fnRect->fnGetRight)() );
+ }
+
if( MT_ROT_90 == pSt2Pos->nMultiType ||
(pSt2Pos->aPortion.*fnRect->fnGetTop)() ==
(aTmp.*fnRect->fnGetTop)() )
+ {
(aTmp.*fnRect->fnSetTop)(
(pSt2Pos->aLine.*fnRect->fnGetTop)() );
+ }
+
aTmp.Intersection( aStFrm );
Sub( aRegion, aTmp );
+
SwTwips nTmp = (pSt2Pos->aLine.*fnRect->fnGetBottom)();
if( MT_ROT_90 != pSt2Pos->nMultiType &&
(aStRect.*fnRect->fnBottomDist)( nTmp ) > 0 )
@@ -2124,32 +2158,63 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
aTmp.Intersection( aStFrm );
Sub( aRegion, aTmp );
}
+
aStRect = pSt2Pos->aLine;
(aStRect.*fnRect->fnSetLeft)( bR2L ?
(pSt2Pos->aPortion.*fnRect->fnGetLeft)() :
(pSt2Pos->aPortion.*fnRect->fnGetRight)() );
(aStRect.*fnRect->fnSetWidth)( 1 );
}
+
if( pEnd2Pos )
{
SWRECTFN( pEndFrm )
SwRect aTmp( aEndRect );
- BOOL bEndR2L = pEndFrm->IsRightToLeft();
- BOOL bPorR2L = ( MT_BIDI == pEnd2Pos->nMultiType ) ?
- !bEndR2L : bEndR2L;
- if( bPorR2L )
- (aTmp.*fnRect->fnSetRight)(
- (pEnd2Pos->aPortion.*fnRect->fnGetRight)() );
+
+ // BiDi-Portions are swimming against the current.
+ const sal_Bool bPorR2L = ( MT_BIDI == pEnd2Pos->nMultiType ) ?
+ ! bEndR2L :
+ bEndR2L;
+
+ if( MT_BIDI == pEnd2Pos->nMultiType &&
+ (pEnd2Pos->aPortion2.*fnRect->fnGetWidth)() )
+ {
+ // nested bidi portion
+ long nRightAbs = (pEnd2Pos->aPortion.*fnRect->fnGetRight)();
+ nRightAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRect->fnGetLeft)();
+ long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRect->fnGetWidth)();
+
+ (aTmp.*fnRect->fnSetLeft)( nLeftAbs );
+
+ if ( ! pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion )
+ {
+ SwRect aTmp2( pEnd2Pos->aPortion );
+ (aTmp2.*fnRect->fnSetLeft)( nRightAbs );
+ aTmp2.Intersection( aEndFrm );
+ Sub( aRegion, aTmp2 );
+ }
+ }
else
- (aTmp.*fnRect->fnSetLeft)(
- (pEnd2Pos->aPortion.*fnRect->fnGetLeft)() );
+ {
+ if ( bPorR2L )
+ (aTmp.*fnRect->fnSetRight)(
+ (pEnd2Pos->aPortion.*fnRect->fnGetRight)() );
+ else
+ (aTmp.*fnRect->fnSetLeft)(
+ (pEnd2Pos->aPortion.*fnRect->fnGetLeft)() );
+ }
+
if( MT_ROT_90 == pEnd2Pos->nMultiType ||
(pEnd2Pos->aPortion.*fnRect->fnGetBottom)() ==
(aEndRect.*fnRect->fnGetBottom)() )
+ {
(aTmp.*fnRect->fnSetBottom)(
(pEnd2Pos->aLine.*fnRect->fnGetBottom)() );
+ }
+
aTmp.Intersection( aEndFrm );
Sub( aRegion, aTmp );
+
// The next statement means neither ruby nor rotate(90):
if( !( MT_RUBY & pEnd2Pos->nMultiType ) )
{
@@ -2171,6 +2236,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
Sub( aRegion, aTmp );
}
}
+
aEndRect = pEnd2Pos->aLine;
(aEndRect.*fnRect->fnSetLeft)( bEndR2L ?
(pEnd2Pos->aPortion.*fnRect->fnGetRight)() :
@@ -2178,62 +2244,50 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
(aEndRect.*fnRect->fnSetWidth)( 1 );
}
}
-#else
- if( pSt2Pos != pEnd2Pos && ( !pSt2Pos || !pEnd2Pos ||
- pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
+ else if( pSt2Pos && pEnd2Pos &&
+ MT_BIDI == pSt2Pos->nMultiType &&
+ MT_BIDI == pEnd2Pos->nMultiType &&
+ pSt2Pos->aPortion == pEnd2Pos->aPortion &&
+ pSt2Pos->aPortion2 != pEnd2Pos->aPortion2 )
{
- // If we have a start(end) position inside a doubleline portion
- // the surrounded part of the doubleline portion is subtracted
- // from the region and the aStRect(aEndRect) is set to the
- // end(start) of the doubleline portion.
- if( pSt2Pos )
+ // This is the ugly special case, where the selection starts and
+ // ends in the same bidi portion but one start or end is inside a
+ // nested bidi portion.
+
+ if ( (pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
{
- SwRect aTmp( aStRect.Pos(),
- Point( pSt2Pos->aPortion.Right(), aStRect.Bottom() ) );
- if( MT_ROT_90 == pSt2Pos->nMultiType ||
- pSt2Pos->aPortion.Top() == aTmp.Top() )
- aTmp.Top( pSt2Pos->aLine.Top() );
+ SwRect aTmp( aStRect );
+ long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
+ nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
+ long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
+
+ (aTmp.*fnRect->fnSetRight)( nRightAbs );
aTmp.Intersection( aStFrm );
Sub( aRegion, aTmp );
- if( MT_ROT_90 != pSt2Pos->nMultiType &&
- aStRect.Bottom() < pSt2Pos->aLine.Bottom() )
- {
- aTmp.Top( aTmp.Bottom() );
- aTmp.Bottom( pSt2Pos->aLine.Bottom() );
- if( aStRect.Bottom() < pSt2Pos->aPortion.Bottom() )
- aTmp.Left( pSt2Pos->aPortion.Left() );
- aTmp.Intersection( aStFrm );
- Sub( aRegion, aTmp );
- }
- aStRect = SwRect( Point( pSt2Pos->aPortion.Right(),
- pSt2Pos->aLine.Top()), Size(1,pSt2Pos->aLine.Height()));
+
+ aStRect = pSt2Pos->aLine;
+ (aStRect.*fnRect->fnSetLeft)( bR2L ? nRightAbs : nLeftAbs );
+ (aStRect.*fnRect->fnSetWidth)( 1 );
}
- if( pEnd2Pos )
+
+ SWRECTFN( pEndFrm )
+ if ( (pEnd2Pos->aPortion2.*fnRect->fnGetWidth)() )
{
- SwRect aTmp(Point(pEnd2Pos->aPortion.Left(),aEndRect.Top()),
- Point( aEndRect.Left() + aEndRect.Width(),
- aEndRect.Top() + aEndRect.Height() ) );
- if( MT_ROT_90 == pEnd2Pos->nMultiType ||
- pEnd2Pos->aPortion.Bottom() == aEndRect.Bottom() )
- aTmp.Bottom( pEnd2Pos->aLine.Bottom() );
+ SwRect aTmp( aEndRect );
+ long nRightAbs = (pEnd2Pos->aPortion.*fnRect->fnGetRight)();
+ nRightAbs -= (pEnd2Pos->aPortion2.*fnRect->fnGetLeft)();
+ long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRect->fnGetWidth)();
+
+ (aTmp.*fnRect->fnSetLeft)( nLeftAbs );
aTmp.Intersection( aEndFrm );
Sub( aRegion, aTmp );
- if( !( MT_RUBY & pEnd2Pos->nMultiType ) &&
- aEndRect.Top() > pEnd2Pos->aLine.Top() )
- {
- aTmp.Bottom( aTmp.Top() );
- aTmp.Top( pEnd2Pos->aLine.Top() );
- if( aEndRect.Top() > pEnd2Pos->aPortion.Top() )
- aTmp.Right( pEnd2Pos->aPortion.Right() );
- aTmp.Intersection( aEndFrm );
- Sub( aRegion, aTmp );
- }
- aEndRect = SwRect( Point( pEnd2Pos->aPortion.Left(),
- pEnd2Pos->aLine.Top() ),
- Size( 1, pEnd2Pos->aLine.Height() ) );
+
+ aEndRect = pEnd2Pos->aLine;
+ (aEndRect.*fnRect->fnSetLeft)( bEndR2L ? nLeftAbs : nRightAbs );
+ (aEndRect.*fnRect->fnSetWidth)( 1 );
}
}
-#endif
+
// The charrect may be outside the paintarea (for cursortravelling)
// but the selection has to be restricted to the paintarea
if( aStRect.Left() < aStFrm.Left() )
@@ -2255,7 +2309,6 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
else if( nTmp > aEndFrm.Right() )
aEndRect.Right( aEndFrm.Right() );
-#ifdef VERTICAL_LAYOUT
if( pStartFrm == pEndFrm )
{
sal_Bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
@@ -2412,7 +2465,6 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
//At least the endframe...
bVert = pEndFrm->IsVertical();
bRev = pEndFrm->IsReverse();
- bR2L = pEndFrm->IsRightToLeft();
fnRect = bVert ? ( bRev ? fnRectVL2R : fnRectVert ) :
( bRev ? fnRectB2T : fnRectHori );
nTmp = (aEndRect.*fnRect->fnGetTop)();
@@ -2423,147 +2475,13 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
Sub( aRegion, aSubRect );
}
aSubRect = aEndRect;
- if( bR2L )
+ if( bEndR2L )
(aSubRect.*fnRect->fnSetRight)((aEndFrm.*fnRect->fnGetRight)());
else
(aSubRect.*fnRect->fnSetLeft)( (aEndFrm.*fnRect->fnGetLeft)() );
Sub( aRegion, aSubRect );
}
-#else
- if( pStartFrm == pEndFrm )
- {
- sal_Bool bSameRotatedLine =
- pSt2Pos && pEnd2Pos && ( 2 & pSt2Pos->nMultiType ) &&
- pSt2Pos->aPortion == pEnd2Pos->aPortion;
- //Fall 1: (Gleicher Frame und gleiche Zeile)
- if( aStRect.Top() == aEndRect.Top() || bSameRotatedLine )
- {
- Point aTmpSt( aStRect.Pos() );
- Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() );
- if( bSameRotatedLine && aTmpSt.Y() > aTmpEnd.Y() )
- {
- long nTmpY = aTmpEnd.Y();
- aTmpEnd.Y() = aTmpSt.Y();
- aTmpSt.Y() = nTmpY;
- }
- SwRect aTmp = SwRect( aTmpSt, aTmpEnd );
- // Bug 34888: falls Inhalt selektiert ist, der keinen Platz
- // einnimmt (z.B. PostIts,RefMarks, TOXMarks),
- // dann mindestens die Breite des Crsr setzen.
- if( 1 == aTmp.Width() && pStartPos->nContent.GetIndex() !=
- pEndPos->nContent.GetIndex() )
- {
- OutputDevice* pOut = pSh->GetOut();
- long nCrsrWidth = pOut->GetSettings().GetStyleSettings().
- GetCursorSize();
- aTmp.Width( pOut->PixelToLogic( Size( nCrsrWidth, 0 ) ).Width() );
- }
- aTmp.Intersection( aStFrm );
- Sub( aRegion, aTmp );
- }
- //Fall 2: (Gleicher Frame ueber mehr als eine Zeile)
- else
- {
- SwTwips lLeft, lRight;
- if( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion )
- {
- lLeft = pSt2Pos->aPortion.Left();
- lRight = pSt2Pos->aPortion.Right();
- }
- else
- {
- lLeft = pStartFrm->Frm().Left() + pStartFrm->Prt().Left();
- lRight = pStartFrm->Frm().Left() + pStartFrm->Prt().Right();
- }
- if( lLeft < aStFrm.Left() )
- lLeft = aStFrm.Left();
- if( lRight > aStFrm.Right() )
- lRight = aStFrm.Right();
- //Erste Zeile
- Sub( aRegion, SwRect( aStRect.Pos(),Point( lRight, aStRect.Bottom())));
-
- //Wenn mindestens ein Twips zwischen Start- und Endzeile liegt,
- //so wird halt alles dazwischenliegende mit aufgenommen.
- if( (aStRect.Pos().Y()+aStRect.SSize().Height()) != aEndRect.Top() )
- Sub( aRegion, SwRect( Point( lLeft,
- (aStRect.Pos().Y()+aStRect.SSize().Height()) ),
- Point( lRight, aEndRect.Top()-1 )));
-
- //und die letzte Zeile
- Sub( aRegion, SwRect( Point( lLeft, aEndRect.Top() ),
- Point( aEndRect.Left(), aEndRect.Bottom() )));
- }
- }
- //Fall 3: (Unterschiedliche Frm's, moeglicherweise auch welche
- // dazwischen)
- else
- {
- //Erst den StartFrm verknurpseln...
- Sub( aRegion, SwRect( aStRect.Pos(),
- Point( aStFrm.Right(), aStRect.Bottom())));
-
- if( aStFrm.Bottom() != aStRect.Bottom() )
- Sub( aRegion, SwRect( Point( aStFrm.Left(),
- (aStRect.Pos().Y()+aStRect.SSize().Height()) ),
- Point( aStFrm.Right(), aStFrm.Bottom() )));
-
- //Nun alles dazwischenliegende (kann auch nix sein)...
- BOOL bBody = pStartFrm->IsInDocBody();
- const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
- SwRect aPrvRect;
-
-// JP - 24.11.93:
-// wie kann man die Schleife noch optimieren, damit nur die Frames, die
-// in der VisArea liegen, beachtet werden
-
- while ( pCntnt != pEndFrm )
- {
- if ( pCntnt->IsInFly() )
- {
- const SdrObjectPtr pObj = (SdrObject*)pCntnt->FindFlyFrm()->GetVirtDrawObj();
- aSortObjs.Insert( pObj );
- }
-
- //Wenn ich im DocumentBody war, so beachte ich nur Frm's
- //die im Body liegen und umgekehrt.
- if ( bBody == pCntnt->IsInDocBody() )
- {
- SwRect aCRect( pCntnt->UnionFrm( sal_True ) );
- aCRect.Intersection( pCntnt->PaintArea() );
- if( aCRect.IsOver( aRegion.GetOrigin() ))
- {
- SwRect aTmp( aPrvRect );
- aTmp.Union( aCRect );
- if ( (aPrvRect.Height() * aPrvRect.Width() +
- aCRect.Height() * aCRect.Width()) ==
- (aTmp.Height() * aTmp.Width()) )
- {
- aPrvRect.Union( aCRect );
- }
- else
- {
- if ( aPrvRect.HasArea() )
- Sub( aRegion, aPrvRect );
- aPrvRect = aCRect;
- }
- }
- }
- pCntnt = pCntnt->GetNextCntntFrm();
- }
- if ( aPrvRect.HasArea() )
- Sub( aRegion, aPrvRect );
-
- //Jetzt den EndFrm...
- if ( aEndFrm.Top() != aEndRect.Top() )
- Sub( aRegion, SwRect( aEndFrm.Pos(),
- Point( aEndFrm.Right(), aEndRect.Top()-1 ) ));
-
- Sub( aRegion, SwRect( aEndFrm.Pos(),
- Point( aEndRect.Left(), aEndRect.Bottom() )));
-
- }
-#endif
// aRegion.Compress( FALSE );
aRegion.Invert();
delete pSt2Pos;
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index e5c0617ab824..412d29d86a43 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wsfrm.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: fme $ $Date: 2002-12-09 10:37:56 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -916,6 +916,15 @@ void SwCntntFrm::Paste( SwFrm* pParent, SwFrm* pSibling)
GetPrev()->Prt().Height() + GetPrev()->Prt().Top() )
//Umrandung zu beruecksichtigen?
GetPrev()->_InvalidatePrt();
+ // OD 18.02.2003 #104989# - force complete paint of previous frame,
+ // if frame is inserted at the end of a section frame, in order to
+ // get subsidiary lines repainted for the section.
+ if ( pParent->IsSctFrm() && !GetNext() )
+ {
+ // force complete paint of previous frame, if new inserted frame
+ // in the section is the last one.
+ GetPrev()->SetCompletePaint();
+ }
GetPrev()->InvalidatePage( pPage );
}
}
@@ -3287,19 +3296,21 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
SwTwips nWidth = rCol.CalcColWidth( i, nPrtWidth );
if ( i == (nNumCols - 1) ) //Dem Letzten geben wir wie
nWidth = nAvail; //immer den Rest.
- nWidth -= (pCol->Frm().*fnRect->fnGetWidth)();
- if( nWidth )
+
+ SwTwips nWidthDiff = nWidth - (pCol->Frm().*fnRect->fnGetWidth)();
+ if( nWidthDiff )
{
- (pCol->Frm().*fnRect->fnAddBottom)( nWidth );
+ (pCol->Frm().*fnRect->fnAddRight)( nWidthDiff );
pCol->_InvalidatePrt();
if ( pCol->GetNext() )
pCol->GetNext()->_InvalidatePos();
}
- nWidth = (Prt().*fnRect->fnGetHeight)() -
- (pCol->Frm().*fnRect->fnGetHeight)();
- if( nWidth )
+
+ SwTwips nHeightDiff = (Prt().*fnRect->fnGetHeight)() -
+ (pCol->Frm().*fnRect->fnGetHeight)();
+ if( nHeightDiff )
{
- (pCol->Frm().*fnRect->fnAddBottom)( nWidth );
+ (pCol->Frm().*fnRect->fnAddBottom)( nHeightDiff );
pCol->_InvalidatePrt();
}
pCol->Calc();
@@ -3348,8 +3359,8 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
pLay = (SwLayoutFrm*)pLay->GetNext();
ASSERT( pLay->IsFtnContFrm(),"FtnContainer exspected" );
nInnerHeight += pLay->InnerHeight();
- nInnerHeight = (pLay->Frm().*fnRect->fnGetHeight)() -
- (pLay->Prt().*fnRect->fnGetHeight)();
+ nInnerHeight += (pLay->Frm().*fnRect->fnGetHeight)() -
+ (pLay->Prt().*fnRect->fnGetHeight)();
}
nInnerHeight -= (pCol->Prt().*fnRect->fnGetHeight)();
if( nInnerHeight > nDiff )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 691b069848ad..2cc96f1c9420 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmcrsr.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:28:13 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,6 +95,7 @@
#include <pormulti.hxx> // SwMultiPortion
#endif
+#include <unicode/ubidi.h>
#include "frmsh.hxx"
#include "txtcfg.hxx"
@@ -604,12 +605,6 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
while( aLine.GetLineNr() > 1 )
aLine.Prev();
- // Set the cursor bidi level to the default level. If the cursor is
- // inside a bidi portion, the level is set again inside the
- // GetCrsrOfst function.
- if ( pCMS )
- ((SwCrsrMoveState*)pCMS)->nCursorBidiLevel = IsRightToLeft() ? 1 : 0;
-
xub_StrLen nOffset = aLine.GetCrsrOfst( pPos, rPoint, bChgFrm, pCMS );
if( pCMS && pCMS->eState == MV_NONE && aLine.GetEnd() == nOffset )
@@ -954,27 +949,12 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
// nPos: the new visual position
// bLeft: whether the break iterator has to add or subtract from the
// current position
-void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
- sal_Bool& bRight )
+void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, xub_StrLen nIdx,
+ xub_StrLen& nPos, sal_Bool& bRight,
+ BYTE& nCrsrLevel, BYTE nDefaultDir )
{
- if( IsEmpty() || IsHiddenNow() )
- return;
-
- ((SwTxtFrm*)this)->GetFormatted();
-
- SwTxtSizeInfo aInf( (SwTxtFrm*)this );
- SwTxtCursor aLine( ((SwTxtFrm*)this), &aInf );
-
- if( nPos )
- aLine.CharCrsrToLine( nPos );
- else
- aLine.Top();
-
- const SwLineLayout* pCurrLine = aLine.GetCurr();
- const SwLinePortion* pPor = pCurrLine->GetFirstPortion();
+ const SwLinePortion* pPor = rCurrLine.GetFirstPortion();
const SwLinePortion* pLast = 0;
- const BYTE nDefaultDir = IsRightToLeft() ? 1 : 0;
- USHORT nIdx = aLine.GetStart();
// what's the current portion
while ( pPor && nIdx + pPor->GetLen() <= nPos )
@@ -984,135 +964,240 @@ void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
pPor = pPor->GetPortion();
}
- xub_StrLen nNewPos = 0;
- BYTE nNewCrsrLevel = nCrsrLevel;
- sal_Bool bForward = bRight;
-
if ( bRight )
{
- // 1. jump case, at beginning of bidi portion
- if ( pPor && pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() &&
- nIdx == nPos )
+ sal_Bool bRecurse = pPor && pPor->IsMultiPortion() &&
+ ((SwMultiPortion*)pPor)->IsBidi();
+
+ // 1. special case: at beginning of bidi portion
+ if ( bRecurse && nIdx == nPos )
{
- nNewPos = nPos + pPor->GetLen();
+ nPos += pPor->GetLen();
- // enter bidi portion
- if ( nCrsrLevel == nDefaultDir )
- {
- bForward = sal_False;
- nNewCrsrLevel = ((SwBidiPortion*)pPor)->GetLevel();
- }
// leave bidi portion
- else
+ if ( nCrsrLevel != nDefaultDir )
{
- bForward = sal_True;
- nNewCrsrLevel = nDefaultDir;
+ bRecurse = sal_False;
}
+ else
+ // special case:
+ // buffer: abcXYZ123 in LTR paragraph
+ // view: abc123ZYX
+ // cursor is between c and X in the buffer and cursor level = 0
+ nCrsrLevel++;
}
- // 2. jump case, at beginning of portion after bidi portion
- else if ( pLast && pLast->IsMultiPortion() && ((SwMultiPortion*)pLast)->IsBidi() &&
- nIdx == nPos )
+ // 2. special case: at beginning of portion after bidi portion
+ else if ( pLast && pLast->IsMultiPortion() &&
+ ((SwMultiPortion*)pLast)->IsBidi() && nIdx == nPos )
{
- nNewPos = nPos;
-
// enter bidi portion
if ( nCrsrLevel != nDefaultDir )
{
- bForward = sal_False;
- nNewCrsrLevel = ((SwBidiPortion*)pLast)->GetLevel();
- }
- else
- {
- bForward = sal_True;
- nNewCrsrLevel = nDefaultDir;
+ bRecurse = sal_True;
+ nIdx -= pLast->GetLen();
+ pPor = pLast;
}
}
- // go backward
- else if ( pPor && pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
+ // Recursion
+ if ( bRecurse )
{
- nNewPos = nPos;
- bForward = sal_False;
- nNewCrsrLevel = ((SwBidiPortion*)pPor)->GetLevel();
+ const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot();
+ xub_StrLen nTmpPos = nPos - nIdx;
+ sal_Bool bTmpForward = ! bRight;
+ BYTE nTmpCrsrLevel = nCrsrLevel;
+ lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
+ nTmpCrsrLevel, nDefaultDir + 1 );
+
+ nPos = nTmpPos + nIdx;
+ bRight = bTmpForward;
+ nCrsrLevel = nTmpCrsrLevel;
}
-
// go forward
- else //if ( pPor && ( ! pPor->IsMultiPortion() || ! ((SwMultiPortion*)pPor)->IsBidi() ) )
+ else
{
- nNewPos = nPos;
- bForward = sal_True;
- nNewCrsrLevel = nDefaultDir;
+ bRight = sal_True;
+ nCrsrLevel = nDefaultDir;
}
}
else
{
- // 1. jump case, at beginning of bidi portion
- if ( pPor && pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() &&
- nIdx == nPos )
- {
- nNewPos = nPos;
+ sal_Bool bRecurse = pPor && pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi();
+ // 1. special case: at beginning of bidi portion
+ if ( bRecurse && nIdx == nPos )
+ {
// leave bidi portion
if ( nCrsrLevel == nDefaultDir )
{
- bForward = sal_False;
- nNewCrsrLevel = nDefaultDir;
- }
- // enter bidi portion
- else
- {
- bForward = sal_True;
- nNewCrsrLevel = ((SwBidiPortion*)pPor)->GetLevel();
+ bRecurse = sal_False;
}
}
- // 2. jump case, at beginning of portion after bidi portion
- else if ( pLast && pLast->IsMultiPortion() && ((SwMultiPortion*)pLast)->IsBidi() &&
- nIdx == nPos )
+ // 2. special case: at beginning of portion after bidi portion
+ else if ( pLast && pLast->IsMultiPortion() &&
+ ((SwMultiPortion*)pLast)->IsBidi() && nIdx == nPos )
{
- nNewPos = nPos - pLast->GetLen();
+ nPos -= pLast->GetLen();
// enter bidi portion
- if ( nCrsrLevel != nDefaultDir )
+ if ( nCrsrLevel % 2 == nDefaultDir % 2 )
{
- bForward = sal_False;
- nNewCrsrLevel = nDefaultDir;
+ bRecurse = sal_True;
+ nIdx -= pLast->GetLen();
+ pPor = pLast;
+
+ // special case:
+ // buffer: abcXYZ123 in LTR paragraph
+ // view: abc123ZYX
+ // cursor is behind 3 in the buffer and cursor level = 2
+ if ( nDefaultDir + 2 == nCrsrLevel )
+ nPos += pLast->GetLen();
}
- else
+ }
+
+ // go forward
+ if ( bRecurse )
+ {
+ const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot();
+ xub_StrLen nTmpPos = nPos - nIdx;
+ sal_Bool bTmpForward = ! bRight;
+ BYTE nTmpCrsrLevel = nCrsrLevel;
+ lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward,
+ nTmpCrsrLevel, nDefaultDir + 1 );
+
+ // special case:
+ // buffer: abcXYZ123 in LTR paragraph
+ // view: abc123ZYX
+ // cursor is between Z and 1 in the buffer and cursor level = 2
+ if ( nTmpPos == pPor->GetLen() && nTmpCrsrLevel == nDefaultDir + 1 )
{
- bForward = sal_True;
- nNewCrsrLevel = ((SwBidiPortion*)pLast)->GetLevel();
+ nTmpPos -= pPor->GetLen();
+ nTmpCrsrLevel = nDefaultDir;
+ bTmpForward = ! bTmpForward;
}
+
+ nPos = nTmpPos + nIdx;
+ bRight = bTmpForward;
+ nCrsrLevel = nTmpCrsrLevel;
}
// go backward
- else if ( pPor && pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
+ else
{
- nNewPos = nPos;
- bForward = sal_True;
- nNewCrsrLevel = ((SwBidiPortion*)pPor)->GetLevel();
+ bRight = sal_False;
+ nCrsrLevel = nDefaultDir;
}
+ }
+}
- // bo forward
- else //if ( pPor && ( ! pPor->IsMultiPortion() || ! ((SwMultiPortion*)pPor)->IsBidi() ) )
+void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, BYTE& nCrsrLevel,
+ sal_Bool& bForward, sal_Bool bInsertCrsr )
+{
+ if( IsEmpty() || IsHiddenNow() )
+ return;
+
+ ((SwTxtFrm*)this)->GetFormatted();
+
+ SwTxtSizeInfo aInf( (SwTxtFrm*)this );
+ SwTxtCursor aLine( ((SwTxtFrm*)this), &aInf );
+
+ if( nPos )
+ aLine.CharCrsrToLine( nPos );
+ else
+ aLine.Top();
+
+ const SwLineLayout* pLine = aLine.GetCurr();
+ const xub_StrLen nStt = aLine.GetStart();
+ const xub_StrLen nLen = pLine->GetLen();
+
+ // We have to distinguish between an insert and overwrite cursor:
+ // The insert cursor position depends on the cursor level:
+ // buffer: abcXYZdef in LTR paragraph
+ // display: abcZYXdef
+ // If cursor is between c and X in the buffer and cursor level is 0,
+ // the cursor blinks between c and Z and -> sets the cursor between Z and Y.
+ // If the cursor level is 1, the cursor blinks between X and d and
+ // -> sets the cursor between d and e.
+ // The overwrite cursor simply travels to the next visual character.
+ if ( bInsertCrsr )
+ {
+ lcl_VisualMoveRecursion( *pLine, nStt, nPos, bForward,
+ nCrsrLevel, IsRightToLeft() ? 1 : 0 );
+ return;
+ }
+
+ const BYTE nDefaultDir = IsRightToLeft() ? UBIDI_RTL : UBIDI_LTR;
+ const sal_Bool bVisualRight = ( nDefaultDir == UBIDI_LTR && bForward ) ||
+ ( nDefaultDir == UBIDI_RTL && ! bForward );
+
+ //
+ // Bidi functions from icu 2.0
+ //
+ const sal_Unicode* pLineString = GetTxtNode()->GetTxt().GetBuffer();
+ pLine += nStt;
+
+ UErrorCode nError = U_ZERO_ERROR;
+ UBiDi* pBidi = ubidi_openSized( nLen, 0, &nError );
+ ubidi_setPara( pBidi, pLineString, nLen, nDefaultDir, NULL, &nError );
+
+ xub_StrLen nTmpPos;
+ sal_Bool bOutOfBounds = sal_False;
+
+ if ( nPos < nStt + nLen )
+ {
+ nTmpPos = (xub_StrLen)ubidi_getVisualIndex( pBidi, nPos, &nError );
+
+ // visual indices are always LTR aligned
+ if ( bVisualRight )
+ {
+ if ( nTmpPos + 1 < nStt + nLen )
+ ++nTmpPos;
+ else
+ {
+ nPos = nDefaultDir == UBIDI_RTL ? 0 : nStt + nLen;
+ bOutOfBounds = sal_True;
+ }
+ }
+ else
{
- nNewPos = nPos;
- bForward = sal_False;
- nNewCrsrLevel = nDefaultDir;
+ if ( nTmpPos )
+ --nTmpPos;
+ else
+ {
+ nPos = nDefaultDir == UBIDI_RTL ? nStt + nLen : 0;
+ bOutOfBounds = sal_True;
+ }
}
}
+ else
+ {
+ nTmpPos = nDefaultDir == UBIDI_LTR ? nPos - 1 : 0;
+ }
- ASSERT( 0 <= nNewPos && ( nNewPos <= GetTxtNode()->GetTxt().Len() || ! bForward ),
- "ConvertLogic2Visual failed" )
+ if ( ! bOutOfBounds )
+ {
+ nPos = (xub_StrLen)ubidi_getLogicalIndex( pBidi, nTmpPos, &nError );
- nPos = nNewPos;
- nCrsrLevel = nNewCrsrLevel;
- bRight = bForward;
-}
+ if ( bForward )
+ {
+ if ( nPos )
+ --nPos;
+ else
+ {
+ ++nPos;
+ bForward = ! bForward;
+ }
+ }
+ else
+ ++nPos;
+ }
+ ubidi_close( pBidi );
+}
/*************************************************************************
* SwTxtFrm::_UnitDown()
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index d6ccdf242631..56f45c7920f3 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmform.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: fme $ $Date: 2002-11-22 15:58:40 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2333,6 +2333,11 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
ChgThisLines();
+ // the PrepMustFit should not survive a Format operation
+ SwParaPortion *pPara = GetPara();
+ if ( pPara )
+ pPara->SetPrepMustFit( sal_False );
+
#ifdef DEBUG
// Hier ein Instrumentarium, um ungewoehnlichen Master/Follow-Kombinationen,
// insbesondere bei Fussnoten, auf die Schliche zu kommen
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 0364f41f42b9..aaf771c979f7 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmpaint.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: fme $ $Date: 2002-12-10 11:05:01 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,9 @@
#ifndef _SVX_PGRDITEM_HXX
#include <svx/pgrditem.hxx>
#endif
+#ifndef _SVX_LRSPITEM_HXX //autogen
+#include <svx/lrspitem.hxx>
+#endif
#ifndef _PAGEDESC_HXX
#include <pagedesc.hxx> // SwPageDesc
#endif
@@ -566,7 +569,8 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
SwRect aRect;
if( bCheck && aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) )
return sal_False;
- else if( OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() )
+ else if( OUTDEV_PRINTER != pSh->GetOut()->GetOutDevType() &&
+ ! pSh->GetViewOptions()->IsPDFExport() )
{
SwFont *pFnt;
const SwTxtNode& rTxtNode = *GetTxtNode();
@@ -617,6 +621,13 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
pFnt->Invalidate();
pFnt->ChgPhysFnt( pSh, pSh->GetOut() );
Point aPos = Frm().Pos() + Prt().Pos();
+
+ const SvxLRSpaceItem &rSpace =
+ GetTxtNode()->GetSwAttrSet().GetLRSpace();
+
+ if ( rSpace.GetTxtFirstLineOfst() > 0 )
+ aPos.X() += rSpace.GetTxtFirstLineOfst();
+
SwSaveClip *pClip;
if( IsUndersized() )
{
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 659e5f4c14b5..f1890f35d8fc 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inftxt.cxx,v $
*
- * $Revision: 1.83 $
+ * $Revision: 1.84 $
*
- * last change: $Author: fme $ $Date: 2002-12-10 09:35:40 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -203,7 +203,8 @@ using namespace ::com::sun::star::beans;
// steht im number.cxx
extern const sal_Char __FAR_DATA sBulletFntName[];
-extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
+// OD 24.01.2003 #106593# - no longer needed, included in <frmtool.hxx>
+//extern void MA_FASTCALL SwAlignRect( SwRect &rRect, ViewShell *pSh );
#ifndef PRODUCT
// Test2: WYSIWYG++
@@ -1650,6 +1651,7 @@ sal_Bool SwTxtFormatInfo::_CheckFtnPortion( SwLineLayout* pCurr )
{
bRet = sal_True;
SetLineHeight( nHeight );
+ SetLineNettoHeight( pCurr->Height() );
break;
}
pPor = pPor->GetPortion();
@@ -1664,14 +1666,17 @@ sal_Bool SwTxtFormatInfo::_CheckFtnPortion( SwLineLayout* pCurr )
* SwTxtFormatInfo::ScanPortionEnd()
*************************************************************************/
xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
- const xub_StrLen nEnd,
- sal_Bool bSkip )
+ const xub_StrLen nEnd )
{
cHookChar = 0;
const xub_Unicode cTabDec = GetLastTab() ? (sal_Unicode)GetTabDecimal() : 0;
xub_StrLen i = nStart;
- if ( bSkip && i < nEnd )
- ++i;
+
+ // 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 )
{
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index b7f97bbc6221..3c348554826e 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inftxt.hxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: fme $ $Date: 2002-11-14 08:55:04 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:40:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -759,8 +759,7 @@ public:
// Sucht ab nIdx bis nEnd nach Tabs, TabDec, TXTATR und BRK.
// Return: gefundene Position, setzt ggf. cHookChar
- xub_StrLen ScanPortionEnd( const xub_StrLen nStart, const xub_StrLen nEnd,
- sal_Bool bSkip = sal_False );
+ xub_StrLen ScanPortionEnd( const xub_StrLen nStart, const xub_StrLen nEnd );
// friend ostream &operator<<( ostream &rOS, const SwTxtFormatInfo &rInf );
friend SvStream &operator<<( SvStream &rOS, const SwTxtFormatInfo &rInf );
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 5e250674029e..d5a4b2e55cf8 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: itrcrsr.cxx,v $
*
- * $Revision: 1.53 $
+ * $Revision: 1.54 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:28:13 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -516,6 +516,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
SwTwips nX = 0;
SwTwips nFirst = 0;
SwLinePortion *pPor = pCurr->GetFirstPortion();
+ SwBidiPortion* pLastBidiPor = 0;
SvShorts* pSpaceAdd = pCurr->GetpSpaceAdd();
SvUShorts* pKanaComp = pCurr->GetpKanaComp();
MSHORT nSpaceIdx = 0;
@@ -605,8 +606,16 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nPorHeight = pPor->Height();
nPorAscent = pPor->GetAscent();
}
- if ( aInf.GetIdx() + pPor->GetLen() < nOfst +
- ( pPor->IsMultiPortion() && !bWidth ? 0 : 1 ) )
+
+ // If we are behind the portion, we add the portion width to
+ // nX. Special case: nOfst = aInf.GetIdx() + pPor->GetLen().
+ // For common portions (including BidiPortions) we want to add
+ // the portion width to nX. For MultiPortions, nExtra = 0,
+ // therefore we go to the 'else' branch and start a recursion.
+ const BYTE nExtra = pPor->IsMultiPortion() &&
+ ! ((SwMultiPortion*)pPor)->IsBidi() &&
+ ! bWidth ? 0 : 1;
+ if ( aInf.GetIdx() + pPor->GetLen() < nOfst + nExtra )
{
if ( pPor->InSpaceGrp() && nSpaceAdd )
nX += pPor->PrtWidth() +
@@ -633,19 +642,29 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
!pPor->GetPortion()->IsMarginPortion() ) )
nX += pPor->PrtWidth();
}
- if( pPor->IsMultiPortion() &&
- ((SwMultiPortion*)pPor)->HasTabulator() )
+ if( pPor->IsMultiPortion() )
{
- if ( pSpaceAdd )
+ if ( ((SwMultiPortion*)pPor)->HasTabulator() )
{
- if ( ++nSpaceIdx < pSpaceAdd->Count() )
- nSpaceAdd = (*pSpaceAdd)[nSpaceIdx];
- else
- nSpaceAdd = 0;
+ if ( pSpaceAdd )
+ {
+ if ( ++nSpaceIdx < pSpaceAdd->Count() )
+ nSpaceAdd = (*pSpaceAdd)[nSpaceIdx];
+ else
+ nSpaceAdd = 0;
+ }
+
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ ++nKanaIdx;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
- ++nKanaIdx;
+ // if we are right behind a BidiPortion, we have to
+ // hold a pointer to the BidiPortion in order to
+ // find the correct cursor position, depending on the
+ // cursor level
+ if ( ((SwMultiPortion*)pPor)->IsBidi() &&
+ aInf.GetIdx() + pPor->GetLen() == nOfst )
+ pLastBidiPor = (SwBidiPortion*)pPor;
}
aInf.SetIdx( aInf.GetIdx() + pPor->GetLen() );
@@ -666,8 +685,14 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
if( pCMS && pCMS->b2Lines )
{
- pCMS->p2Lines = new Sw2LinesPos();
- pCMS->p2Lines->aLine = SwRect(aCharPos, aCharSize);
+ sal_Bool bRecursion = sal_True;
+ if ( ! pCMS->p2Lines )
+ {
+ pCMS->p2Lines = new Sw2LinesPos;
+ pCMS->p2Lines->aLine = SwRect(aCharPos, aCharSize);
+ bRecursion = sal_False;
+ }
+
if( ((SwMultiPortion*)pPor)->HasRotation() )
{
if( ((SwMultiPortion*)pPor)->IsRevers() )
@@ -677,18 +702,22 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
}
else if( ((SwMultiPortion*)pPor)->IsDouble() )
pCMS->p2Lines->nMultiType = MT_TWOLINE;
-#ifdef BIDI
else if( ((SwMultiPortion*)pPor)->IsBidi() )
pCMS->p2Lines->nMultiType = MT_BIDI;
-#endif
else
pCMS->p2Lines->nMultiType = MT_RUBY;
+
SwTwips nTmpWidth = pPor->Width();
if( nSpaceAdd )
nTmpWidth += pPor->CalcSpacing(nSpaceAdd, aInf);
- pCMS->p2Lines->aPortion =
- SwRect( Point(aCharPos.X() + nX, pOrig->Top()),
- Size( nTmpWidth, pPor->Height() ) );
+
+ SwRect aRect( Point(aCharPos.X() + nX, pOrig->Top() ),
+ Size( nTmpWidth, pPor->Height() ) );
+
+ if ( ! bRecursion )
+ pCMS->p2Lines->aPortion = aRect;
+ else
+ pCMS->p2Lines->aPortion2 = aRect;
}
// In a multi-portion we use GetCharRect()-function
@@ -859,22 +888,6 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
const SwTwips nInsideOfst = pOrig->Pos().X();
pOrig->Pos().X() = nX + nPorWidth -
nInsideOfst - pOrig->Width();
- if ( nInsideOfst == nPorWidth )
- {
- // logical position is behind multi portion
- USHORT nDefaultDir = GetTxtFrm()->IsRightToLeft() ?
- 1 : 0;
- if ( pCMS &&
- pCMS->nCursorBidiLevel == nDefaultDir )
- pOrig->Pos().X() += nPorWidth;
-
- // actually we are not in a bidi portion
- if ( pCMS && pCMS->p2Lines )
- {
- delete pCMS->p2Lines;
- pCMS->p2Lines = 0;
- }
- }
}
else
pOrig->Pos().X() += nX;
@@ -1080,19 +1093,6 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
pOrig->Width( nTmp );
}
- if ( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
- {
- // logical position is at beginning of bidi portion
- // we determine if the cursor has to blink before or behind
- // the bidi portion
- USHORT nDefaultDir = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
- if ( pCMS->nCursorBidiLevel != nDefaultDir )
- {
- pOrig->Pos().X() += pPor->Width() +
- pPor->CalcSpacing( nSpaceAdd, aInf );
- }
- }
-
// travel inside field portion?
if ( pCMS->pSpecialPos )
{
@@ -1102,6 +1102,59 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
}
}
}
+
+ // special case: We are at the beginning of a BidiPortion or
+ // directly behind a BidiPortion
+ if ( pCMS &&
+ ( pLastBidiPor ||
+ ( pPor &&
+ pPor->IsMultiPortion() &&
+ ((SwMultiPortion*)pPor)->IsBidi() ) ) )
+ {
+ // we determine if the cursor has to blink before or behind
+ // the bidi portion
+ if ( pLastBidiPor )
+ {
+ const BYTE nPortionLevel = pLastBidiPor->GetLevel();
+
+ if ( pCMS->nCursorBidiLevel >= nPortionLevel )
+ {
+ // we came from inside the bidi portion, we want to blink
+ // behind the portion
+ pOrig->Pos().X() -= pLastBidiPor->Width() +
+ pLastBidiPor->CalcSpacing( nSpaceAdd, aInf );
+
+ // Again, there is a special case: logically behind
+ // the portion can actually mean that the cursor is inside
+ // the portion. This can happen is the last portion
+ // inside the bidi portion is a nested bidi portion
+ SwLineLayout& rLineLayout =
+ ((SwMultiPortion*)pLastBidiPor)->GetRoot();
+
+ const SwLinePortion *pLast = rLineLayout.FindLastPortion();
+ if ( pLast->IsMultiPortion() )
+ {
+ ASSERT( ((SwMultiPortion*)pLast)->IsBidi(),
+ "Non-BidiPortion inside BidiPortion" )
+ pOrig->Pos().X() += pLast->Width() +
+ pLast->CalcSpacing( nSpaceAdd, aInf );
+ }
+ }
+ }
+ else
+ {
+ const BYTE nPortionLevel = ((SwBidiPortion*)pPor)->GetLevel();
+
+ if ( pCMS->nCursorBidiLevel >= nPortionLevel )
+ {
+ // we came from inside the bidi portion, we want to blink
+ // behind the portion
+ pOrig->Pos().X() += pPor->Width() +
+ pPor->CalcSpacing( nSpaceAdd, aInf );
+ }
+ }
+ }
+
pOrig->Pos().X() += nX;
if ( pCMS && pCMS->bRealHeight )
@@ -1431,7 +1484,9 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
// Sonst kommen wir nicht mehr in zeichengeb. Rahmen hinein...
if( !( nChgNode && pPos && pPor->IsFlyCntPortion() ) )
{
- if ( pPor->InFldGrp() )
+ if ( pPor->InFldGrp() ||
+ ( pPor->IsMultiPortion() &&
+ ((SwMultiPortion*)pPor)->IsBidi() ) )
{
KSHORT nHeight = 0;
if( !bFieldInfo )
@@ -1440,8 +1495,9 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( !nHeight || nHeight > nWidth )
nHeight = nWidth;
}
- if( !((SwFldPortion*)pPor)->HasFollow() &&
- nWidth - nHeight/2 <= nX )
+ if( nWidth - nHeight/2 <= nX &&
+ ( ! pPor->InFldGrp() ||
+ !((SwFldPortion*)pPor)->HasFollow() ) )
++nCurrStart;
}
else if ( ( !pPor->IsFlyPortion() || ( pPor->GetPortion() &&
@@ -1505,12 +1561,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
{
const BYTE nBidiLevel = ((SwBidiPortion*)pPor)->GetLevel();
aLayoutModeModifier.Modify( nBidiLevel % 2 );
- if ( pCMS )
- ((SwCrsrMoveState*)pCMS)->nCursorBidiLevel = nBidiLevel;
}
- else if ( pCMS )
- ((SwCrsrMoveState*)pCMS)->nCursorBidiLevel =
- GetTxtFrm()->IsRightToLeft() ? 1 : 0;
#else
SwTxtCursorSave aSave( (SwTxtCursor*)this, (SwMultiPortion*)pPor,
nTmpY, nCurrStart, nSpaceAdd );
@@ -1579,6 +1630,10 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
nLength = aSizeInf.GetFont()->_GetCrsrOfst( aDrawInf );
+ if ( pCMS )
+ ((SwCrsrMoveState*)pCMS)->nCursorBidiLevel =
+ aDrawInf.GetCursorBidiLevel();
+
if( bFieldInfo && nLength == pPor->GetLen() &&
( ! pPor->GetPortion() ||
! pPor->GetPortion()->IsPostItsPortion() ) )
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index a63c96f7016d..c32327627910 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: itrform2.cxx,v $
*
- * $Revision: 1.72 $
+ * $Revision: 1.73 $
*
- * last change: $Author: fme $ $Date: 2002-12-10 14:44:59 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -675,9 +675,10 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
// offset:
// 1. Underlined portions due to special underline feature
// 2. Right Tab
- // 3. Multiportions
- // 4. DropCaps
- // 5. Grid Mode
+ // 3. BidiPortions
+ // 4. other Multiportions
+ // 5. DropCaps
+ // 6. Grid Mode
else if ( ( ! rInf.GetPaintOfst() || nUnderLineStart < rInf.GetPaintOfst() ) &&
// 1. Underlined portions
nUnderLineStart &&
@@ -694,11 +695,13 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf )
else if ( ! rInf.GetPaintOfst() &&
// 2. Right Tab
( ( pPor->InTabGrp() && !pPor->IsTabLeftPortion() ) ||
- // 3. Multi Portion and 4. Drop Caps
- ( ( pPor->IsDropPortion() || pPor->IsMultiPortion() )&&
+ // 3. BidiPortions
+ ( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() ) ||
+ // 4. Multi Portion and 5. Drop Caps
+ ( ( pPor->IsDropPortion() || pPor->IsMultiPortion() ) &&
rInf.GetReformatStart() >= rInf.GetIdx() &&
rInf.GetReformatStart() <= rInf.GetIdx() + pPor->GetLen() )
- // 5. Grid Mode
+ // 6. Grid Mode
|| ( bHasGrid && SW_CJK != pFnt->GetActual() )
)
)
diff --git a/sw/source/core/text/makefile.mk b/sw/source/core/text/makefile.mk
index ffa799f33a81..02d9ee595880 100644
--- a/sw/source/core/text/makefile.mk
+++ b/sw/source/core/text/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.6 $
+# $Revision: 1.7 $
#
-# last change: $Author: fme $ $Date: 2002-04-10 06:18:20 $
+# last change: $Author: hr $ $Date: 2003-03-27 15:41:01 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index f2969f4c3e12..7c89bb3813be 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: porfld.cxx,v $
*
- * $Revision: 1.34 $
+ * $Revision: 1.35 $
*
- * last change: $Author: fme $ $Date: 2002-11-18 12:17:03 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -368,7 +368,7 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
else
{
nFullLen = rInf.ScanPortionEnd( rInf.GetIdx(),
- rInf.GetIdx() + nOldFullLen, IsFollow() ) - rInf.GetIdx();
+ rInf.GetIdx() + nOldFullLen ) - rInf.GetIdx();
if( nFullLen && CH_BREAK == aExpand.GetChar( nFullLen - 1 ) )
--nFullLen;
@@ -681,8 +681,33 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
return;
}
- // Dies ist eine freizuegige Auslegung der Hintergrundbelegung ...
- rInf.DrawViewOpt( *this, POR_NUMBER );
+ // calculate the width of the number portion, including follows
+ const KSHORT nOldWidth = Width();
+ USHORT nSumWidth = 0;
+ USHORT nOffset = 0;
+
+ const SwLinePortion* pTmp = this;
+ while ( pTmp && pTmp->InNumberGrp() )
+ {
+ nSumWidth += pTmp->Width();
+ if ( ((SwNumberPortion*)pTmp)->HasFollow() )
+ pTmp = pTmp->GetPortion();
+ else
+ {
+ nOffset = pTmp->Width() - ((SwNumberPortion*)pTmp)->nFixWidth;
+ break;
+ }
+ }
+
+ // The master portion takes care for painting the background of the
+ // follow field portions
+ if ( ! IsFollow() )
+ {
+ SwLinePortion *pThis = (SwLinePortion*)this;
+ pThis->Width( nSumWidth );
+ rInf.DrawViewOpt( *this, POR_NUMBER );
+ pThis->Width( nOldWidth );
+ }
if( aExpand.Len() )
{
@@ -697,13 +722,12 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
SwFontSave aSave( rInf, pFnt );
- if( nFixWidth == Width() )
+ if( nFixWidth == Width() && ! HasFollow() )
SwExpandPortion::Paint( rInf );
else
{
// logisches const: Width wird wieder zurueckgesetzt
SwLinePortion *pThis = (SwLinePortion*)this;
- const KSHORT nOldWidth = Width();
bPaintSpace = bPaintSpace && nFixWidth < nOldWidth;
KSHORT nSpaceOffs = nFixWidth;
pThis->Width( nFixWidth );
@@ -714,7 +738,6 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
else
{
SwTxtPaintInfo aInf( rInf );
- KSHORT nOffset = nOldWidth - nFixWidth;
if( nOffset < nMinDist )
nOffset = 0;
else
@@ -723,7 +746,7 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
nOffset /= 2;
if( nOffset < nMinDist )
- nOffset = nOldWidth - nFixWidth - nMinDist;
+ nOffset = 2 * nOffset - nMinDist;
}
else
nOffset -= nMinDist;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 0fe6b2d45964..f639d9e4ff88 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: porfly.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: fme $ $Date: 2002-08-27 13:40:00 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -679,7 +679,9 @@ void SwFlyCntPortion::SetBase( const Point &rBase, long nLnAscent,
aDiff = Point( -aDiff.Y(), aDiff.X() );
}
- pSdrObj->ImpSetAnchorPos( aAnchorBase );
+ // There used to be a ImpSetAnchorPos here. Very dangerous
+ // for group object.
+ pSdrObj->NbcSetAnchorPos( aAnchorBase );
// #80046# here a Move() is necessary, a NbcMove() is NOT ENOUGH(!)
pSdrObj->Move( Size( aDiff.X(), aDiff.Y() ) );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 080e71edac3a..6a93d0a72c4f 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: porlay.cxx,v $
*
- * $Revision: 1.36 $
+ * $Revision: 1.37 $
*
- * last change: $Author: fme $ $Date: 2002-12-02 10:28:14 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -566,16 +566,20 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
return;
xub_StrLen nChg = nInvalidityPos;
+
// STRING_LEN means the data structure is up to date
nInvalidityPos = STRING_LEN;
+ // this is the default direction
+ nDefaultDir = TEXT_LAYOUT_BIDI_STRONG != rOut.GetLayoutMode() ?
+ UBIDI_RTL :
+ UBIDI_LTR;
+
// counter for script info arrays
USHORT nCnt = 0;
// counter for compression information arrays
USHORT nCntComp = 0;
#ifdef BIDI
- // counter for direction information arrays
- USHORT nCntDir = 0;
// counter for kashida array
USHORT nCntKash = 0;
#endif
@@ -694,15 +698,13 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
aCompType.Remove( nCntComp, nCompRemove );
#ifdef BIDI
- // remove invalid entries from direction information arrays
- const USHORT nDirRemove = aDirChg.Count();
- aDirChg.Remove( 0, nDirRemove );
- aDirType.Remove( 0, nDirRemove );
-
// get the start of the last kashida group
- USHORT nLastKashida = 0;
- if( nCntKash )
- nLastKashida = GetKashida( nCntKash - 1 );
+ USHORT nLastKashida = nChg;
+ if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
+ {
+ --nCntKash;
+ nLastKashida = GetKashida( nCntKash );
+ }
// remove invalid entries from kashida array
aKashida.Remove( nCntKash, aKashida.Count() - nCntKash );
@@ -803,7 +805,6 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
(BYTE)WEAK;
}
-
//
// UPDATE THE SCRIPT INFO ARRAYS:
//
@@ -913,6 +914,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
while ( aScanner.NextWord() )
{
const XubString& rWord = aScanner.GetWord();
+
xub_StrLen nIdx = 0;
xub_StrLen nKashidaPos = STRING_LEN;
xub_Unicode cCh;
@@ -1019,41 +1021,71 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
} while ( TRUE );
-#ifdef BIDI
- // Perform Unicode Bidi Algorithm for text direction information
- nCnt = 0;
- sal_Bool bLatin = sal_False;
- sal_Bool bAsian = sal_False;
- sal_Bool bComplex = sal_False;
-
- while( nCnt < CountScriptChg() )
+#ifndef PRODUCT
+ // check kashida data
+ long nTmpKashidaPos = -1;
+ sal_Bool bWrongKash = sal_False;
+ for ( USHORT i = 0; i < aKashida.Count(); ++i )
{
- nScript = GetScriptType( nCnt++ );
- switch ( nScript )
+ long nCurrKashidaPos = GetKashida( i );
+ if ( nCurrKashidaPos <= nTmpKashidaPos )
{
- case i18n::ScriptType::LATIN:
- bLatin = sal_True;
- break;
- case i18n::ScriptType::ASIAN:
- bAsian = sal_True;
- break;
- case i18n::ScriptType::COMPLEX:
- bComplex = sal_True;
+ bWrongKash = sal_True;
break;
- default:
- ASSERT( ! rTxt.Len(), "Wrong script found" )
}
+ nTmpKashidaPos = nCurrKashidaPos;
}
+ ASSERT( ! bWrongKash, "Kashida array contains wrong data" )
+#endif
- // this is the default direction
- const BYTE nDefaultDir = TEXT_LAYOUT_BIDI_STRONG != rOut.GetLayoutMode() ?
- UBIDI_RTL :
- UBIDI_LTR;
+ // remove invalid entries from direction information arrays
+ if ( ! bBidiInfoValid )
+ {
+ const USHORT nDirRemove = aDirChg.Count();
+ aDirChg.Remove( 0, nDirRemove );
+ aDirType.Remove( 0, nDirRemove );
+
+ // Perform Unicode Bidi Algorithm for text direction information
+ nCnt = 0;
+ sal_Bool bLatin = sal_False;
+ sal_Bool bAsian = sal_False;
+ sal_Bool bComplex = sal_False;
- // do not call the unicode bidi algorithm if not required
- if ( UBIDI_LTR == nDefaultDir && ! bComplex )
+ while( nCnt < CountScriptChg() )
+ {
+ nScript = GetScriptType( nCnt++ );
+ switch ( nScript )
+ {
+ case i18n::ScriptType::LATIN:
+ bLatin = sal_True;
+ break;
+ case i18n::ScriptType::ASIAN:
+ bAsian = sal_True;
+ break;
+ case i18n::ScriptType::COMPLEX:
+ bComplex = sal_True;
+ break;
+ default:
+ ASSERT( ! rTxt.Len(), "Wrong script found" )
+ }
+ }
+
+ // do not call the unicode bidi algorithm if not required
+ if ( UBIDI_LTR != nDefaultDir || bComplex )
+ UpdateBidiInfo( rTxt );
+ }
+}
+
+void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
+{
+ if ( bBidiInfoValid )
return;
+ // remove invalid entries from direction information arrays
+ const USHORT nDirRemove = aDirChg.Count();
+ aDirChg.Remove( 0, nDirRemove );
+ aDirType.Remove( 0, nDirRemove );
+
//
// Bidi functions from icu 2.0
//
@@ -1068,6 +1100,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
UTextOffset nStart = 0;
UTextOffset nEnd;
UBiDiLevel nCurrDir;
+ // counter for direction information arrays
+ USHORT nCntDir = 0;
for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
{
@@ -1078,10 +1112,10 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, SwAttrHandler& rAH,
}
ubidi_close( pBidi );
-#endif
-
+ bBidiInfoValid = sal_True;
}
+
/*************************************************************************
* SwScriptInfo::NextScriptChg(..)
* returns the position of the next character which belongs to another script
@@ -1442,20 +1476,21 @@ USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, long* pKernArray,
* SwScriptInfo::GetScriptInfo()
*************************************************************************/
-const SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd )
+SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
+ sal_Bool bAllowInvalid )
{
SwClientIter aClientIter( (SwTxtNode&)rTNd );
SwClient* pLast = aClientIter.GoStart();
- const SwScriptInfo* pScriptInfo = 0;
+ SwScriptInfo* pScriptInfo = 0;
while( pLast )
{
if ( pLast->ISA( SwTxtFrm ) )
{
- pScriptInfo = ((SwTxtFrm*)pLast)->GetScriptInfo();
+ pScriptInfo = (SwScriptInfo*)((SwTxtFrm*)pLast)->GetScriptInfo();
if ( pScriptInfo )
{
- if ( STRING_LEN != pScriptInfo->GetInvalidity() )
+ if ( ! bAllowInvalid && STRING_LEN != pScriptInfo->GetInvalidity() )
pScriptInfo = 0;
else break;
}
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 3f5dc5334842..9542d8a2e181 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pormulti.cxx,v $
*
- * $Revision: 1.72 $
+ * $Revision: 1.73 $
*
- * last change: $Author: fme $ $Date: 2002-12-10 14:44:59 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2307,6 +2307,25 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
if ( ! rMulti.GetLen() )
lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
+ // If there is a HolePortion at the end of the bidi portion,
+ // it has to be moved behind the bidi portion. Otherwise
+ // the visual cursor travelling gets into trouble.
+ SwLineLayout& aRoot = rMulti.GetRoot();
+ SwLinePortion* pPor = aRoot.GetFirstPortion();
+ while ( pPor )
+ {
+ if ( pPor->GetPortion() && pPor->GetPortion()->IsHolePortion() )
+ {
+ SwLinePortion* pHolePor = pPor->GetPortion();
+ pPor->SetPortion( NULL );
+ aRoot.SetLen( aRoot.GetLen() - pHolePor->GetLen() );
+ rMulti.SetLen( rMulti.GetLen() - pHolePor->GetLen() );
+ rMulti.SetPortion( pHolePor );
+ break;
+ }
+ pPor = pPor->GetPortion();
+ }
+
pTmp = new SwBidiPortion( nMultiLen + rInf.GetIdx(),
((SwBidiPortion&)rMulti).GetLevel() );
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index b2d800e96f28..7377440cd2c2 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: portxt.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: fme $ $Date: 2002-10-23 14:54:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -420,8 +420,9 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
else if ( aGuess.BreakPos() >= rInf.GetIdx() && aGuess.BreakPos() != STRING_LEN )
{
// case B1
- if( aGuess.HyphWord().is() && ( aGuess.BreakPos() > rInf.GetIdx() ||
- ( rInf.GetLast() && ! rInf.GetLast()->IsFlyPortion() ) ) )
+ if( aGuess.HyphWord().is() && aGuess.BreakPos() > rInf.GetLineStart()
+ && ( aGuess.BreakPos() > rInf.GetIdx() ||
+ ( rInf.GetLast() && ! rInf.GetLast()->IsFlyPortion() ) ) )
{
CreateHyphen( rInf, aGuess );
if ( rInf.GetFly() )
@@ -667,6 +668,7 @@ xub_StrLen SwTxtPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf,
((SwTxtSizeInfo &)rInf).SetOnWin( bOldOnWin );
nCnt += lcl_AddSpace( rInf, &aStr, *this );
+ nPos = aStr.Len();
}
}
else if( !IsDropPortion() )
diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx
index 5faa3b49ebfe..574b1fb9e16b 100644
--- a/sw/source/core/text/txtcache.cxx
+++ b/sw/source/core/text/txtcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtcache.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mh $ $Date: 2001-10-25 17:18:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,6 +66,7 @@
#pragma hdrstop
#include "errhdl.hxx"
+#include "segmentc.hxx"
#include "txtcache.hxx"
#include "txtfrm.hxx"
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 4a1c5966c290..c7a5547e2d15 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtfly.cxx,v $
*
- * $Revision: 1.30 $
+ * $Revision: 1.31 $
*
- * last change: $Author: aw $ $Date: 2002-10-30 15:13:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1227,8 +1227,6 @@ void SwTxtFly::DrawFlyRect( OutputDevice *pOut, const SwRect &rRect,
if( bOn && ( 0 != ( nCount = GetFlyList()->Count() ) ) )
{
MSHORT nHellId = pPage->GetShell()->GetDoc()->GetHellId();
- Size aPixelSz = Size( 1, 1 );
- aPixelSz = pOut->PixelToLogic( aPixelSz );
for( MSHORT i = 0; i < nCount; ++i )
{
const SdrObject *pTmp = (*pFlyList)[ i ];
@@ -1238,12 +1236,20 @@ void SwTxtFly::DrawFlyRect( OutputDevice *pOut, const SwRect &rRect,
((SwContact*)GetUserCall(pTmp))->GetFmt();
const SwFmtSurround &rSur = pFmt->GetSurround();
- if( ( SURROUND_THROUGHT == rSur.GetSurround() ) ?
- pTmp->GetLayer() != nHellId : !rSur.IsContour() )
+ // OD 24.01.2003 #106593# - correct clipping of fly frame area.
+ // Consider that fly frame background/shadow can be transparent
+ // and <SwAlignRect(..)> fly frame area
+ const SwFlyFrm *pFly = static_cast<const SwVirtFlyDrawObj*>(pTmp)->GetFlyFrm();
+ bool bClipFlyArea =
+ ( (SURROUND_THROUGHT == rSur.GetSurround()) ?
+ (pTmp->GetLayer() != nHellId) : !rSur.IsContour() ) &&
+ !pFly->IsBackgroundTransparent() &&
+ !pFly->IsShadowTransparent();
+ if ( bClipFlyArea )
{
SwRect aFly( pTmp->GetBoundRect() );
- aFly.Left( aFly.Left() - aPixelSz.Width() );
- aFly.Top( aFly.Top() - aPixelSz.Height() );
+ // OD 24.01.2003 #106593#
+ ::SwAlignRect( aFly, pPage->GetShell() );
if( aFly.Width() > 0 && aFly.Height() > 0 )
aRegion -= aFly;
}
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 3d6037e8282a..a217a3e1d0c1 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtfrm.cxx,v $
*
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
- * last change: $Author: od $ $Date: 2002-12-10 14:02:47 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -786,6 +786,11 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
Prepare( PREP_CLEAR );
_InvalidatePrt();
SET_WRONG( 0, STRING_LEN, Invalidate );
+ SetDerivedR2L( sal_False );
+ CheckDirChange();
+ // OD 09.12.2002 #105576# - Force complete paint due to existing
+ // indents.
+ SetCompletePaint();
InvalidateLineNum();
}
return;
@@ -1750,7 +1755,8 @@ SwTestFormat::SwTestFormat( SwTxtFrm* pTxtFrm, const SwFrm* pPre, SwTwips nMaxHe
(pFrm->Prt().*fnRect->fnGetTop)() - nLower ) );
(pFrm->Prt().*fnRect->fnSetWidth)(
(pFrm->Frm().*fnRect->fnGetWidth)() -
- ( rAttrs.CalcLeft( pFrm ) + rAttrs.CalcRight() ) );
+ // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)>
+ ( rAttrs.CalcLeft( pFrm ) + rAttrs.CalcRight( pFrm ) ) );
pOldPara = pFrm->HasPara() ? pFrm->GetPara() : NULL;
pFrm->SetPara( new SwParaPortion(), sal_False );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index e75f1e92a1ff..f2ef21592abc 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtftn.cxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: od $ $Date: 2002-11-11 09:43:14 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,9 @@
#ifndef _TXTFTN_HXX //autogen
#include <txtftn.hxx>
#endif
+#ifndef _FLYFRM_HXX
+#include <flyfrm.hxx>
+#endif
#ifndef _FMTFTN_HXX //autogen
#include <fmtftn.hxx>
#endif
@@ -86,12 +89,18 @@
#ifndef _CHARFMT_HXX //autogen
#include <charfmt.hxx>
#endif
+#ifndef _DFLYOBJ_HXX
+#include <dflyobj.hxx>
+#endif
#ifndef _SVX_BRSHITEM_HXX //autogen
#include <svx/brshitem.hxx>
#endif
#ifndef _SVX_CHARROTATEITEM_HXX
#include <svx/charrotateitem.hxx>
#endif
+#ifndef _SVDOBJ_HXX //autogen
+#include <svx/svdobj.hxx>
+#endif
#ifndef _BREAKIT_HXX
#include <breakit.hxx>
#endif
@@ -973,9 +982,43 @@ SwFtnPortion *SwTxtFormatter::NewFtnPortion( SwTxtFormatInfo &rInf,
nLower += nAdd;
#endif
- //6995: Wir frischen nur auf. Das Connect tut fuer diesen Fall nix
- //Brauchbares, sondern wuerde stattdessen fuer diesen Fall meist die
- //Ftn wegwerfen und neu erzeugen.
+ // #i10770#: If there are fly frames anchored at previous paragraphs,
+ // the deadline should consider their lower borders.
+ SwFrm* pStartFrm = pFrm->GetUpper()->GetLower();
+ ASSERT( pStartFrm, "Upper has no lower" )
+ SwTwips nFlyLower = bVert ? LONG_MAX : 0;
+ while ( pStartFrm != pFrm )
+ {
+ ASSERT( pStartFrm, "Frame chain is broken" )
+ if ( pStartFrm->GetDrawObjs() )
+ {
+ const SwDrawObjs &rObjs = *pStartFrm->GetDrawObjs();
+ for ( USHORT i = 0; i < rObjs.Count(); ++i )
+ {
+ SdrObject *pO = rObjs[i];
+ SwRect aRect( pO->GetBoundRect() );
+
+ if ( ! pO->IsWriterFlyFrame() ||
+ ((SwVirtFlyDrawObj*)pO)->GetFlyFrm()->IsValid() )
+ {
+ const SwTwips nBottom = (aRect.*fnRect->fnGetBottom)();
+ if ( (*fnRect->fnYDiff)( nBottom, nFlyLower ) > 0 )
+ nFlyLower = nBottom;
+ }
+ }
+ }
+
+ pStartFrm = pStartFrm->GetNext();
+ }
+
+ if ( bVert )
+ nLower = Min( nLower, nFlyLower );
+ else
+ nLower = Max( nLower, nFlyLower );
+
+ //6995: Wir frischen nur auf. Das Connect tut fuer diesen Fall nix
+ //Brauchbares, sondern wuerde stattdessen fuer diesen Fall meist die
+ //Ftn wegwerfen und neu erzeugen.
if( !rInf.IsQuick() )
pFrm->ConnectFtn( pFtn, nLower );
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index ee23f6fa9a3c..6a96c0b43496 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtio.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: fme $ $Date: 2001-10-19 08:38:42 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,7 +100,7 @@
// So kann man die Layoutstruktur ausgeben lassen
// #define AMA_LAYOUT
#ifdef AMA_LAYOUT
-#include <stdio.h> // sprintf
+#include <stdio.h>
#include <stdlib.h> // getenv()
#include <flowfrm.hxx>
#include <pagefrm.hxx>
@@ -290,9 +290,9 @@ void LayOutPut( const SwFrm* pFrm )
// fuer dieses new wird es kein delete geben.
pOutName = new char[nLen + strlen(pName) + 3];
if(nLen && (pPath[nLen-1] == '\\') || (pPath[nLen-1] == '/'))
- sprintf( pOutName, "%s%s", pPath, pName );
+ snprintf( pOutName, sizeof(pOutName), "%s%s", pPath, pName );
else
- sprintf( pOutName, "%s/%s", pPath, pName );
+ snprintf( pOutName, sizeof(pOutName), "%s/%s", pPath, pName );
}
}
SvFileStream aStream( pOutName, (bFirstOpen
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index f4b2fecaadff..660b8b743e66 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txttab.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: fme $ $Date: 2002-11-22 12:30:24 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -158,8 +158,10 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf ) const
konvertiert (vgl. rInf.GetTabPos).
*/
const SwTwips nTabLeft = pFrm->Frm().Left() +
- pFrm->GetAttrSet()->GetLRSpace().GetTxtLeft();
- // + KSHORT(pFrm->GetTxtNode()->GetLeftMarginWithNum( sal_True ));
+ ( pFrm->IsRightToLeft() ?
+ pFrm->GetAttrSet()->GetLRSpace().GetRight() :
+ pFrm->GetAttrSet()->GetLRSpace().GetTxtLeft() );
+
const SwTwips nLinePos = GetLeftMargin();
const SwTwips nLineTab = nLinePos + nTabPos;
SwTwips nRight = Right();
@@ -197,14 +199,11 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf ) const
}
SwTwips nCount = nLineTab;
nCount -= nTabLeft;
-
// Bei negativen Werten rundet "/" auf, "%" liefert negative Reste,
// bei positiven Werten rundet "/" ab, "%" liefert positvie Reste!
- if ( nCount < 0 )
- nCount = 0;
-
+ KSHORT nPlus = nCount < 0 ? 0 : 1;
nCount /= nDefTabDist;
- nNextPos = ( nCount + 1 ) * nDefTabDist ;
+ nNextPos = ( nCount + nPlus ) * nDefTabDist ;
if( nNextPos + nTabLeft <= nLineTab + 50 )
nNextPos += nDefTabDist;
cFill = 0;
@@ -458,8 +457,8 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
#ifndef PRODUCT
// Wir wollen uns die Fixbreite anzeigen
if( rInf.OnWin() && OPTDBG( rInf ) &&
- !rInf.GetOpt().IsPagePreview() &&
- !rInf.GetOpt().IsReadonly() &&
+ !rInf.GetOpt().IsPagePreview() && \
+ !rInf.GetOpt().IsReadonly() && \
SwViewOption::IsFieldShadings() )
{
const KSHORT nWidth = PrtWidth();
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 27f7206c2c6e..9bcdc42a01af 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txmsrt.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: os $ $Date: 2002-10-30 10:38:39 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -754,7 +754,8 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, USHORT ) const
++nStt;
*/
pSrc->GetExpandTxt( rNd, &rInsPos, nStt,
- nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt );
+ nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt,
+ FALSE, FALSE );
}
else
{
@@ -797,12 +798,14 @@ String SwTOXPara::GetURL() const
{
// dann noch die rel. Nummer davor setzen
const SwNumRule& rRule = *pNd->GetDoc()->GetOutlineNumRule();
- for( int n = 0; n <= pNum->GetLevel(); ++n )
- {
- int nNum = pNum->GetLevelVal()[ n ];
- nNum -= ( rRule.Get( n ).GetStart() - 1 );
- ( aTxt += String::CreateFromInt32( nNum )) += '.';
- }
+ const USHORT nCurrLevel = pNum->GetLevel();
+ if(nCurrLevel <= MAXLEVEL)
+ for( int n = 0; n <= nCurrLevel; ++n )
+ {
+ int nNum = pNum->GetLevelVal()[ n ];
+ nNum -= ( rRule.Get( n ).GetStart() - 1 );
+ ( aTxt += String::CreateFromInt32( nNum )) += '.';
+ }
}
aTxt += ((SwTxtNode*)pNd)->GetExpandTxt();
( aTxt += cMarkSeperator ).AppendAscii( pMarkToOutline );
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index fcbe545373b0..08dab4445c88 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fntcache.cxx,v $
*
- * $Revision: 1.64 $
+ * $Revision: 1.65 $
*
- * last change: $Author: fme $ $Date: 2002-12-05 10:06:20 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -746,9 +746,6 @@ BYTE lcl_WhichPunctuation( xub_Unicode cChar )
void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
-
-
-static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
BOOL bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType();
Font* pTmpFont = bPrt ? pPrtFont : GetScrFont();
@@ -1038,9 +1035,10 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
// handelt, muessen wir zwei ausgeben:
if( 1 == rInf.GetLen() )
{
- pKernArray[0] = nSpaceAdd;
- rInf.GetOut().DrawTextArray( aPos, XubString( sDoubleSpace,
- RTL_TEXTENCODING_MS_1252 ), pKernArray, 0, 2 );
+ pKernArray[0] = rInf.GetWidth() + nSpaceAdd;
+
+ rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
+ pKernArray, rInf.GetIdx(), 1 );
}
else
{
@@ -1248,16 +1246,6 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
xub_Unicode cBulletChar = CH_BULLET;
- if ( rInf.GetFont() )
- {
- // Some Asian fonts do not have the middot (0xB7),
- // others do not have the Asian middot (0xFF65).
- // Until we find a better solution we do not paint
- // middots with Asian fonts.
- if ( SW_CJK == rInf.GetFont()->GetActual() )
- cBulletChar = CH_BLANK; // 0xFF65;
- }
-
for( xub_StrLen i = 0; i < aStr.Len(); ++i )
if( CH_BLANK == aStr.GetChar( i ) )
aStr.SetChar( i, cBulletChar );
@@ -1284,7 +1272,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
// im Blocksatz handelt, muessen wir zwei ausgeben:
if ( ( nCnt == 1 ) && rInf.GetSpace() && ( cChPrev == CH_BLANK ) )
{
- pKernArray[0] = rInf.GetSpace() + rInf.GetKern();
+ pKernArray[0] = rInf.GetWidth() + rInf.GetSpace() + rInf.GetKern();
#ifdef BIDI
if ( bSwitchL2R )
@@ -1294,8 +1282,8 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
if ( bSwitchH2V )
rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
- rInf.GetOut().DrawTextArray( aPos, XubString( sDoubleSpace,
- RTL_TEXTENCODING_MS_1252 ), pKernArray, 0, 2 );
+ rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
+ pKernArray, rInf.GetIdx(), 1 );
if( bBullet )
rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray,
rInf.GetIdx() ? 1 : 0, 1 );
@@ -1829,10 +1817,10 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
rInf.GetpOut()->GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
+ const SwScriptInfo* pSI = rInf.GetScriptInfo();
if ( rInf.GetFont() && rInf.GetLen() )
{
const BYTE nActual = rInf.GetFont()->GetActual();
- const SwScriptInfo* pSI = rInf.GetScriptInfo();
// Kana Compression
if ( SW_CJK == nActual && rInf.GetKanaComp() && pSI && pSI->CountCompChg() )
@@ -1968,9 +1956,12 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
// step back if position is before the middle of the character
if ( nIdx > rInf.GetIdx() && ( nRight > long( rInf.GetOfst() ) ) &&
( nRight - rInf.GetOfst() > rInf.GetOfst() - nLeft ) )
- nCnt = nLastIdx - rInf.GetIdx();
+ nCnt = nLastIdx - rInf.GetIdx(); // first half
else
- nCnt = nIdx - rInf.GetIdx();
+ nCnt = nIdx - rInf.GetIdx(); // second half
+
+ if ( pSI )
+ rInf.SetCursorBidiLevel( pSI->DirType( nLastIdx ) );
delete[] pKernArray;
return nCnt;
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 663645a0b8dd..7972a16ab20f 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fntcap.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fme $ $Date: 2002-06-19 07:43:41 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,6 +90,9 @@
#ifndef _BREAKIT_HXX
#include <breakit.hxx>
#endif
+#ifndef _TXTFRM_HXX
+#include <txtfrm.hxx> // SwTxtFrm
+#endif
using namespace ::com::sun::star::i18n;
@@ -293,11 +296,25 @@ void SwDoDrawCapital::Do()
void SwDoDrawCapital::DrawSpace( Point &rPos )
{
static sal_Char __READONLY_DATA sDoubleSpace[] = " ";
- const USHORT nDiff = (USHORT)( rInf.GetPos().X() - rPos.X() );
+
+ long nDiff = rInf.GetPos().X() - rPos.X();
+
+ Point aPos( rPos );
+#ifdef BIDI
+ if ( rInf.GetFrm()->IsRightToLeft() )
+ {
+ rInf.GetFrm()->SwitchLTRtoRTL( aPos );
+ nDiff = -nDiff;
+ }
+#endif
+
+ if ( rInf.GetFrm()->IsVertical() )
+ rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
+
if ( nDiff )
{
rInf.ApplyAutoColor();
- GetOut()->DrawStretchText( rPos, nDiff,
+ GetOut()->DrawStretchText( aPos, nDiff,
XubString( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ), 0, 2 );
}
rPos.X() = rInf.GetPos().X() + rInf.GetWidth();
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index e20d1ab1828d..56d5eb9d3c7c 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndtxt.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: od $ $Date: 2002-11-11 09:37:58 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2603,7 +2603,8 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx, const xub_StrLen nLen,
}
BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
- xub_StrLen nIdx, xub_StrLen nLen, BOOL bWithNum ) const
+ xub_StrLen nIdx, xub_StrLen nLen, BOOL bWithNum,
+ BOOL bWithFtn ) const
{
if( &rDestNd == this )
return FALSE;
@@ -2669,26 +2670,29 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
case RES_TXTATR_FTN:
{
- const SwFmtFtn& rFtn = pHt->GetFtn();
- XubString sExpand;
- if( rFtn.GetNumStr().Len() )
- sExpand = rFtn.GetNumStr();
- else if( rFtn.IsEndNote() )
- sExpand = GetDoc()->GetEndNoteInfo().aFmt.
- GetNumStr( rFtn.GetNumber() );
- else
- sExpand = GetDoc()->GetFtnInfo().aFmt.
- GetNumStr( rFtn.GetNumber() );
- if( sExpand.Len() )
+ if ( bWithFtn )
{
- aDestIdx++; // dahinter einfuegen;
- rDestNd.Insert( SvxEscapementItem(
- SVX_ESCAPEMENT_SUPERSCRIPT ),
- aDestIdx.GetIndex(),
- aDestIdx.GetIndex() );
- rDestNd.Insert( sExpand, aDestIdx, INS_EMPTYEXPAND );
- aDestIdx = nInsPos + nAttrStartIdx;
- nInsPos += sExpand.Len();
+ const SwFmtFtn& rFtn = pHt->GetFtn();
+ XubString sExpand;
+ if( rFtn.GetNumStr().Len() )
+ sExpand = rFtn.GetNumStr();
+ else if( rFtn.IsEndNote() )
+ sExpand = GetDoc()->GetEndNoteInfo().aFmt.
+ GetNumStr( rFtn.GetNumber() );
+ else
+ sExpand = GetDoc()->GetFtnInfo().aFmt.
+ GetNumStr( rFtn.GetNumber() );
+ if( sExpand.Len() )
+ {
+ aDestIdx++; // dahinter einfuegen;
+ rDestNd.Insert( SvxEscapementItem(
+ SVX_ESCAPEMENT_SUPERSCRIPT ),
+ aDestIdx.GetIndex(),
+ aDestIdx.GetIndex() );
+ rDestNd.Insert( sExpand, aDestIdx, INS_EMPTYEXPAND );
+ aDestIdx = nInsPos + nAttrStartIdx;
+ nInsPos += sExpand.Len();
+ }
}
rDestNd.Erase( aDestIdx, 1 );
--nInsPos;
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index c431f90abbc0..46541b9f3ee7 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: cmc $ $Date: 2002-12-10 09:42:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -290,9 +290,9 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat )
if( nDir != aSub[0].GetOrientation() )
{
bFntChg = TRUE;
- aSub[0].SetVertical( nDir );
- aSub[1].SetVertical( nDir );
- aSub[2].SetVertical( nDir );
+ aSub[0].SetVertical( nDir, bVertFormat );
+ aSub[1].SetVertical( nDir, bVertFormat || nDir > 1000 );
+ aSub[2].SetVertical( nDir, bVertFormat );
}
}
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 9cd61f51517d..88181432f21f 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtedt.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: fme $ $Date: 2002-11-07 09:44:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,7 @@
#include <stdlib.h> // getenv()
#include <time.h> // clock()
#include "viewsh.hxx" // ViewShell::GetHyphenator
+ #include <tools/stream.hxx>
#endif
#ifndef _HINTIDS_HXX
@@ -561,8 +562,30 @@ BOOL SwScanner::NextWord()
else
bStart = FALSE;
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = aBound.endPos - nBegin;
+ // restrict boundaries to script boundaries and nEndPos
+ const USHORT nCurrScript =
+ pBreakIt->xBreak->getScriptType( rText, nBegin );
+
+ // restrict word end to next script change position
+ ASSERT( aBound.endPos >= nBegin, "SwScanner is getting into trouble" )
+ XubString aTmpWord = rText.Copy( nBegin, aBound.endPos - nBegin );
+ long nScriptEnd = nBegin +
+ pBreakIt->xBreak->endOfScript( aTmpWord, 0, nCurrScript );
+ long nEnd = Min( aBound.endPos, nScriptEnd );
+
+ // restrict word start to last script change position
+ long nScriptBegin = aBound.startPos;
+ if ( aBound.startPos < nBegin )
+ {
+ // search from nBegin backwards until the next script change
+ aTmpWord = rText.Copy( aBound.startPos, nBegin - aBound.startPos + 1 );
+ nScriptBegin = aBound.startPos +
+ pBreakIt->xBreak->beginOfScript( aTmpWord, nBegin - aBound.startPos,
+ nCurrScript );
+ }
+
+ nBegin = Max( aBound.startPos, nScriptBegin );
+ nLen = nEnd - nBegin;
if( ! nLen )
return FALSE;
@@ -1304,12 +1327,12 @@ void SwLinguStatistik::Flush()
// fuer dieses new wird es kein delete geben.
pLogName = new char[nLen + strlen(pName) + 3];
if(nLen && (pPath[nLen-1] == '\\') || (pPath[nLen-1] == '/'))
- sprintf( pLogName, "%s%s", pPath, pName );
+ snprintf( pLogName, sizeof(pLogName), "%s%s", pPath, pName );
else
- sprintf( pLogName, "%s/%s", pPath, pName );
+ snprintf( pLogName, sizeof(pLogName), "%s/%s", pPath, pName );
}
}
- SvFileStream aStream( pLogName, (bFirstOpen
+ SvFileStream aStream( String::CreateFromAscii(pLogName), (bFirstOpen
? STREAM_WRITE | STREAM_TRUNC
: STREAM_WRITE ));
@@ -1347,7 +1370,7 @@ void SwLinguStatistik::Flush()
nWords = nWrong = nAlter = nSynonym = nNoSynonym =
nHyphens = nNoHyph = nHyphErr = nSpellTime = nTheTime =
nHyphTime = 0;
- pThes = NULL;
+ //pThes = NULL;
#endif
}
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index e19576fe1680..e7099d5c023a 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swunohelper.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jp $ $Date: 2001-10-18 11:42:10 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -255,6 +255,33 @@ BOOL UCB_IsReadOnlyFileName( const String& rURL )
return bIsReadOnly;
}
+BOOL UCB_IsFile( const String& rURL )
+{
+ BOOL bExists = FALSE;
+ try
+ {
+ ::ucb::Content aContent( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )() );
+ bExists = aContent.isDocument();
+ }
+ catch (UNO_NMSPC::Exception &)
+ {
+ }
+ return bExists;
+}
+
+BOOL UCB_IsDirectory( const String& rURL )
+{
+ BOOL bExists = FALSE;
+ try
+ {
+ ::ucb::Content aContent( rURL, STAR_REFERENCE( ucb::XCommandEnvironment )() );
+ bExists = aContent.isFolder();
+ }
+ catch (UNO_NMSPC::Exception &)
+ {
+ }
+ return bExists;
+}
// get a list of files from the folder of the URL
// options: pExtension = 0 -> all, else this specific extension
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index e5804c3f02e5..f6f8739651b0 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unocrsrhelper.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: os $ $Date: 2002-11-05 08:42:07 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -165,6 +165,9 @@
#ifndef _DOC_HXX //autogen
#include <doc.hxx>
#endif
+#ifndef _FCHRFMT_HXX
+#include <fchrfmt.hxx>
+#endif
#ifndef _SVX_FLSTITEM_HXX //autogen
#include <svx/flstitem.hxx>
#endif
@@ -174,6 +177,9 @@
#ifndef _CTRLTOOL_HXX
#include <svtools/ctrltool.hxx>
#endif
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_USHORTSSORT
+#include <svtools/svstdarr.hxx>
#ifndef _SFX_DOCFILT_HACK_HXX //autogen
#include <sfx2/docfilt.hxx>
#endif
@@ -493,6 +499,67 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap
eNewState = PropertyState_DEFAULT_VALUE;
}
break;
+ case FN_UNO_CHARFMT_SEQUENCE:
+ {
+
+ SwTxtNode* pTxtNode;
+ if((pTxtNode = (SwTxtNode*)rPam.GetNode( TRUE )) == rPam.GetNode(FALSE) &&
+ pTxtNode->GetpSwpHints())
+ {
+ USHORT nPaMStart = rPam.GetPoint()->nContent.GetIndex();
+ USHORT nPaMEnd = rPam.GetMark() ? rPam.GetMark()->nContent.GetIndex() : nPaMStart;
+ if(nPaMStart > nPaMEnd)
+ {
+ USHORT nTmp = nPaMStart;
+ nPaMStart = nPaMEnd;
+ nPaMEnd = nTmp;
+ }
+ Sequence< ::rtl::OUString> aCharStyles;
+ USHORT nCharStylesFound = 0;
+ SwpHints* pHints = pTxtNode->GetpSwpHints();
+ for(USHORT nAttr = 0; nAttr < pHints->GetStartCount(); nAttr++ )
+ {
+ SwTxtAttr* pAttr = pHints->GetStart( nAttr );
+ if(pAttr->Which() != RES_TXTATR_CHARFMT)
+ continue;
+ USHORT nAttrStart = *pAttr->GetStart();
+ USHORT nAttrEnd = *pAttr->GetEnd();
+ //check if the attribute touches the selection
+ if(nAttrEnd > nPaMStart && nAttrStart < nPaMEnd && nAttrEnd > nPaMStart)
+ {
+ //check for overlapping
+ if(nAttrStart > nPaMStart ||
+ nAttrEnd < nPaMEnd)
+ {
+ aCharStyles.realloc(0);
+ eNewState = PropertyState_AMBIGUOUS_VALUE;
+ break;
+ }
+ else
+ {
+ //now the attribute should start before or at the selection
+ //and it should end at the end of the selection or behind
+ DBG_ASSERT(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
+ "attribute overlaps or is outside");
+ //now the name of the style has to be added to the sequence
+ aCharStyles.realloc(aCharStyles.getLength() + 1);
+ DBG_ASSERT(pAttr->GetCharFmt().GetCharFmt(), "no character format set");
+ aCharStyles.getArray()[aCharStyles.getLength() - 1] =
+ SwStyleNameMapper::GetProgName(
+ pAttr->GetCharFmt().GetCharFmt()->GetName(), GET_POOLID_CHRFMT);
+ }
+ }
+
+ }
+ if(aCharStyles.getLength())
+ eNewState = PropertyState_DIRECT_VALUE;
+ if(pAny)
+ (*pAny) <<= aCharStyles;
+ }
+ else
+ eNewState = PropertyState_DEFAULT_VALUE;
+ }
+ break;
case RES_TXTATR_CHARFMT:
// kein break hier!
default: bDone = sal_False;
@@ -694,6 +761,13 @@ void resetCrsrPropertyValue(const SfxItemPropertyMap* pMap, SwPaM& rPam)
case FN_UNO_NUM_RULES:
// lcl_setNumberingProperty(aValue, pUnoCrsr);
break;
+ case FN_UNO_CHARFMT_SEQUENCE:
+ {
+ SvUShortsSort aWhichIds;
+ aWhichIds.Insert(RES_TXTATR_CHARFMT);
+ pDoc->ResetAttr(rPam, sal_True, &aWhichIds);
+ }
+ break;
}
}
/* -----------------21.07.98 11:36-------------------
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 64ba2e37357b..74d554d44556 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodraw.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: tl $ $Date: 2002-10-30 13:03:24 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1048,7 +1048,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
if(!bDone)
throw IllegalArgumentException();
}
- else if(RES_OPAQUE == pMap->nWID)
+ else if(RES_OPAQUE == pMap->nWID)
{
SvxShape* pSvxShape = GetSvxShape();
DBG_ASSERT(pSvxShape, "No SvxShape found!")
@@ -1177,7 +1177,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
aRet.setValue(&bOpaque, ::getBooleanCppuType());
}
}
- if(FN_ANCHOR_POSITION == pMap->nWID)
+ else if(FN_ANCHOR_POSITION == pMap->nWID)
{
SvxShape* pSvxShape = GetSvxShape();
DBG_ASSERT(pSvxShape, "No SvxShape found!")
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 5f01460de16c..2de8a9764ffe 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unofield.cxx,v $
*
- * $Revision: 1.69 $
+ * $Revision: 1.70 $
*
- * last change: $Author: dvo $ $Date: 2002-11-21 15:31:59 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1309,6 +1309,8 @@ void SwXTextField::attachTextFieldMaster(const uno::Reference< XPropertySet > &
if(!m_bIsDescriptor)
throw uno::RuntimeException();
uno::Reference< XUnoTunnel > xMasterTunnel(xFieldMaster, uno::UNO_QUERY);
+ if (!xMasterTunnel.is())
+ throw IllegalArgumentException();
SwXFieldMaster* pMaster = (SwXFieldMaster*)xMasterTunnel->getSomething(
SwXFieldMaster::getUnoTunnelId());
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index c739dbcb6a85..660c63817a0b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoframe.cxx,v $
*
- * $Revision: 1.74 $
+ * $Revision: 1.75 $
*
- * last change: $Author: mib $ $Date: 2002-11-26 12:35:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -264,6 +264,10 @@
#include <svx/frmdiritem.hxx>
#endif
+#include <so3/outplace.hxx>
+
+// from fefly1.cxx
+extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1203,9 +1207,28 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
SwFrmFmt *pFrmFmt = lcl_GetFrmFmt( aValue, pFmt->GetDoc() );
if( pFrmFmt )
{
-// pSh->SetFrmFmt( pStyle->GetFrmFmt() );
UnoActionContext aAction(pFmt->GetDoc());
- pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt );
+
+ // see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos )
+ SwFlyFrm *pFly = 0;
+ const SwFrmFmt* pFmtXX = pFmt;
+ if (PTR_CAST(SwFlyFrmFmt, pFmtXX))
+ pFly = ((SwFlyFrmFmt*)pFmtXX)->GetFrm();
+ SfxItemSet* pSet = 0;
+ if (pFly)
+ {
+ const SfxPoolItem* pItem;
+ if( SFX_ITEM_SET == pFrmFmt->GetItemState( RES_ANCHOR, sal_False, &pItem ))
+ {
+ pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrmFmtSetRange );
+ pSet->Put( *pItem );
+ if( !::lcl_ChkAndSetNewAnchor( *pFly, *pSet ))
+ delete pSet, pSet = 0;
+ }
+ }
+
+ pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, FALSE );
+ delete pSet;
}
else
throw IllegalArgumentException();
@@ -1440,7 +1463,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
}
else if(pFmt)
{
- if(eType == FLYCNTTYPE_GRF &&
+ if( ((eType == FLYCNTTYPE_GRF) || (eType == FLYCNTTYPE_OLE)) &&
pCur &&
((pCur->nWID >= RES_GRFATR_BEGIN &&
pCur->nWID < RES_GRFATR_END )||
@@ -2239,10 +2262,14 @@ uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL SwXTextFrame::getTypes( )
---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
/*-- 11.12.98 15:23:03---------------------------------------------------
@@ -2579,10 +2606,14 @@ uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
/*-- 11.12.98 16:02:27---------------------------------------------------
@@ -2755,10 +2786,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(Ru
---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
+ {
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
+ }
return aId;
}
/*-- 11.12.98 16:16:54---------------------------------------------------
@@ -2802,6 +2837,8 @@ void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< XEventList
-----------------------------------------------------------------------*/
+static uno::Reference< util::XModifyListener > xSwXOLEListener;
+
uno::Reference< XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( RuntimeException )
{
uno::Reference< XComponent > xRet;
@@ -2831,18 +2868,21 @@ uno::Reference< XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) thr
uno::Reference< util::XModifyBroadcaster > xBrdcst(xModel, uno::UNO_QUERY);
if( xBrdcst.is() )
{
- SwClientIter aIter( *pFmt );
- SwXOLEListener* pListener = (SwXOLEListener*)aIter.
- First( TYPE( SwXOLEListener ));
- //create a new one if the OLE object doesn't have one already
- if( !pListener )
- {
- uno::Reference< util::XModifyListener > xOLEListener = new SwXOLEListener(*pFmt, xModel);
- xBrdcst->addModifyListener( xOLEListener );
- }
+ SwXOLEListener* pSwOLEListener = (SwXOLEListener*)
+ xSwXOLEListener.get();
+ if( !pSwOLEListener )
+ xSwXOLEListener = pSwOLEListener = new SwXOLEListener;
+ if( pSwOLEListener->AddOLEFmt( *pFmt ) )
+ xBrdcst->addModifyListener( xSwXOLEListener );
}
}
}
+ else
+ {
+ SvOutPlaceObjectRef xOut( pOleNode->GetOLEObj().GetOleRef() );
+ if ( xOut.Is() )
+ xRet = xOut->GetUnoComponent();
+ }
}
}
return xRet;
@@ -2903,41 +2943,16 @@ uno::Reference<container::XNameReplace> SAL_CALL
/******************************************************************
*
******************************************************************/
-TYPEINIT1(SwXOLEListener, SwClient);
-/* -----------------------------18.01.2002 09:59------------------------------
-
- ---------------------------------------------------------------------------*/
-SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) :
- SwClient(&rOLEFmt),
- xOLEModel(xOLE)
-{
-}
-/* -----------------------------18.01.2002 09:59------------------------------
-
- ---------------------------------------------------------------------------*/
-SwXOLEListener::~SwXOLEListener()
-{}
void SwXOLEListener::modified( const EventObject& rEvent )
throw( RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
- SwOLENode* pNd = 0;
- SwFmt* pFmt = GetFmt();
- if(pFmt)
- {const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
- if(pIdx)
- {
- SwNodeIndex aIdx(*pIdx, 1);
- SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
- pNd = pNoTxt->GetOLENode();
- }
- }
- if(!pNd)
- throw RuntimeException();
- if( !pNd->GetOLEObj().IsOleRef() ||
- !pNd->GetOLEObj().GetOleRef()->GetProtocol().IsInPlaceActive() )
+ SwOLENode* pNd;
+ sal_uInt16 nFndPos = FindEntry( rEvent, &pNd );
+ if( USHRT_MAX != nFndPos && ( !pNd->GetOLEObj().IsOleRef() ||
+ !pNd->GetOLEObj().GetOleRef()->GetProtocol().IsInPlaceActive() ))
{
// if the OLE-Node is UI-Active do nothing
pNd->SetOLESizeInvalid( sal_True );
@@ -2954,27 +2969,156 @@ void SwXOLEListener::disposing( const EventObject& rEvent )
uno::Reference< util::XModifyListener > xListener( this );
+ SwOLENode* pNd;
+ sal_uInt16 nFndPos = FindEntry( rEvent, &pNd );
+ if( USHRT_MAX != nFndPos )
+ {
+ SwDepend* pDepend = (SwDepend*)aFmts[ nFndPos ];
+ aFmts.Remove( nFndPos, 1 );
- uno::Reference< frame::XModel > xModel( rEvent.Source, uno::UNO_QUERY );
- uno::Reference< util::XModifyBroadcaster > xBrdcst(xModel, uno::UNO_QUERY);
+ uno::Reference< frame::XModel > xModel( rEvent.Source, uno::UNO_QUERY );
+ uno::Reference< util::XModifyBroadcaster > xBrdcst(xModel, uno::UNO_QUERY);
- try
- {
if( xBrdcst.is() )
xBrdcst->removeModifyListener( xListener );
+
+ delete pDepend;
+ if( !aFmts.Count() )
+ {
+ // we are the last?
+ // then can we delete us
+ xSwXOLEListener = 0;
+ }
}
- catch(Exception& rEx)
+}
+/* ---------------------------------------------------------------------------
+
+ ---------------------------------------------------------------------------*/
+sal_Bool SwXOLEListener::AddOLEFmt( SwFrmFmt& rFmt )
+{
+ for( sal_uInt16 n = 0, nCnt = aFmts.Count(); n < nCnt; ++n )
+ if( &rFmt == ((SwDepend*)aFmts[ n ])->GetRegisteredIn() )
+ return sal_False; // is in the array
+
+ SwDepend* pNew = new SwDepend( this, &rFmt );
+ aFmts.Insert( pNew, aFmts.Count() );
+ return sal_True;
+}
+/* ---------------------------------------------------------------------------
+
+ ---------------------------------------------------------------------------*/
+void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+{
+ const SwClient* pClient = 0;
+
+ switch( pOld ? pOld->Which() : 0 )
{
- DBG_ERROR("OLE Listener couldn't be removed")
+ case RES_REMOVE_UNO_OBJECT:
+ case RES_OBJECTDYING:
+ pClient = (SwClient*)((SwPtrMsgPoolItem *)pOld)->pObject;
+ break;
+
+ case RES_FMT_CHG:
+ // wurden wir an das neue umgehaengt und wird das alte geloscht?
+ if( ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() )
+ {
+ pClient = ((SwFmtChg*)pNew)->pChangedFmt;
+ }
+ break;
+ }
+
+ if( pClient )
+ {
+ uno::Reference< util::XModifyListener > xListener( this );
+
+ SwDepend* pDepend;
+ for( sal_uInt16 n = 0, nCnt = aFmts.Count(); n < nCnt; ++n )
+ {
+ if( pClient == (pDepend = (SwDepend*)aFmts[ n ])->GetRegisteredIn() )
+ {
+ aFmts.Remove( n, 1 );
+
+ uno::Reference<frame::XModel> xModel = GetModel( *(SwFmt*)pClient );
+ if( xModel.is() )
+ {
+ uno::Reference< util::XModifyBroadcaster > xBrdcst(xModel, uno::UNO_QUERY);
+ if( xBrdcst.is() )
+ xBrdcst->removeModifyListener( xListener );
+ }
+
+ delete pDepend;
+ if( !aFmts.Count() )
+ {
+ // we are the last?
+ // then can we delete us
+ xSwXOLEListener = 0;
+ }
+ break;
+ }
+ }
}
}
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+uno::Reference< frame::XModel > SwXOLEListener::GetModel( const SwFmt& rFmt, SwOLENode** ppNd ) const
{
- ClientModify(this, pOld, pNew);
- if(!GetRegisteredIn())
- xOLEModel = 0;
+ SfxObjectShell* pObjSh = GetObjShell( rFmt, ppNd );
+ return pObjSh ? pObjSh->GetBaseModel() : (uno::Reference< frame::XModel >)0;
+}
+/* ---------------------------------------------------------------------------
+
+ ---------------------------------------------------------------------------*/
+SfxObjectShell* SwXOLEListener::GetObjShell( const SwFmt& rFmt,
+ SwOLENode** ppNd ) const
+{
+ SfxObjectShell* pShell = 0;
+ const SwFmtCntnt& rCnt = rFmt.GetCntnt();
+ if( rCnt.GetCntntIdx() )
+ {
+ SwNodeIndex aIdx( *rCnt.GetCntntIdx(), 1 );
+ SwOLENode* pOleNode = aIdx.GetNode().GetOLENode();
+ if( pOleNode && pOleNode->GetOLEObj().IsOleRef() )
+ {
+ SfxInPlaceObjectRef xIP( pOleNode->GetOLEObj().GetOleRef() );
+ if( xIP.Is() )
+ pShell = xIP->GetObjectShell();
+ }
+ if( ppNd )
+ *ppNd = pOleNode;
+ }
+ return pShell;
+}
+/* ---------------------------------------------------------------------------
+
+ ---------------------------------------------------------------------------*/
+sal_uInt16 SwXOLEListener::FindEntry( const EventObject& rEvent,SwOLENode** ppNd)
+{
+ sal_uInt16 nRet = USHRT_MAX;
+ uno::Reference< frame::XModel > xSrch( rEvent.Source, uno::UNO_QUERY );
+
+ for( sal_uInt16 n = 0, nCnt = aFmts.Count(); n < nCnt; ++n )
+ {
+ SwDepend* pDepend = (SwDepend*)aFmts[ n ];
+ SwFrmFmt* pFmt = (SwFrmFmt*)pDepend->GetRegisteredIn();
+ if( !pFmt )
+ {
+ ASSERT( pFmt, "wo ist das Format geblieben?" );
+ aFmts.Remove( n, 1 );
+ delete pDepend;
+ --n;
+ --nCnt;
+ }
+ else
+ {
+ uno::Reference< frame::XModel > xFmt( GetModel( *pFmt, ppNd ), uno::UNO_QUERY);
+ if( xFmt == xSrch )
+ {
+ nRet = n;
+ break;
+ }
+ }
+ }
+ return nRet;
}
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 1c11e955c517..70d55da7aab9 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoftn.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: tl $ $Date: 2002-09-13 12:45:15 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -227,12 +227,13 @@ uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL SwXFootnote::getTypes( )
---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXFootnote::getImplementationId( ) throw(uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- bInit = TRUE;
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
}
return aId;
}
@@ -319,7 +320,7 @@ void SwXFootnote::attachToRange(const uno::Reference< text::XTextRange > & xText
aFootNote.SetNumStr(m_sLabel);
SfxItemSet aSet(pDoc->GetAttrPool(), RES_TXTATR_FTN, RES_TXTATR_FTN, 0L);
aSet.Put(aFootNote);
- SwXTextCursor::SetCrsrAttr(aPam, aSet);
+ SwXTextCursor::SetCrsrAttr(aPam, aSet, 0);
pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttr(
aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FTN );
@@ -460,11 +461,13 @@ uno::Reference< text::XTextCursor > SwXFootnote::createTextCursorByRange(
if(pFmt && SwXTextRange::XTextRangeToSwPaM(aPam, aTextPosition))
{
const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn();
-#ifdef DEBUG
- const SwStartNode* p1 = aPam.GetNode()->FindFootnoteStartNode();
- const SwNode& rStNode = pTxtFtn->GetStartNode()->GetNode();
-#endif
- if(aPam.GetNode()->FindStartNode() == &pTxtFtn->GetStartNode()->GetNode())
+
+ // skip section nodes to find 'true' start node
+ const SwNode* pStart = aPam.GetNode()->FindFootnoteStartNode();
+ while( pStart->IsSectionNode() )
+ pStart = pStart->FindStartNode();
+
+ if( pStart == &pTxtFtn->GetStartNode()->GetNode())
aRef = (text::XWordCursor*)new SwXTextCursor(this , *aPam.GetPoint(), CURSOR_FOOTNOTE, GetDoc(), aPam.GetMark());
}
else
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 966537b8ed73..1e5003a80aff 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoidx.cxx,v $
*
- * $Revision: 1.49 $
+ * $Revision: 1.50 $
*
- * last change: $Author: os $ $Date: 2002-11-01 15:27:55 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -616,7 +616,13 @@ void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName,
aForm.SetCommaSeparated(lcl_AnyToBool(aValue));
break;
case WID_LABEL_CATEGORY :
- pTOXBase->SetSequenceName(lcl_AnyToString(aValue));
+ {
+ // convert file-format/API/external programmatic english name
+ // to internal UI name before usage
+ String aName( SwStyleNameMapper::GetSpecialExtraUIName(
+ lcl_AnyToString(aValue) ) );
+ pTOXBase->SetSequenceName( aName );
+ }
break;
case WID_LABEL_DISPLAY_TYPE :
{
@@ -888,8 +894,15 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName)
bRet = rForm.IsCommaSeparated();
break;
case WID_LABEL_CATEGORY :
- aRet <<= OUString(pTOXBase->GetSequenceName());
+ {
+ // convert internal UI name to
+ // file-format/API/external programmatic english name
+ // before usage
+ String aName( SwStyleNameMapper::GetSpecialExtraProgName(
+ pTOXBase->GetSequenceName() ) );
+ aRet <<= OUString( aName );
bBOOL = sal_False;
+ }
break;
case WID_LABEL_DISPLAY_TYPE :
{
@@ -1587,6 +1600,7 @@ void SwXDocumentIndexMark::attachToRange(const Reference< text::XTextRange > & x
aMark.SetPrimaryKeyReading(sPrimaryKeyReading);
if(sSecondaryKeyReading.Len())
aMark.SetSecondaryKeyReading(sSecondaryKeyReading);
+ aMark.SetMainEntry(bMainEntry);
break;
case TOX_USER:
case TOX_CONTENT:
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index c4f57b63e4e5..a01918657d6d 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unomap.cxx,v $
*
- * $Revision: 1.146 $
+ * $Revision: 1.147 $
*
- * last change: $Author: os $ $Date: 2002-11-15 11:17:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -399,7 +399,9 @@ void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId )
COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \
COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN \
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_CHAR_STYLE_NAME), RES_TXTATR_CHARFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0},\
+ { SW_PROP_NMID(UNO_NAME_CHAR_STYLE_NAMES), FN_UNO_CHARFMT_SEQUENCE, CPPU_E2T(CPPUTYPE_OUSTRINGS), PropertyAttribute::MAYBEVOID, 0},
+
#define COMMON_CRSR_PARA_PROPERTIES_2 \
COMMON_CRSR_PARA_PROPERTIES_FN_ONLY \
@@ -667,6 +669,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
{ 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},
{ SW_PROP_NMID(UNO_NAME_CATEGORY), FN_UNO_CATEGORY, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , 0 },
+ { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
{0,0,0,0,0}
};
aMapArr[nPropertyId] = aParaStyleMap;
@@ -679,6 +682,8 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
{ 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},
{ SW_PROP_NMID(UNO_NAME_BACK_COLOR), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR },
+ { SW_PROP_NMID(UNO_NAME_BACK_COLOR_R_G_B), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR_R_G_B}, \
+ { SW_PROP_NMID(UNO_NAME_BACK_COLOR_TRANSPARENCY), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_BACK_COLOR_TRANSPARENCY}, \
// { SW_PROP_NMID(UNO_NAME_CHAIN_NEXT_NAME), RES_CHAIN, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_CHAIN_NEXTNAME},
// { SW_PROP_NMID(UNO_NAME_CHAIN_PREV_NAME), RES_CHAIN, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_CHAIN_PREVNAME},
/*not impl*/ { SW_PROP_NMID(UNO_NAME_CLIENT_MAP), RES_URL, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_URL_CLIENTMAP },
@@ -1180,6 +1185,8 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
static SfxItemPropertyMap aEmbeddedPropertyMap_Impl[] =
{
COMMON_FRAME_PROPERTIES
+ { SW_PROP_NMID(UNO_NAME_SURROUND_CONTOUR), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUR },
+ { SW_PROP_NMID(UNO_NAME_CONTOUR_OUTSIDE), RES_SURROUND, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_SURROUND_CONTOUROUTSIDE},
{ 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 },
@@ -2317,14 +2324,42 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
}
break;
case PROPERTY_MAP_TEXT :
+ {
static SfxItemPropertyMap aTextMap[] =
{
_REDLINE_NODE_PROPERTIES
{0,0,0,0}
};
aMapArr[nPropertyId] = aTextMap;
-
+ }
break;
+ case PROPERTY_MAP_MAILMERGE :
+ {
+ static SfxItemPropertyMap aMailMergeMap[] =
+ {
+ { SW_PROP_NMID(UNO_NAME_SELECTION), WID_SELECTION, CPPU_E2T(CPPUTYPE_SEQANY), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_RESULT_SET), WID_RESULT_SET, CPPU_E2T(CPPUTYPE_REFRESULTSET), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_CONNECTION), WID_CONNECTION, CPPU_E2T(CPPUTYPE_REFCONNECTION), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_MODEL), WID_MODEL, CPPU_E2T(CPPUTYPE_REFMODEL), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_DATA_SOURCE_NAME), WID_DATA_SOURCE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_DATA_COMMAND), WID_DATA_COMMAND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_FILTER), WID_FILTER, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_DOCUMENT_URL), WID_DOCUMENT_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_OUTPUT_URL), WID_OUTPUT_URL, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_DATA_COMMAND_TYPE), WID_DATA_COMMAND_TYPE, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_OUTPUT_TYPE), WID_OUTPUT_TYPE, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_ESCAPE_PROCESSING), WID_ESCAPE_PROCESSING, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_SINGLE_PRINT_JOBS), WID_SINGLE_PRINT_JOBS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_FILE_NAME_FROM_COLUMN), WID_FILE_NAME_FROM_COLUMN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_FILE_NAME_PREFIX), WID_FILE_NAME_PREFIX, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ {0,0,0,0}
+ };
+ aMapArr[nPropertyId] = aMailMergeMap;
+ }
+ break;
+
+ default:
+ DBG_ERROR( "unexpected property map ID" );
}
Sort(nPropertyId);
}
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 05df943f13c0..7158b79d9f42 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoobj.cxx,v $
*
- * $Revision: 1.64 $
+ * $Revision: 1.65 $
*
- * last change: $Author: cmc $ $Date: 2002-10-16 09:19:02 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -713,6 +713,28 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap,
case RES_TXTATR_CHARFMT:
lcl_setCharStyle(rPam.GetDoc(), aValue, rSet.GetItemSet() );
break;
+ case FN_UNO_CHARFMT_SEQUENCE:
+ {
+ Sequence<OUString> aCharStyles;
+ if(aValue >>= aCharStyles)
+ {
+ for(sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++)
+ {
+ Any aStyle;
+ rPam.GetDoc()->StartUndo( UNDO_START );
+ aStyle <<= aCharStyles.getConstArray()[nStyle];
+ //create a local set and apply each format directly
+ SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(), RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT );
+ lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet );
+ //the first style should replace the current attributes, all other have to be added
+ SwXTextCursor::SetCrsrAttr(rPam, aSet, nStyle ? CRSR_ATTR_MODE_DONTREPLACE : 0);
+ rPam.GetDoc()->EndUndo( UNDO_START );
+ }
+ }
+ else
+ bRet = sal_False;
+ }
+ break;
case FN_UNO_PARA_STYLE :
lcl_SetTxtFmtColl(aValue, rPam);
break;
@@ -855,7 +877,7 @@ return bRet;
* --------------------------------------------------*/
SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional)
{
- static const sal_uInt16 nMaxLookup = 255;
+ static const sal_uInt16 nMaxLookup = 1000;
SwFmtColl *pFmt = 0;
// if ( GetCrsrCnt() > nMaxLookup )
@@ -1619,10 +1641,21 @@ sal_Bool SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw( uno::RuntimeExc
SwUnoCrsr* pUnoCrsr = GetCrsr();
if(pUnoCrsr)
{
+ BOOL bWasEOS = isEndOfSentence();
SwXTextCursor::SelectPam(*pUnoCrsr, Expand);
bRet = pUnoCrsr->GoSentence(SwCursor::NEXT_SENT);
if(!bRet)
bRet = pUnoCrsr->MovePara(fnParaNext, fnParaStart);
+
+ // if at the end of the sentence (i.e. at the space after the '.')
+ // advance to next word in order for GoSentence to work properly
+ // next time and have isStartOfSentence return true after this call
+ if (!pUnoCrsr->IsStartWord())
+ {
+ BOOL bNextWord = pUnoCrsr->GoNextWord();
+ if (bWasEOS && !bNextWord)
+ bRet = sal_False;
+ }
}
else
throw uno::RuntimeException();
@@ -1943,7 +1976,7 @@ void SwXTextCursor::SetPropertyValue(
if(!lcl_setCrsrPropertyValue( pMap, rPaM, aSet, aValue ))
rPropSet.setPropertyValue(*pMap, aValue, aSet.GetItemSet( &rPaM ) );
if( aSet.GetItemSetPtr() )
- SwXTextCursor::SetCrsrAttr(rPaM, aSet.GetItemSet() );
+ SwXTextCursor::SetCrsrAttr(rPaM, aSet.GetItemSet(), 0 );
}
else
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) );
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 7201cf1c9194..2106a6baeb73 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoobj2.cxx,v $
*
- * $Revision: 1.31 $
+ * $Revision: 1.32 $
*
- * last change: $Author: mib $ $Date: 2002-11-26 14:25:48 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -904,9 +904,11 @@ SwDoc* SwXTextCursor::GetDoc()
/*-- 09.12.98 14:19:03---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, sal_Bool bTableMode)
+void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAttrMode)
{
sal_uInt16 nFlags = SETATTR_APICALL;
+ if(nAttrMode & CRSR_ATTR_MODE_DONTREPLACE)
+ nFlags |= SETATTR_DONTREPLACE;
SwDoc* pDoc = rPam.GetDoc();
//StartEndAction
UnoActionContext aAction(pDoc);
@@ -918,7 +920,7 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, sal_Bool bT
SwPaM *_pStartCrsr = &rPam;
do
{
- if( _pStartCrsr->HasMark() && ( bTableMode ||
+ if( _pStartCrsr->HasMark() && ( (CRSR_ATTR_MODE_TABLE & nAttrMode) ||
*_pStartCrsr->GetPoint() != *_pStartCrsr->GetMark() ))
pDoc->Insert(*_pStartCrsr, rSet, nFlags );
} while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != &rPam );
@@ -937,7 +939,7 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, sal_Bool bT
-----------------------------------------------------------------------*/
void SwXTextCursor::GetCrsrAttr(SwPaM& rPam, SfxItemSet& rSet, BOOL bCurrentAttrOnly)
{
-static const sal_uInt16 nMaxLookup = 255;
+ static const sal_uInt16 nMaxLookup = 1000;
SfxItemSet aSet( *rSet.GetPool(), rSet.GetRanges() );
SfxItemSet *pSet = &rSet;
SwPaM *_pStartCrsr = &rPam;
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index d22db893db7b..0705752a848b 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoport.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: tl $ $Date: 2002-09-26 07:30:11 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -318,7 +318,6 @@ uno::Reference< beans::XPropertySetInfo > SwXTextPortion::getPropertySetInfo(vo
xRedlPorRef = SfxItemPropertySet( aSwMapProvider.GetPropertyMap(
PROPERTY_MAP_REDLINE_PORTION) ).getPropertySetInfo();
-
return (PORTION_REDLINE_START == ePortionType ||
PORTION_REDLINE_END == ePortionType) ? xRedlPorRef : xTxtPorExtRef;
}
@@ -531,7 +530,7 @@ void SwXTextPortion::setPropertyValues(
if (!pMap)
throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
if ( pMap->nFlags & PropertyAttribute::READONLY)
- throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
+ throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
SwXTextCursor::SetPropertyValue( *pUnoCrsr, aPropSet, sTmp, pValues[nProp], pMap);
}
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 1f992a277d4d..fb86b6958933 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoportenum.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: jp $ $Date: 2002-02-01 12:42:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -255,7 +255,7 @@ void lcl_InsertRefMarkPortion(
if(!bEnd)
{
rArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_REFMARK_START)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_REFMARK_START)),
rArr.Count());
pPortion->SetRefMark(xContent);
pPortion->SetCollapsed(pAttr->GetEnd() ? FALSE : TRUE);
@@ -263,7 +263,7 @@ void lcl_InsertRefMarkPortion(
else
{
rArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_REFMARK_END)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_REFMARK_END)),
rArr.Count());
pPortion->SetRefMark(xContent);
}
@@ -295,7 +295,7 @@ void lcl_InsertTOXMarkPortion(
if(!bEnd)
{
rArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_TOXMARK_START)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_TOXMARK_START)),
rArr.Count());
pPortion->SetTOXMark(xContent);
pPortion->SetCollapsed(pAttr->GetEnd() ? FALSE : TRUE);
@@ -303,7 +303,7 @@ void lcl_InsertTOXMarkPortion(
if(bEnd)
{
rArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_TOXMARK_END)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_TOXMARK_END)),
rArr.Count());
pPortion->SetTOXMark(xContent);
}
@@ -357,7 +357,7 @@ void lcl_ExportBookmark(
if(BKM_TYPE_START == pPtr->nBkmType || BKM_TYPE_START_END == pPtr->nBkmType)
{
rPortionArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_BOOKMARK_START)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_BOOKMARK_START)),
rPortionArr.Count());
pPortion->SetBookmark(pPtr->xBookmark);
pPortion->SetCollapsed(BKM_TYPE_START_END == pPtr->nBkmType ? TRUE : FALSE);
@@ -366,7 +366,7 @@ void lcl_ExportBookmark(
if(BKM_TYPE_END == pPtr->nBkmType)
{
rPortionArr.Insert(
- new Reference< XTextRange >(pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_BOOKMARK_END)),
+ new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_BOOKMARK_END)),
rPortionArr.Count());
pPortion->SetBookmark(pPtr->xBookmark);
}
@@ -501,7 +501,7 @@ Reference<XTextRange> lcl_ExportHints(SwpHints* pHints,
{
pUnoCrsr->Right(1,CRSR_SKIP_CHARS);
SwXTextPortion* pPortion;
- xRef = pPortion = new SwXTextPortion(*pUnoCrsr, rParent, PORTION_FOOTNOTE);
+ xRef = pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_FOOTNOTE);
Reference<XTextContent> xContent =
Reference<XTextContent>(
SwXFootnotes::GetObject(*pDoc, pAttr->SwTxtAttr::GetFtn()),
@@ -517,7 +517,7 @@ Reference<XTextRange> lcl_ExportHints(SwpHints* pHints,
rPortionArr.Insert(
new Reference< XTextRange >(
pPortion = new SwXTextPortion(
- *pUnoCrsr, rParent, PORTION_CONTROL_CHAR)),
+ pUnoCrsr, rParent, PORTION_CONTROL_CHAR)),
rPortionArr.Count());
pPortion->SetControlChar(3);
ePortionType = PORTION_TEXT;
@@ -530,7 +530,7 @@ Reference<XTextRange> lcl_ExportHints(SwpHints* pHints,
rPortionArr.Insert(
new Reference< XTextRange >(
pPortion = new SwXTextPortion(
- *pUnoCrsr, rParent, PORTION_CONTROL_CHAR)),
+ pUnoCrsr, rParent, PORTION_CONTROL_CHAR)),
rPortionArr.Count());
const SwFmtHardBlank& rFmt = pAttr->GetHardBlank();
if(rFmt.GetChar() == '-')
@@ -818,7 +818,7 @@ void SwXTextPortionEnumeration::CreatePortions()
{
lcl_ExportBkmAndRedline(aBkmArr, aRedArr, 0, pUnoCrsr, xParent, aPortionArr);
// the paragraph is empty
- xRef = new SwXTextPortion(*pUnoCrsr, xParent, ePortionType);
+ xRef = new SwXTextPortion(pUnoCrsr, xParent, ePortionType);
// are there any frames?
while(aFrameArr.Count())
{
@@ -827,7 +827,7 @@ void SwXTextPortionEnumeration::CreatePortions()
{
//the previously created portion has to be inserted here
aPortionArr.Insert(new Reference<XTextRange>(xRef), aPortionArr.Count());
- xRef = new SwXTextPortion(*pUnoCrsr, xParent,
+ xRef = new SwXTextPortion(pUnoCrsr, xParent,
*(SwFrmFmt*)pCurDepend->GetRegisteredIn());
}
delete pCurDepend;
@@ -867,7 +867,7 @@ void SwXTextPortionEnumeration::CreatePortions()
//ist hier schon ein Rahmen faellig?
if(nCurrentIndex == nFirstFrameIndex)
{
- xRef = new SwXTextPortion(*pUnoCrsr, xParent,
+ xRef = new SwXTextPortion(pUnoCrsr, xParent,
*(SwFrmFmt*)pFirstFrameDepend->GetRegisteredIn());
SwDepend* pCurDepend = aFrameArr.GetObject(0);
delete pCurDepend;
@@ -913,7 +913,7 @@ void SwXTextPortionEnumeration::CreatePortions()
}
}
if(!xRef.is() && pUnoCrsr->HasMark() )
- xRef = new SwXTextPortion(*pUnoCrsr, xParent, ePortionType);
+ xRef = new SwXTextPortion(pUnoCrsr, xParent, ePortionType);
if(xRef.is())
aPortionArr.Insert(new Reference<XTextRange>(xRef), aPortionArr.Count());
}
@@ -960,7 +960,7 @@ void SwXTextPortionEnumeration::CreatePortions()
SwDepend* pCurDepend = aFrameArr.GetObject(0);
if(pCurDepend->GetRegisteredIn())
{
- Reference<XTextRange> xRef = new SwXTextPortion(*pUnoCrsr, xParent,
+ Reference<XTextRange> xRef = new SwXTextPortion(pUnoCrsr, xParent,
*(SwFrmFmt*)pCurDepend->GetRegisteredIn());
aPortionArr.Insert(new Reference<XTextRange>(xRef), aPortionArr.Count());
}
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 12160bb3e002..cb2b705efe56 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoprnms.cxx,v $
*
- * $Revision: 1.82 $
+ * $Revision: 1.83 $
*
- * last change: $Author: os $ $Date: 2002-11-15 11:10:06 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -717,7 +717,22 @@ const SwPropNameTab aPropNameTab = {
/* 0635 UNO_NAME_HEADER_DYNAMIC_SPACING */ {MAP_CHAR_LEN("HeaderDynamicSpacing")},
/* 0636 UNO_NAME_FOOTER_DYNAMIC_SPACING */ {MAP_CHAR_LEN("FooterDynamicSpacing")},
/* 0637 UNO_NAME_BASIC_LIBRARIES */ {MAP_CHAR_LEN("BasicLibraries")},
-/* 0638 UNO_NAME_IS_FIXED_LANGUAGE */ {MAP_CHAR_LEN("IsFixedLanguage")}
+/* 0638 UNO_NAME_IS_FIXED_LANGUAGE */ {MAP_CHAR_LEN("IsFixedLanguage")},
+/* 0639 UNO_NAME_SELECTION */ {MAP_CHAR_LEN("Selection")},
+/* 0640 UNO_NAME_RESULT_SET */ {MAP_CHAR_LEN("ResultSet")},
+/* 0641 UNO_NAME_CONNECTION */ {MAP_CHAR_LEN("Connection")},
+/* 0642 UNO_NAME_MODEL */ {MAP_CHAR_LEN("Model")},
+/* 0643 UNO_NAME_DATA_SOURCE_NAME */ {MAP_CHAR_LEN("DataSourceName")},
+/* 0644 UNO_NAME_DATA_COMMAND */ {MAP_CHAR_LEN("DataCommand")},
+/* 0645 UNO_NAME_FILTER */ {MAP_CHAR_LEN("Filter")},
+/* 0646 UNO_NAME_DOCUMENT_URL */ {MAP_CHAR_LEN("DocumentURL")},
+/* 0647 UNO_NAME_OUTPUT_URL */ {MAP_CHAR_LEN("OutputURL")},
+/* 0648 UNO_NAME_OUTPUT_TYPE */ {MAP_CHAR_LEN("OutputType")},
+/* 0649 UNO_NAME_ESCAPE_PROCESSING */ {MAP_CHAR_LEN("EscapeProcessing")},
+/* 0650 UNO_NAME_SINGLE_PRINT_JOBS */ {MAP_CHAR_LEN("SinglePrintJobs")},
+/* 0651 UNO_NAME_FILE_NAME_FROM_COLUMN */ {MAP_CHAR_LEN("FileNameFromColumn")},
+/* 0652 UNO_NAME_FILE_NAME_PREFIX */ {MAP_CHAR_LEN("FileNamePrefix")},
+/* 0653 UNO_NAME_CHAR_STYLE_NAMES */ {MAP_CHAR_LEN("CharStyleNames")}
};
#ifndef PRODUCT
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index d2b62c899ed7..c24c8dc77a27 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoredline.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: dvo $ $Date: 2002-08-02 10:36:55 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -194,12 +194,12 @@ Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = FALSE;
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- bInit = TRUE;
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
}
return aId;
}
@@ -435,12 +435,13 @@ void SwXRedlinePortion::Validate() throw( RuntimeException )
---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- bInit = TRUE;
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
}
return aId;
}
@@ -709,11 +710,6 @@ Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
}
}
- else if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE))||
- rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE)))
- {
- //this will always be empty - redlines at the start or end of a redlined text cannot occur
- }
else
aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline);
return aRet;
@@ -881,12 +877,12 @@ Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = FALSE;
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- bInit = TRUE;
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
}
return aId;
}
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 9ef88966f9bf..063f2a882f82 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unorefmk.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2002-12-05 13:29:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -190,7 +190,7 @@ void SwXReferenceMark::InsertRefMark(SwPaM& rPam, SwDoc* pDoc)
SfxItemSet aSet(pDoc->GetAttrPool(), RES_TXTATR_REFMARK, RES_TXTATR_REFMARK, 0L);
aSet.Put(aRefMark);
sal_Bool bMark = *rPam.GetPoint() != *rPam.GetMark();
- SwXTextCursor::SetCrsrAttr(rPam, aSet);
+ SwXTextCursor::SetCrsrAttr(rPam, aSet, 0);
if( bMark && *rPam.GetPoint() > *rPam.GetMark())
rPam.Exchange();
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 9a578cb24ecd..b7b1aa628eb5 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotbl.cxx,v $
*
- * $Revision: 1.71 $
+ * $Revision: 1.72 $
*
- * last change: $Author: ab $ $Date: 2002-11-11 15:14:34 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -861,12 +861,13 @@ Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(::com::sun::star::uno
---------------------------------------------------------------------------*/
Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(::com::sun::star::uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId( 16 );
- static BOOL bInit = FALSE;
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ static Sequence< sal_Int8 > aId( 16 );
+ static sal_Bool bInit = sal_False;
if(!bInit)
{
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
- bInit = TRUE;
+ rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
+ bInit = sal_True;
}
return aId;
}
@@ -1847,7 +1848,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
0L);
SwXTextCursor::GetCrsrAttr(pTblCrsr->GetSelRing(), rSet);
aPropSet.setPropertyValue(*pMap, aValue, rSet);
- SwXTextCursor::SetCrsrAttr(pTblCrsr->GetSelRing(), rSet, sal_True);
+ SwXTextCursor::SetCrsrAttr(pTblCrsr->GetSelRing(), rSet, CRSR_ATTR_MODE_TABLE);
}
}
}
@@ -4952,7 +4953,7 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
SwTableLines& rLines = pTable->GetTabLines();
SwTableLine* pLine = rLines.GetObject(0);
SwTableBoxes& rBoxes = pLine->GetTabBoxes();
- pTLBox = rBoxes.GetObject(0);
+ pTLBox = rBoxes.GetObject(rBoxes.Count() - 1);
}
if(pTLBox)
{
@@ -4961,6 +4962,12 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
UnoActionContext aAction(pFrmFmt->GetDoc());
SwUnoCrsr* pUnoCrsr = pFrmFmt->GetDoc()->CreateUnoCrsr(aPos, sal_True);
pUnoCrsr->Move( fnMoveForward, fnGoNode );
+
+ {
+ // hier muessen die Actions aufgehoben werden
+ UnoActionRemoveContext aRemoveContext(pUnoCrsr->GetDoc());
+ }
+
pFrmFmt->GetDoc()->InsertCol(*pUnoCrsr, (sal_uInt16)nCount, bAppend);
delete pUnoCrsr;
}
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index ef38a8b62f63..4e72c77dd869 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unotext.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: os $ $Date: 2002-05-30 14:46:23 $
+ * last change: $Author: hr $ $Date: 2003-03-27 15:41:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -330,6 +330,7 @@ void SwXText::insertString(const uno::Reference< XTextRange > & xTextRange,
{
//hier wird ein PaM angelegt, der vor dem Parameter-PaM